lkml.org 
[lkml]   [2016]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 1/2] net: ethernet: sxgbe: remove private tx queue lock
    Pavel Machek <pavel@ucw.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

    \
     
     \ /
      Last update: 2016-12-20 01:06    [W:6.296 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site