[v2,18/28] sched: update mbuf prefetch function

Message ID 20190625153217.24301-19-jasvinder.singh@intel.com (mailing list archive)
State Changes Requested, archived
Delegated to: Cristian Dumitrescu
Headers
Series sched: feature enhancements |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Jasvinder Singh June 25, 2019, 3:32 p.m. UTC
  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 <jasvinder.singh@intel.com>
Signed-off-by: Abraham Tovar <abrahamx.tovar@intel.com>
Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
---
 lib/librte_sched/rte_sched.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
  

Patch

diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c
index 8b440637d..607fe6c18 100644
--- a/lib/librte_sched/rte_sched.c
+++ b/lib/librte_sched/rte_sched.c
@@ -2561,13 +2561,16 @@  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;
+	struct rte_sched_grinder *grinder = subport->grinder + pos;
+	struct rte_mbuf **qbase;
 	uint32_t qpos = grinder->qpos;
-	struct rte_mbuf **qbase = grinder->qbase[qpos];
-	uint16_t qsize = grinder->qsize[qpos];
-	uint16_t qr = grinder->queue[qpos]->qr & (qsize - 1);
+	uint16_t qsize, qr;
+
+	qbase = grinder->qbase[qpos];
+	qsize = grinder->qsize[qpos];
+	qr = grinder->queue[qpos]->qr & (qsize - 1);
 
 	grinder->pkt = qbase[qr];
 	rte_prefetch0(grinder->pkt);
@@ -2612,7 +2615,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;
@@ -2627,7 +2630,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;
 		}