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] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 9 Mar 2022 17:37:22 +0000
From:   Robert Hancock <robert.hancock@...ian.com>
To:     "radheys@...inx.com" <radheys@...inx.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC:     "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "kuba@...nel.org" <kuba@...nel.org>,
        "michals@...inx.com" <michals@...inx.com>,
        "jwiedmann.dev@...il.com" <jwiedmann.dev@...il.com>
Subject: Re: [PATCH net-next] net: axienet: Use napi_alloc_skb when refilling
 RX ring

On Wed, 2022-03-09 at 08:17 +0000, Radhey Shyam Pandey wrote:
> > -----Original Message-----
> > From: Robert Hancock <robert.hancock@...ian.com>
> > Sent: Wednesday, March 9, 2022 2:40 AM
> > To: netdev@...r.kernel.org
> > Cc: Radhey Shyam Pandey <radheys@...inx.com>; davem@...emloft.net;
> > kuba@...nel.org; Michal Simek <michals@...inx.com>; linux-arm-
> > kernel@...ts.infradead.org; jwiedmann.dev@...il.com; Robert Hancock
> > <robert.hancock@...ian.com>
> > Subject: [PATCH net-next] net: axienet: Use napi_alloc_skb when refilling
> > RX
> > ring
> > 
> > Use napi_alloc_skb to allocate memory when refilling the RX ring in
> > axienet_poll for more efficiency.
> 
> Minor nit - Good to add some details on "more efficiency" (assume it's perf?)

Yes, it's as described in the comments for napi_alloc_skb:

 *      Allocate a new sk_buff for use in NAPI receive.  This buffer will
 *      attempt to allocate the head from a special reserved region used
 *      only for NAPI Rx allocation.  By doing this we can save several
 *      CPU cycles by avoiding having to disable and re-enable IRQs.

I guess this could be mentioned in the commit description if desired?

> 
> > Signed-off-by: Robert Hancock <robert.hancock@...ian.com>
> > ---
> >  drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> > b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> > index a51a8228e1b7..1da90ec553c5 100644
> > --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> > +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> > @@ -965,7 +965,7 @@ static int axienet_poll(struct napi_struct *napi, int
> > budget)
> >  			packets++;
> >  		}
> > 
> > -		new_skb = netdev_alloc_skb_ip_align(lp->ndev, lp-
> > > max_frm_size);
> > +		new_skb = napi_alloc_skb(napi, lp->max_frm_size);
> >  		if (!new_skb)
> >  			break;
> > 
> > --
> > 2.31.1
-- 
Robert Hancock
Senior Hardware Designer, Calian Advanced Technologies
www.calian.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ