DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Venkatesan, Venky" <venky.venkatesan@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>,
	Olivier MATZ <olivier.matz@6wind.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] memory barriers in rte_ring
Date: Thu, 27 Mar 2014 23:53:29 +0000	[thread overview]
Message-ID: <1FD9B82B8BF2CF418D9A1000154491D974054808@ORSMSX102.amr.corp.intel.com> (raw)
In-Reply-To: <20140327132013.10011e6a@samsung-9>

One caveat - a compiler_barrier should be enough when both sides are using strongly-ordered memory operations (as in the case of the rings). Weakly ordered operations will still need fencing.

-Venky

-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Stephen Hemminger
Sent: Thursday, March 27, 2014 1:20 PM
To: Olivier MATZ
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] memory barriers in rte_ring

On Thu, 27 Mar 2014 20:47:37 +0100
Olivier MATZ <olivier.matz@6wind.com> wrote:

> Hi Stephen,
> 
> On 03/27/2014 08:06 PM, Stephen Hemminger wrote:
> > Long answer: for the multple CPU access ring, it is equivalent to smp_wmb and smp_rmb
> >   in Linux kernel. For x86 where DPDK is used, this can normally be replaced by simpler
> >   compiler barrier. In kernel there is a special flage X86_OOSTORE which is only enabled
> >   for a few special cases, for most cases it is not. When cpu doesnt do out of order
> >   stores, there are no cases where other cpu will see wrong state.
> 
> Thank you for this clarification.
> 
> So, if I understand properly, all usages of rte_*mb() sequencing 
> memory operations between CPUs could be replaced by a compiler 
> barrier. On the other hand, if the memory is also accessed by a 
> device, a memory barrier has to be used.
> 
> Olivier
> 

I think so for the current architecture that DPDK runs on. It might be good to abstract this in some way for eventual users in other environments.

      reply	other threads:[~2014-03-27 23:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-27 16:48 Olivier MATZ
2014-03-27 19:06 ` Stephen Hemminger
2014-03-27 19:47   ` Olivier MATZ
2014-03-27 20:20     ` Stephen Hemminger
2014-03-27 23:53       ` Venkatesan, Venky [this message]

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=1FD9B82B8BF2CF418D9A1000154491D974054808@ORSMSX102.amr.corp.intel.com \
    --to=venky.venkatesan@intel.com \
    --cc=dev@dpdk.org \
    --cc=olivier.matz@6wind.com \
    --cc=stephen@networkplumber.org \
    /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).