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 6995FA045E for ; Tue, 28 May 2019 14:14:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0368D1B9D0; Tue, 28 May 2019 14:08:44 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id AB1291B9AD for ; Tue, 28 May 2019 14:08:31 +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:31 -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:29 -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:41 +0200 Message-Id: <20190528120553.2992-16-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 15/27] sched: update pipe and tc queues prefetch 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 pipe and tc queues prefetch functions of 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 | 42 +++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c index 74a8e0a71..07939c04f 100644 --- a/lib/librte_sched/rte_sched.c +++ b/lib/librte_sched/rte_sched.c @@ -2389,34 +2389,42 @@ grinder_wrr(struct rte_sched_port *port, uint32_t pos) #define grinder_evict(port, pos) static inline void -grinder_prefetch_pipe(struct rte_sched_port *port, uint32_t pos) +grinder_prefetch_pipe(struct rte_sched_subport *subport, uint32_t pos) { - struct rte_sched_grinder *grinder = port->grinder + pos; + struct rte_sched_grinder *grinder = subport->grinder + pos; rte_prefetch0(grinder->pipe); - rte_prefetch0(grinder->queue[0]); + rte_prefetch0(grinder->sp.queue); } static inline void grinder_prefetch_tc_queue_arrays(struct rte_sched_port *port, uint32_t pos) { - struct rte_sched_grinder *grinder = port->grinder + pos; - uint16_t qsize, qr[4]; + struct rte_sched_grinder *grinder = port->subport->grinder + pos; + struct rte_sched_pipe *pipe = grinder->pipe; + struct rte_sched_queue *queue; + uint32_t tc_index = grinder->tc_index, i; + uint16_t qsize, qr[RTE_SCHED_WRR_QUEUES_PER_PIPE]; + + if (tc_index < pipe->n_sp_queues) { + queue = grinder->sp.queue; + qsize = grinder->sp.qsize; + qr[0] = queue->qr & (qsize - 1); - qsize = grinder->qsize; - qr[0] = grinder->queue[0]->qr & (qsize - 1); - qr[1] = grinder->queue[1]->qr & (qsize - 1); - qr[2] = grinder->queue[2]->qr & (qsize - 1); - qr[3] = grinder->queue[3]->qr & (qsize - 1); + rte_prefetch0(grinder->sp.qbase + qr[0]); + return; + } + + for (i = 0; i < pipe->n_be_queues; i++) { + queue = grinder->be.queue[i]; + qsize = grinder->be.qsize[i]; + qr[i] = queue->qr & (qsize - 1); - rte_prefetch0(grinder->qbase[0] + qr[0]); - rte_prefetch0(grinder->qbase[1] + qr[1]); + rte_prefetch0(grinder->be.qbase[i] + qr[i]); + } grinder_wrr_load(port, pos); grinder_wrr(port, pos); - - rte_prefetch0(grinder->qbase[2] + qr[2]); - rte_prefetch0(grinder->qbase[3] + qr[3]); } static inline void @@ -2447,7 +2455,7 @@ grinder_handle(struct rte_sched_port *port, uint32_t pos) case e_GRINDER_PREFETCH_PIPE: { if (grinder_next_pipe(port->subport, pos)) { - grinder_prefetch_pipe(port, pos); + grinder_prefetch_pipe(port->subport, pos); port->busy_grinders++; grinder->state = e_GRINDER_PREFETCH_TC_QUEUE_ARRAYS; @@ -2508,7 +2516,7 @@ grinder_handle(struct rte_sched_port *port, uint32_t pos) /* Look for another active pipe */ if (grinder_next_pipe(port->subport, pos)) { - grinder_prefetch_pipe(port, pos); + grinder_prefetch_pipe(port->subport, pos); grinder->state = e_GRINDER_PREFETCH_TC_QUEUE_ARRAYS; return result; -- 2.20.1