From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ilias Apalodimas 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 Message-ID: <20180809190500.GA958@apalos> References: <1533801739-15312-1-git-send-email-ilias.apalodimas@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Networking , Jassi Brar To: Arnd Bergmann Return-path: Received: from mail-wm0-f68.google.com ([74.125.82.68]:54566 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726927AbeHIVbR (ORCPT ); Thu, 9 Aug 2018 17:31:17 -0400 Received: by mail-wm0-f68.google.com with SMTP id c14-v6so1230691wmb.4 for ; Thu, 09 Aug 2018 12:05:05 -0700 (PDT) Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Thu, Aug 09, 2018 at 05:37:15PM +0200, Arnd Bergmann wrote: > On Thu, Aug 9, 2018 at 10:02 AM Ilias Apalodimas > 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 > > --- > > 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