From patchwork Tue Jun 28 12:05:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 71073 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp1547313qgy; Tue, 28 Jun 2016 05:06:49 -0700 (PDT) X-Received: by 10.200.46.155 with SMTP id h27mr1101679qta.59.1467115609000; Tue, 28 Jun 2016 05:06:49 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id v35si22358123qtb.4.2016.06.28.05.06.48; Tue, 28 Jun 2016 05:06:48 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id A719368864; Tue, 28 Jun 2016 12:06:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id DC00668867; Tue, 28 Jun 2016 12:06:38 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id BB4946886C; Tue, 28 Jun 2016 12:06:34 +0000 (UTC) Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com [209.85.220.41]) by lists.linaro.org (Postfix) with ESMTPS id A605968865 for ; Tue, 28 Jun 2016 12:06:16 +0000 (UTC) Received: by mail-pa0-f41.google.com with SMTP id b13so6094690pat.0 for ; Tue, 28 Jun 2016 05:06:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rGEKqcFfbivqS/rH+pwKLdISf08Bd4VoJyPqqHJMQy4=; b=ea7nqgKVx58X075vDTibv+iSdeh+s9q9nWLaZk9tdvmBR8yBCo0+KtD6e3KwUYykym yyk8ZNRMINUrHIb3Ryi/7pikLgpNe+Nm+6NdJQI5V0yvrl3gSrFCHn8l5vXbb0ELcpQU V9RTlLvaVA0a2bXA7wFFPsn7b4Atca+0bF8GzQE9Yg82Yieyiet1eqIXy5OdVIQOCljX wiETgCYPOq1swoSOpYG3Y/g+aOdqTnAvJpUSAWoJ5mGEB2f2f75qL3fFD/SOwuHODTx+ 6Vs6pcEdQAD4zjA/LWglH03sjsfQycr6AKcAlKlc+NSjqqyijaBx4p1L52OkUEzu2dxJ GBng== X-Gm-Message-State: ALyK8tLXbr8fSQPfUnzm8zhkeXuYn1+6GSOHqDnYk1Pgw3wrsRFp+3tJfhqqAIvHivQ19Tlaerw= X-Received: by 10.66.253.70 with SMTP id zy6mr1151121pac.55.1467115575952; Tue, 28 Jun 2016 05:06:15 -0700 (PDT) Received: from localhost.localdomain ([122.166.219.57]) by smtp.gmail.com with ESMTPSA id i68sm6437057pfe.64.2016.06.28.05.06.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Jun 2016 05:06:15 -0700 (PDT) From: Balasubramanian Manoharan To: lng-odp@lists.linaro.org Date: Tue, 28 Jun 2016 17:35:55 +0530 Message-Id: <1467115556-8187-2-git-send-email-bala.manoharan@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1467115556-8187-1-git-send-email-bala.manoharan@linaro.org> References: <1467115556-8187-1-git-send-email-bala.manoharan@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH/API-NEXTv2 2/3] linux-generic: traffic_mngr: add pktio interface to odp_tm_egress_t struct X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Code changes for replacing odp_pktout_queue_t with odp_pktio_t in TM system Signed-off-by: Balasubramanian Manoharan --- platform/linux-generic/include/odp_traffic_mngr_internal.h | 2 +- platform/linux-generic/odp_traffic_mngr.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/include/odp_traffic_mngr_internal.h b/platform/linux-generic/include/odp_traffic_mngr_internal.h index 3586889..3e13a0a 100644 --- a/platform/linux-generic/include/odp_traffic_mngr_internal.h +++ b/platform/linux-generic/include/odp_traffic_mngr_internal.h @@ -379,7 +379,7 @@ typedef struct { tm_queue_info_t priority_info[ODP_TM_MAX_PRIORITIES]; tm_random_data_t tm_random_data; - + odp_pktout_queue_t pktout; uint64_t current_time; uint8_t tm_idx; uint8_t first_enq; diff --git a/platform/linux-generic/odp_traffic_mngr.c b/platform/linux-generic/odp_traffic_mngr.c index 1fa2d27..54c3517 100644 --- a/platform/linux-generic/odp_traffic_mngr.c +++ b/platform/linux-generic/odp_traffic_mngr.c @@ -2106,7 +2106,7 @@ static void tm_send_pkt(tm_system_t *tm_system, uint32_t max_sends) tm_system->egress_pkt_desc = EMPTY_PKT_DESC; if (tm_system->egress.egress_kind == ODP_TM_EGRESS_PKT_IO) - odp_pktout_send(tm_system->egress.pktout, &odp_pkt, 1); + odp_pktout_send(tm_system->pktout, &odp_pkt, 1); else if (tm_system->egress.egress_kind == ODP_TM_EGRESS_FN) tm_system->egress.egress_fcn(odp_pkt); else @@ -2424,6 +2424,7 @@ int odp_tm_capabilities(odp_tm_capabilities_t capabilities[] ODP_UNUSED, cap_ptr->max_tm_queues = ODP_TM_MAX_TM_QUEUES; cap_ptr->max_levels = ODP_TM_MAX_LEVELS; cap_ptr->tm_queue_shaper_supported = true; + cap_ptr->egress_fcn_supported = true; cap_ptr->tm_queue_wred_supported = true; cap_ptr->tm_queue_dual_slope_supported = true; cap_ptr->vlan_marking_supported = true; @@ -2605,6 +2606,7 @@ odp_tm_t odp_tm_create(const char *name, tm_system_t *tm_system; odp_bool_t create_fail; odp_tm_t odp_tm; + odp_pktout_queue_t pktout; uint32_t malloc_len, max_num_queues, max_queued_pkts, max_timers; uint32_t max_tm_queues, max_sorted_lists; int rc; @@ -2625,6 +2627,10 @@ odp_tm_t odp_tm_create(const char *name, return ODP_TM_INVALID; } + if (odp_pktout_queue(egress->pktio, &pktout, 1) != 1) + return ODP_TM_INVALID; + + tm_system->pktout = pktout; tm_system->name_tbl_id = name_tbl_id; max_tm_queues = requirements->max_tm_queues; memcpy(&tm_system->egress, egress, sizeof(odp_tm_egress_t));