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.si...@intel.com> Signed-off-by: Abraham Tovar <abrahamx.to...@intel.com> Signed-off-by: Lukasz Krakowiak <lukaszx.krakow...@intel.com> --- lib/librte_sched/rte_sched.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) 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; } -- 2.21.0