From patchwork Mon Jun 20 11:01:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 70440 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp1449246qgy; Mon, 20 Jun 2016 04:02:32 -0700 (PDT) X-Received: by 10.55.53.145 with SMTP id c139mr20401243qka.58.1466420551941; Mon, 20 Jun 2016 04:02:31 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id o70si14659867qki.85.2016.06.20.04.02.31; Mon, 20 Jun 2016 04:02:31 -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 2DE5D635C8; Mon, 20 Jun 2016 11:02:31 +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 6F0FB61799; Mon, 20 Jun 2016 11:02:26 +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 67D8F68017; Mon, 20 Jun 2016 11:02:24 +0000 (UTC) Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by lists.linaro.org (Postfix) with ESMTPS id EE18161605 for ; Mon, 20 Jun 2016 11:02:00 +0000 (UTC) Received: by mail-pa0-f45.google.com with SMTP id wo6so13688105pac.3 for ; Mon, 20 Jun 2016 04:02:00 -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=XsyhpwncJR0tYx7TdbqyTXVoKT+EozujXqvwTurxJyEg4YatyH4gnJrCyuMnxFlkuy VyZD70Ockt+Yad80MNM5pZepUnEeuh2Yv1C0A0jRdMReTDLCrt8ndGOZ9pP0eY4KXzB7 +uKlOF5xiJowtlNlq6yuMhp4kCmfm/F9hs9EyMcCX2YSmKDXOaR9dF9uDHPiuPRyQMEu sm9LnE/b3t4Pd/E7tD+/NSE1wy7zL++feXpTE43FUjmIZMqM+J3OvNXj2Rh2EGksCXdR yQoyJMpxIDSq4/HE6HJYuIIfQUY7hxsqChEo2bXvhlNDPTlJCnqgcpIZSH8302cj7SKD Az2Q== X-Gm-Message-State: ALyK8tJsKo6K08O72YWjZ1MGoZv3/1nQIwQBoxcKs/HdL0fWYLiNrxM2EAwo1eANZzh+/RFmcSI= X-Received: by 10.66.101.136 with SMTP id fg8mr21509398pab.144.1466420520200; Mon, 20 Jun 2016 04:02:00 -0700 (PDT) Received: from localhost.localdomain ([122.166.219.57]) by smtp.gmail.com with ESMTPSA id r7sm30267838pfa.3.2016.06.20.04.01.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 Jun 2016 04:01:59 -0700 (PDT) From: Balasubramanian Manoharan To: lng-odp@lists.linaro.org Date: Mon, 20 Jun 2016 16:31:38 +0530 Message-Id: <1466420499-25796-2-git-send-email-bala.manoharan@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1466420499-25796-1-git-send-email-bala.manoharan@linaro.org> References: <1466420499-25796-1-git-send-email-bala.manoharan@linaro.org> X-Topics: patch Cc: petri.savolainen@nokia.com, spinney@mellanox.com Subject: [lng-odp] [PATCH/API-NEXT 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));