netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Duyck <alexander.h.duyck@redhat.com>
To: Francois Romieu <romieu@fr.zoreil.com>,
	David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, nix@esperi.org.uk, rl@hellgate.ch,
	gurligebis@gentoo.org
Subject: Re: [PATCH net-next 1/4] via-rhine: commit receive buffer address before descriptor status update.
Date: Tue, 07 Apr 2015 14:19:03 -0700	[thread overview]
Message-ID: <552449C7.9080804@redhat.com> (raw)
In-Reply-To: <20150407210248.GC24631@electric-eye.fr.zoreil.com>


On 04/07/2015 02:02 PM, Francois Romieu wrote:
> David Miller <davem@davemloft.net> :
>> From: Francois Romieu <romieu@fr.zoreil.com>
> [...]
>>> @@ -2063,6 +2063,7 @@ static int rhine_rx(struct net_device *dev, int limit)
>>>   				break;
>>>   			}
>>>   			rp->rx_ring[entry].addr = cpu_to_le32(rp->rx_skbuff_dma[entry]);
>>> +			wmb();
>> dma_wmb() perhaps?  I think this is exactly the situation that interface was
>> added for.
> I need the buffer address to be written in the receive descriptor before
> the descriptor status is. The cpu does W1, W2 and the nic mustn't see W2, W1.

That is the point of the dma_wmb().  If you are writing both W1 and W2 
to system memory then dma_wmb should be enough, if W1 is system memory 
and W2 is device memory (MMIO) then you need wmb().

You can think of dma_wmb as being something similar to smp_wmb w/o the 
SMP processor requirement.  On architectures that are strong ordered 
such as most x86 the wmb() translates to a barrier.  On other 
architectures it is something usually a little lighter than a full wmb() 
so for example on PowerPC wmb is sync() while dma_wmb() is lwsync().

- Alex

  reply	other threads:[~2015-04-07 21:19 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-06 18:01 [PATCH RFT net-next 0/4] via-rhine receive buffers rework Francois Romieu
2015-04-06 18:01 ` [PATCH net-next 1/4] via-rhine: commit receive buffer address before descriptor status update Francois Romieu
2015-04-07 19:52   ` David Miller
2015-04-07 21:02     ` Francois Romieu
2015-04-07 21:19       ` Alexander Duyck [this message]
2015-04-07 21:27       ` David Miller
2015-04-07 21:54         ` Eric Dumazet
2015-04-07 22:12           ` Alexander Duyck
2015-04-07 22:22             ` Eric Dumazet
2015-04-07 23:20               ` Alexander Duyck
2015-04-08 11:40                 ` David Laight
2015-04-07 19:54   ` Alexander Duyck
2015-04-06 18:01 ` [PATCH net-next 2/4] via-rhine: add allocation helpers Francois Romieu
2015-04-06 18:01 ` [PATCH net-next 3/4] via-rhine: gotoize rhine_open error path Francois Romieu
2015-04-06 18:01 ` [PATCH net-next 4/4] via-rhine: forbid holes in the receive descriptor ring Francois Romieu
2015-04-06 21:46 ` [PATCH RFT net-next 0/4] via-rhine receive buffers rework Nix
2015-04-07 10:46   ` Nix
2015-04-07 19:31     ` Francois Romieu
2015-04-07 19:41       ` Nix

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=552449C7.9080804@redhat.com \
    --to=alexander.h.duyck@redhat.com \
    --cc=davem@davemloft.net \
    --cc=gurligebis@gentoo.org \
    --cc=netdev@vger.kernel.org \
    --cc=nix@esperi.org.uk \
    --cc=rl@hellgate.ch \
    --cc=romieu@fr.zoreil.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).