DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
To: <dev@dpdk.org>
Cc: <thomas.monjalon@6wind.com>, <konstantin.ananyev@intel.com>,
	Jerin Jacob <jerin.jacob@caviumnetworks.com>
Subject: [dpdk-dev]  [PATCH] ring: fix sc dequeue performance issue
Date: Sun, 24 Jul 2016 22:37:40 +0530	[thread overview]
Message-ID: <1469380060-26696-1-git-send-email-jerin.jacob@caviumnetworks.com> (raw)

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

             reply	other threads:[~2016-07-24 17:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-24 17:07 Jerin Jacob [this message]
2016-07-24 22:57 ` Ananyev, Konstantin
2016-07-25 14:54   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1469380060-26696-1-git-send-email-jerin.jacob@caviumnetworks.com \
    --to=jerin.jacob@caviumnetworks.com \
    --cc=dev@dpdk.org \
    --cc=konstantin.ananyev@intel.com \
    --cc=thomas.monjalon@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).