[dpdk-dev] event/sw: move stats code for better cache access

Message ID 1519762639-78328-1-git-send-email-vipin.varghese@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers

Checks

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

Commit Message

Varghese, Vipin Feb. 27, 2018, 8:17 p.m. UTC
  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 <vipin.varghese@intel.com>
---
 drivers/event/sw/sw_evdev_scheduler.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
  

Comments

Kevin Laatz March 14, 2018, 1:14 p.m. UTC | #1
On 27/02/2018 20:17, Vipin Varghese wrote:
> 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 <vipin.varghese@intel.com>

<...>

Acked-by: Kevin Laatz <kevin.laatz@intel.com>
  
Jerin Jacob March 20, 2018, 5:48 a.m. UTC | #2
-----Original Message-----
> Date: Wed, 14 Mar 2018 13:14:10 +0000
> From: "Laatz, Kevin" <kevin.laatz@intel.com>
> To: Vipin Varghese <vipin.varghese@intel.com>
> CC: dev@dpdk.org, harry.van.haaren@intel.com
> Subject: Re: [dpdk-dev] [PATCH] event/sw: move stats code for better cache
>  access
> User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
>  Thunderbird/52.6.0
> 
> 
> 
> On 27/02/2018 20:17, Vipin Varghese wrote:
> > 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 <vipin.varghese@intel.com>
> 
> <...>
> 
> Acked-by: Kevin Laatz <kevin.laatz@intel.com>

Applied to dpdk-next-eventdev/master. Thanks.

> 
>
  

Patch

diff --git a/drivers/event/sw/sw_evdev_scheduler.c b/drivers/event/sw/sw_evdev_scheduler.c
index 17bd4c0..9143b93 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);
-
 }