[dpdk-dev,v3] event/sw: code refractor to reduce the fetch stall

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

Checks

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

Commit Message

Varghese, Vipin April 5, 2018, 5:56 a.m. UTC
  With rearranging the code to prefetch the contents before
loop check increases performance from single and multistage
atomic pipeline.

Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
---

Changes in V3:
 - fix compilation for initial element - Vipin
 - fix the time and date for email sent - Vipin

Changes in V2:
 - compilation fix for const flowid - Harry
 - Removal of sw_refill_pp_buf logic - Harry
---
 drivers/event/sw/sw_evdev_scheduler.c | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)
  

Comments

Jerin Jacob April 5, 2018, 8:53 a.m. UTC | #1
-----Original Message-----
> Date: Thu, 5 Apr 2018 11:26:30 +0530
> From: Vipin Varghese <vipin.varghese@intel.com>
> To: dev@dpdk.org, harry.van.haaren@intel.com
> CC: jerin.jacob@caviumnetworks.com, Vipin Varghese
>  <vipin.varghese@intel.com>
> Subject: [PATCH v3] event/sw: code refractor to reduce the fetch stall
> X-Mailer: git-send-email 1.9.1
> 
> With rearranging the code to prefetch the contents before
> loop check increases performance from single and multistage
> atomic pipeline.
> 
> Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
> Acked-by: Harry van Haaren <harry.van.haaren@intel.com>

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

>
  
Van Haaren, Harry April 13, 2018, 4:19 p.m. UTC | #2
> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> Sent: Thursday, April 5, 2018 9:53 AM
> To: Varghese, Vipin <vipin.varghese@intel.com>
> Cc: dev@dpdk.org; Van Haaren, Harry <harry.van.haaren@intel.com>
> Subject: Re: [PATCH v3] event/sw: code refractor to reduce the fetch stall
> 
> -----Original Message-----
> > Date: Thu, 5 Apr 2018 11:26:30 +0530
> > From: Vipin Varghese <vipin.varghese@intel.com>
> > To: dev@dpdk.org, harry.van.haaren@intel.com
> > CC: jerin.jacob@caviumnetworks.com, Vipin Varghese
> >  <vipin.varghese@intel.com>
> > Subject: [PATCH v3] event/sw: code refractor to reduce the fetch stall
> > X-Mailer: git-send-email 1.9.1
> >
> > With rearranging the code to prefetch the contents before
> > loop check increases performance from single and multistage
> > atomic pipeline.
> >
> > Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
> > Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
> 
> Applied to dpdk-next-eventdev/master. Thanks.


Hi Jerin,

On further investigation into the patch, the performance gains seem to be quite workload dependent.

Hereby a request to drop this patch from the next-eventdev tree, so that
we can investigate further, and rework / refactor for a future release.

Regards, -Harry
  
Jerin Jacob April 14, 2018, 5:28 a.m. UTC | #3
-----Original Message-----
> Date: Fri, 13 Apr 2018 16:19:54 +0000
> From: "Van Haaren, Harry" <harry.van.haaren@intel.com>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> CC: "dev@dpdk.org" <dev@dpdk.org>, "Varghese, Vipin"
>  <vipin.varghese@intel.com>
> Subject: RE: [PATCH v3] event/sw: code refractor to reduce the fetch stall
> 
> > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> > Sent: Thursday, April 5, 2018 9:53 AM
> > To: Varghese, Vipin <vipin.varghese@intel.com>
> > Cc: dev@dpdk.org; Van Haaren, Harry <harry.van.haaren@intel.com>
> > Subject: Re: [PATCH v3] event/sw: code refractor to reduce the fetch stall
> > 
> > -----Original Message-----
> > > Date: Thu, 5 Apr 2018 11:26:30 +0530
> > > From: Vipin Varghese <vipin.varghese@intel.com>
> > > To: dev@dpdk.org, harry.van.haaren@intel.com
> > > CC: jerin.jacob@caviumnetworks.com, Vipin Varghese
> > >  <vipin.varghese@intel.com>
> > > Subject: [PATCH v3] event/sw: code refractor to reduce the fetch stall
> > > X-Mailer: git-send-email 1.9.1
> > >
> > > With rearranging the code to prefetch the contents before
> > > loop check increases performance from single and multistage
> > > atomic pipeline.
> > >
> > > Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
> > > Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
> > 
> > Applied to dpdk-next-eventdev/master. Thanks.
> 
> 
> Hi Jerin,

Hi Harry,

> 
> On further investigation into the patch, the performance gains seem to be quite workload dependent.
> 
> Hereby a request to drop this patch from the next-eventdev tree, so that
> we can investigate further, and rework / refactor for a future release.

Removed from next-eventdev tree and updated status in the patchwork.
http://dpdk.org/dev/patchwork/patch/37219/

> 
> Regards, -Harry
  

Patch

diff --git a/drivers/event/sw/sw_evdev_scheduler.c b/drivers/event/sw/sw_evdev_scheduler.c
index e3a41e0..5eb3157 100644
--- a/drivers/event/sw/sw_evdev_scheduler.c
+++ b/drivers/event/sw/sw_evdev_scheduler.c
@@ -44,12 +44,13 @@ 
 	uint32_t qid_id = qid->id;
 
 	iq_dequeue_burst(sw, &qid->iq[iq_num], qes, count);
-	for (i = 0; i < count; i++) {
-		const struct rte_event *qe = &qes[i];
-		const uint16_t flow_id = SW_HASH_FLOWID(qes[i].flow_id);
-		struct sw_fid_t *fid = &qid->fids[flow_id];
-		int cq = fid->cq;
 
+	const struct rte_event *qe = &qes[0];
+	uint16_t flow_id = SW_HASH_FLOWID(qes[0].flow_id);
+	struct sw_fid_t *fid = &qid->fids[flow_id];
+	int cq = fid->cq;
+
+	for (i = 0; i < count; i++) {
 		if (cq < 0) {
 			uint32_t cq_idx = qid->cq_next_tx++;
 			if (qid->cq_next_tx == qid->cq_num_mapped_cqs)
@@ -101,6 +102,14 @@ 
 					&sw->cq_ring_space[cq]);
 			p->cq_buf_count = 0;
 		}
+
+		if (likely(i+1 < count)) {
+			qe = (qes + i + 1);
+			flow_id = SW_HASH_FLOWID(qes[i + 1].flow_id);
+			fid = &qid->fids[flow_id];
+			cq = fid->cq;
+		}
+
 	}
 	iq_put_back(sw, &qid->iq[iq_num], blocked_qes, nb_blocked);