[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <552449C7.9080804@redhat.com>
Date: Tue, 07 Apr 2015 14:19:03 -0700
From: Alexander Duyck <alexander.h.duyck@...hat.com>
To: Francois Romieu <romieu@...zoreil.com>,
David Miller <davem@...emloft.net>
CC: netdev@...r.kernel.org, nix@...eri.org.uk, rl@...lgate.ch,
gurligebis@...too.org
Subject: Re: [PATCH net-next 1/4] via-rhine: commit receive buffer address
before descriptor status update.
On 04/07/2015 02:02 PM, Francois Romieu wrote:
> David Miller <davem@...emloft.net> :
>> From: Francois Romieu <romieu@...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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists