From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 2AD18A045E for ; Tue, 28 May 2019 14:10:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DC2DA1B9AF; Tue, 28 May 2019 14:08:31 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 7195D1B993 for ; Tue, 28 May 2019 14:08:21 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 May 2019 05:08:21 -0700 X-ExtLoop1: 1 Received: from lkrakowx-mobl.ger.corp.intel.com ([10.103.104.99]) by fmsmga001.fm.intel.com with ESMTP; 28 May 2019 05:08:19 -0700 From: Lukasz Krakowiak To: cristian.dumitrescu@intel.com Cc: dev@dpdk.org, Jasvinder Singh , Abraham Tovar , Lukasz Krakowiak Date: Tue, 28 May 2019 14:05:35 +0200 Message-Id: <20190528120553.2992-10-lukaszx.krakowiak@intel.com> X-Mailer: git-send-email 2.19.2.windows.1 In-Reply-To: <20190528120553.2992-1-lukaszx.krakowiak@intel.com> References: <20190528120553.2992-1-lukaszx.krakowiak@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 09/27] sched: update pkt read and write api X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Jasvinder Singh Update run time packet read and write api implementation of the scheduler to allow configuration flexiblity for pipe traffic classes and queues, and subport level configuration of the pipe parameters.. Signed-off-by: Jasvinder Singh Signed-off-by: Abraham Tovar Signed-off-by: Lukasz Krakowiak --- lib/librte_sched/rte_sched.c | 32 +++++++++++++++++--------------- lib/librte_sched/rte_sched.h | 8 ++++---- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c index 4b1959bb4..d28d2d203 100644 --- a/lib/librte_sched/rte_sched.c +++ b/lib/librte_sched/rte_sched.c @@ -1351,17 +1351,15 @@ rte_sched_port_pipe_profile_add(struct rte_sched_port *port, static inline uint32_t rte_sched_port_qindex(struct rte_sched_port *port, + struct rte_sched_subport *s, uint32_t subport, uint32_t pipe, - uint32_t traffic_class, uint32_t queue) { return ((subport & (port->n_subports_per_port - 1)) << - (port->n_pipes_per_subport_log2 + 4)) | - ((pipe & (port->n_pipes_per_subport - 1)) << 4) | - ((traffic_class & - (RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE - 1)) << 2) | - (queue & (RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS - 1)); + (port->n_max_subport_pipes_log2 + 4)) | + ((pipe & (s->n_subport_pipes - 1)) << 4) | + (queue & (RTE_SCHED_QUEUES_PER_PIPE - 1)); } void @@ -1371,9 +1369,9 @@ rte_sched_port_pkt_write(struct rte_sched_port *port, uint32_t traffic_class, uint32_t queue, enum rte_color color) { - uint32_t queue_id = rte_sched_port_qindex(port, subport, pipe, - traffic_class, queue); - rte_mbuf_sched_set(pkt, queue_id, traffic_class, (uint8_t)color); + struct rte_sched_subport *s = port->subports[subport]; + uint32_t qindex = rte_sched_port_qindex(port, s, subport, pipe, queue); + rte_mbuf_sched_set(pkt, qindex, traffic_class, (uint8_t)color); } void @@ -1382,13 +1380,17 @@ rte_sched_port_pkt_read_tree_path(struct rte_sched_port *port, uint32_t *subport, uint32_t *pipe, uint32_t *traffic_class, uint32_t *queue) { - uint32_t queue_id = rte_mbuf_sched_queue_get(pkt); + struct rte_sched_subport *s; + uint32_t qindex = rte_mbuf_sched_queue_get(pkt); + uint32_t tc_id = rte_mbuf_sched_traffic_class_get(pkt); + + *subport = (qindex >> (port->n_max_subport_pipes_log2 + 4)) & + (port->n_subports_per_port - 1); - *subport = queue_id >> (port->n_pipes_per_subport_log2 + 4); - *pipe = (queue_id >> 4) & (port->n_pipes_per_subport - 1); - *traffic_class = (queue_id >> 2) & - (RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE - 1); - *queue = queue_id & (RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS - 1); + s = port->subports[*subport]; + *pipe = (qindex >> 4) & (s->n_subport_pipes - 1); + *traffic_class = tc_id; + *queue = qindex & (RTE_SCHED_QUEUES_PER_PIPE - 1); } enum rte_color diff --git a/lib/librte_sched/rte_sched.h b/lib/librte_sched/rte_sched.h index da5790fc4..635b59550 100644 --- a/lib/librte_sched/rte_sched.h +++ b/lib/librte_sched/rte_sched.h @@ -402,9 +402,9 @@ rte_sched_queue_read_stats(struct rte_sched_port *port, * @param pipe * Pipe ID within subport * @param traffic_class - * Traffic class ID within pipe (0 .. 3) + * Traffic class ID within pipe (0 .. 8) * @param queue - * Queue ID within pipe traffic class (0 .. 3) + * Queue ID within pipe traffic class (0 .. 15) * @param color * Packet color set */ @@ -429,9 +429,9 @@ rte_sched_port_pkt_write(struct rte_sched_port *port, * @param pipe * Pipe ID within subport * @param traffic_class - * Traffic class ID within pipe (0 .. 3) + * Traffic class ID within pipe (0 .. 8) * @param queue - * Queue ID within pipe traffic class (0 .. 3) + * Queue ID within pipe traffic class (0 .. 15) * */ void -- 2.20.1