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 6E511A045E for ; Tue, 28 May 2019 14:15:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 15A7E1B9E4; Tue, 28 May 2019 14:08:50 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 342251B99B for ; Tue, 28 May 2019 14:08:37 +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:36 -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:35 -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:44 +0200 Message-Id: <20190528120553.2992-19-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 18/27] sched: update mbuf prefetch function 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 mbuf prefetch function of the scheduler grinder 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 | 42 ++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c index ba344f0a1..06d89e3fd 100644 --- a/lib/librte_sched/rte_sched.c +++ b/lib/librte_sched/rte_sched.c @@ -2478,19 +2478,43 @@ grinder_prefetch_tc_queue_arrays(struct rte_sched_port *port, uint32_t pos) } static inline void -grinder_prefetch_mbuf(struct rte_sched_port *port, uint32_t pos) +grinder_prefetch_mbuf(struct rte_sched_subport *subport, uint32_t pos) { - struct rte_sched_grinder *grinder = port->grinder + pos; - uint32_t qpos = grinder->qpos; - struct rte_mbuf **qbase = grinder->qbase[qpos]; - uint16_t qsize = grinder->qsize; - uint16_t qr = grinder->queue[qpos]->qr & (qsize - 1); + struct rte_sched_grinder *grinder = subport->grinder + pos; + struct rte_mbuf **qbase; + uint32_t tc_index = grinder->tc_index; + uint32_t qpos; + uint16_t qsize, qr; + + if (tc_index < RTE_SCHED_TRAFFIC_CLASS_BE) { + qbase = grinder->sp.qbase; + qsize = grinder->sp.qsize; + qr = grinder->sp.queue->qr & (qsize - 1); + + grinder->pkt = qbase[qr]; + rte_prefetch0(grinder->pkt); + + if (unlikely((qr & 0x7) == 7)) { + uint16_t qr_next = + (grinder->sp.queue->qr + 1) & (qsize - 1); + + rte_prefetch0(qbase + qr_next); + } + + return; + } + + qpos = grinder->be.qpos; + qbase = grinder->be.qbase[qpos]; + qsize = grinder->be.qsize[qpos]; + qr = grinder->be.queue[qpos]->qr & (qsize - 1); grinder->pkt = qbase[qr]; rte_prefetch0(grinder->pkt); if (unlikely((qr & 0x7) == 7)) { - uint16_t qr_next = (grinder->queue[qpos]->qr + 1) & (qsize - 1); + uint16_t qr_next = + (grinder->be.queue[qpos]->qr + 1) & (qsize - 1); rte_prefetch0(qbase + qr_next); } @@ -2529,7 +2553,7 @@ grinder_handle(struct rte_sched_port *port, uint32_t pos) case e_GRINDER_PREFETCH_MBUF: { - grinder_prefetch_mbuf(port, pos); + grinder_prefetch_mbuf(port->subport, pos); grinder->state = e_GRINDER_READ_MBUF; return 0; @@ -2544,7 +2568,7 @@ grinder_handle(struct rte_sched_port *port, uint32_t pos) /* Look for next packet within the same TC */ if (result && grinder->qmask) { grinder_wrr(port->subport, pos); - grinder_prefetch_mbuf(port, pos); + grinder_prefetch_mbuf(port->subport, pos); return 1; } -- 2.20.1