public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Networking <netdev@vger.kernel.org>,
	Jassi Brar <jaswinder.singh@linaro.org>
Subject: Re: [net-next, PATCH 1/2] net: socionext: Use descriptor info instead of MMIO reads on Rx
Date: Thu, 9 Aug 2018 22:05:00 +0300	[thread overview]
Message-ID: <20180809190500.GA958@apalos> (raw)
In-Reply-To: <CAK8P3a0xq2i03Ktr2_10pqkn=Oeebh1p+Yjp26K9CpEA2SxNaQ@mail.gmail.com>

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@linaro.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@linaro.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

      reply	other threads:[~2018-08-09 21:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-09  8:02 [net-next, PATCH 1/2] net: socionext: Use descriptor info instead of MMIO reads on Rx Ilias Apalodimas
2018-08-09  8:02 ` [net-next, PATCH 2/2] net: socionext: Increase descriptors to 256 Ilias Apalodimas
2018-08-09 15:37 ` [net-next, PATCH 1/2] net: socionext: Use descriptor info instead of MMIO reads on Rx Arnd Bergmann
2018-08-09 19:05   ` Ilias Apalodimas [this message]

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=20180809190500.GA958@apalos \
    --to=ilias.apalodimas@linaro.org \
    --cc=arnd@arndb.de \
    --cc=jaswinder.singh@linaro.org \
    --cc=netdev@vger.kernel.org \
    /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