From: Vipin Varghese Date: Tue, 27 Feb 2018 20:17:18 +0000 (+0530) Subject: event/sw: move stats code for better cache access X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=642bc2a33ca7231f39c368027ca4f7625945c95b;p=dpdk.git event/sw: move stats code for better cache access variables 'out_pkts_total' and 'out_pkts_total' will be in registers. Hence shifting the code after the loop, helps the update from registers. Signed-off-by: Vipin Varghese Acked-by: Kevin Laatz --- diff --git a/drivers/event/sw/sw_evdev_scheduler.c b/drivers/event/sw/sw_evdev_scheduler.c index 17bd4c0a64..9143b934f8 100644 --- a/drivers/event/sw/sw_evdev_scheduler.c +++ b/drivers/event/sw/sw_evdev_scheduler.c @@ -541,6 +541,12 @@ sw_event_schedule(struct rte_eventdev *dev) break; } while ((int)out_pkts_total < sched_quanta); + sw->stats.tx_pkts += out_pkts_total; + sw->stats.rx_pkts += in_pkts_total; + + sw->sched_no_iq_enqueues += (in_pkts_total == 0); + sw->sched_no_cq_enqueues += (out_pkts_total == 0); + /* push all the internal buffered QEs in port->cq_ring to the * worker cores: aka, do the ring transfers batched. */ @@ -552,10 +558,4 @@ sw_event_schedule(struct rte_eventdev *dev) sw->ports[i].cq_buf_count = 0; } - sw->stats.tx_pkts += out_pkts_total; - sw->stats.rx_pkts += in_pkts_total; - - sw->sched_no_iq_enqueues += (in_pkts_total == 0); - sw->sched_no_cq_enqueues += (out_pkts_total == 0); - }