DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev]  [PATCH] ring: fix sc dequeue performance issue
@ 2016-07-24 17:07 Jerin Jacob
  2016-07-24 22:57 ` Ananyev, Konstantin
  0 siblings, 1 reply; 3+ messages in thread
From: Jerin Jacob @ 2016-07-24 17:07 UTC (permalink / raw)
  To: dev; +Cc: thomas.monjalon, konstantin.ananyev, Jerin Jacob

Use of rte_smb_wmb() instead of rte_smb_rmb() in sc dequeue
function creates the additional overhead of waiting for
all the STOREs to be completed to local buffer from ring buffer
memory. The sc dequeue function demands only LOAD-STORE barrier
where LOADs from ring buffer memory needs to be
completed before tail pointer update. Changing to rte_smb_rmb()
to enable the required LOAD-STORE barrier.

Fixes: ecc7d10e448e ("ring: guarantee dequeue ordering before tail update")

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
 lib/librte_ring/rte_ring.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h
index f928324..0e22e69 100644
--- a/lib/librte_ring/rte_ring.h
+++ b/lib/librte_ring/rte_ring.h
@@ -756,7 +756,7 @@ __rte_ring_sc_do_dequeue(struct rte_ring *r, void **obj_table,
 
 	/* copy in table */
 	DEQUEUE_PTRS();
-	rte_smp_wmb();
+	rte_smp_rmb();
 
 	__RING_STAT_ADD(r, deq_success, n);
 	r->cons.tail = cons_next;
-- 
2.5.5

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] ring: fix sc dequeue performance issue
  2016-07-24 17:07 [dpdk-dev] [PATCH] ring: fix sc dequeue performance issue Jerin Jacob
@ 2016-07-24 22:57 ` Ananyev, Konstantin
  2016-07-25 14:54   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Ananyev, Konstantin @ 2016-07-24 22:57 UTC (permalink / raw)
  To: Jerin Jacob, dev; +Cc: thomas.monjalon



> -----Original Message-----
> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> Sent: Sunday, July 24, 2016 6:08 PM
> To: dev@dpdk.org
> Cc: thomas.monjalon@6wind.com; Ananyev, Konstantin <konstantin.ananyev@intel.com>; Jerin Jacob
> <jerin.jacob@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH] ring: fix sc dequeue performance issue
> 
> Use of rte_smb_wmb() instead of rte_smb_rmb() in sc dequeue function creates the additional overhead of waiting for all the STOREs to be
> completed to local buffer from ring buffer memory. The sc dequeue function demands only LOAD-STORE barrier where LOADs from ring
> buffer memory needs to be completed before tail pointer update. Changing to rte_smb_rmb() to enable the required LOAD-STORE barrier.
> 
> Fixes: ecc7d10e448e ("ring: guarantee dequeue ordering before tail update")
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> ---
>  lib/librte_ring/rte_ring.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h index f928324..0e22e69 100644
> --- a/lib/librte_ring/rte_ring.h
> +++ b/lib/librte_ring/rte_ring.h
> @@ -756,7 +756,7 @@ __rte_ring_sc_do_dequeue(struct rte_ring *r, void **obj_table,
> 
>  	/* copy in table */
>  	DEQUEUE_PTRS();
> -	rte_smp_wmb();
> +	rte_smp_rmb();
> 
>  	__RING_STAT_ADD(r, deq_success, n);
>  	r->cons.tail = cons_next;
> --

Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

> 2.5.5

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] ring: fix sc dequeue performance issue
  2016-07-24 22:57 ` Ananyev, Konstantin
@ 2016-07-25 14:54   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2016-07-25 14:54 UTC (permalink / raw)
  To: Jerin Jacob; +Cc: Ananyev, Konstantin, dev

2016-07-24 22:57, Ananyev, Konstantin:
> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> > Use of rte_smb_wmb() instead of rte_smb_rmb() in sc dequeue function creates the additional overhead of waiting for all the STOREs to be
> > completed to local buffer from ring buffer memory. The sc dequeue function demands only LOAD-STORE barrier where LOADs from ring
> > buffer memory needs to be completed before tail pointer update. Changing to rte_smb_rmb() to enable the required LOAD-STORE barrier.
> > 
> > Fixes: ecc7d10e448e ("ring: guarantee dequeue ordering before tail update")
> > 
> > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> 
> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

Applied, thanks for the quick reaction

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-25 14:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-24 17:07 [dpdk-dev] [PATCH] ring: fix sc dequeue performance issue Jerin Jacob
2016-07-24 22:57 ` Ananyev, Konstantin
2016-07-25 14:54   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).