[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20161220000531.GA7851@electric-eye.fr.zoreil.com>
Date: Tue, 20 Dec 2016 01:05:32 +0100
From: Francois Romieu <romieu@...zoreil.com>
To: Pavel Machek <pavel@....cz>
Cc: Lino Sanfilippo <LinoSanfilippo@....de>, bh74.an@...sung.com,
ks.giri@...sung.com, vipul.pandya@...sung.com,
peppe.cavallaro@...com, alexandre.torgue@...com,
davem@...emloft.net, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [PATCH 1/2] net: ethernet: sxgbe: remove private tx queue lock
Pavel Machek <pavel@....cz> :
[...]
> Considering the memory barriers... is something like this neccessary
> in the via-rhine ?
Yes.
> AFAICT... we need a barrier after making sure that descriptor is no
> longer owned by DMA (to make sure we don't get stale data in rest of
> descriptor)... and we need a barrier before giving the descriptor to
> the dma, to make sure DMA engine sees the complete update....?
I would not expect stale data while processing a single transmit
descriptor as the transmit completion does not use the rest of the
descriptor at all in the via-rhine driver. However I agree that transmit
descriptors should be read by the cpu with adequate ordering so the
dma_rmb() should stay.
Same kind of narrative for dma_wmb rhine_rx (s/read/written/ and
s/cpu/device/).
> diff --git a/drivers/net/ethernet/via/via-rhine.c b/drivers/net/ethernet/via/via-rhine.c
> index ba5c542..3806e72 100644
> --- a/drivers/net/ethernet/via/via-rhine.c
> +++ b/drivers/net/ethernet/via/via-rhine.c
[...]
> @@ -2061,6 +2062,7 @@ static int rhine_rx(struct net_device *dev, int limit)
>
> if (desc_status & DescOwn)
> break;
> + dma_rmb();
>
I agree with your explanation for this one (late vlan processing in a
different word from the same descriptor).
--
Ueimor
Powered by blists - more mailing lists