lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180809190500.GA958@apalos>
Date:   Thu, 9 Aug 2018 22:05:00 +0300
From:   Ilias Apalodimas <ilias.apalodimas@...aro.org>
To:     Arnd Bergmann <arnd@...db.de>
Cc:     Networking <netdev@...r.kernel.org>,
        Jassi Brar <jaswinder.singh@...aro.org>
Subject: Re: [net-next, PATCH 1/2] net: socionext: Use descriptor info
 instead of MMIO reads on Rx

On Thu, Aug 09, 2018 at 05:37:15PM +0200, Arnd Bergmann wrote:
> On Thu, Aug 9, 2018 at 10:02 AM Ilias Apalodimas
> <ilias.apalodimas@...aro.org> wrote:
> >
> > MMIO reads for remaining packets in queue occur (at least)twice per
> > invocation of netsec_process_rx(). We can use the packet descriptor to
> > identify if it's owned by the hardware and break out, avoiding the more
> > expensive MMIO read operations. This has a ~2% increase on the pps of the
> > Rx path when tested with 64byte packets
> >
> > Signed-off-by: Ilias Apalodimas <ilias.apalodimas@...aro.org>
> > ---
> >  drivers/net/ethernet/socionext/netsec.c | 19 +++++--------------
> >  1 file changed, 5 insertions(+), 14 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c
> > index 01589b6..ae32909 100644
> > --- a/drivers/net/ethernet/socionext/netsec.c
> > +++ b/drivers/net/ethernet/socionext/netsec.c
> > @@ -657,8 +657,6 @@ static struct sk_buff *netsec_get_rx_pkt_data(struct netsec_priv *priv,
> 
> > +               if (de->attr & (1U << NETSEC_RX_PKT_OWN_FIELD))
> > +                       break;
> >                 done++;
> 
> Should this use READ_ONCE() to prevent the compiler from moving the
> access around? I see that netsec_get_rx_pkt_data() has a dma_rmb()
> before reading the data, which prevents the CPU from doing something
> wrong here, but not the compiler.
> 
>         Arnd
As we discussed i'll send a V2 with the dma_rmb() right after the desc status
read

Thnaks
Ilias

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ