linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: axienet: Use napi_alloc_skb when refilling RX ring
@ 2022-03-08 21:10 Robert Hancock
  2022-03-09  8:17 ` Radhey Shyam Pandey
  2022-03-10  5:00 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: Robert Hancock @ 2022-03-08 21:10 UTC (permalink / raw)
  To: netdev
  Cc: radhey.shyam.pandey, davem, kuba, michal.simek, linux-arm-kernel,
	jwiedmann.dev, Robert Hancock

Use napi_alloc_skb to allocate memory when refilling the RX ring in
axienet_poll for more efficiency.

Signed-off-by: Robert Hancock <robert.hancock@calian.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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [PATCH net-next] net: axienet: Use napi_alloc_skb when refilling RX ring
  2022-03-08 21:10 [PATCH net-next] net: axienet: Use napi_alloc_skb when refilling RX ring Robert Hancock
@ 2022-03-09  8:17 ` Radhey Shyam Pandey
  2022-03-09 17:37   ` Robert Hancock
  2022-03-10  5:00 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 4+ messages in thread
From: Radhey Shyam Pandey @ 2022-03-09  8:17 UTC (permalink / raw)
  To: Robert Hancock, netdev
  Cc: davem, kuba, Michal Simek, linux-arm-kernel, jwiedmann.dev

> -----Original Message-----
> From: Robert Hancock <robert.hancock@calian.com>
> Sent: Wednesday, March 9, 2022 2:40 AM
> To: netdev@vger.kernel.org
> Cc: Radhey Shyam Pandey <radheys@xilinx.com>; davem@davemloft.net;
> kuba@kernel.org; Michal Simek <michals@xilinx.com>; linux-arm-
> kernel@lists.infradead.org; jwiedmann.dev@gmail.com; Robert Hancock
> <robert.hancock@calian.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?)

> 
> Signed-off-by: Robert Hancock <robert.hancock@calian.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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: axienet: Use napi_alloc_skb when refilling RX ring
  2022-03-09  8:17 ` Radhey Shyam Pandey
@ 2022-03-09 17:37   ` Robert Hancock
  0 siblings, 0 replies; 4+ messages in thread
From: Robert Hancock @ 2022-03-09 17:37 UTC (permalink / raw)
  To: radheys, netdev; +Cc: linux-arm-kernel, davem, kuba, michals, jwiedmann.dev

On Wed, 2022-03-09 at 08:17 +0000, Radhey Shyam Pandey wrote:
> > -----Original Message-----
> > From: Robert Hancock <robert.hancock@calian.com>
> > Sent: Wednesday, March 9, 2022 2:40 AM
> > To: netdev@vger.kernel.org
> > Cc: Radhey Shyam Pandey <radheys@xilinx.com>; davem@davemloft.net;
> > kuba@kernel.org; Michal Simek <michals@xilinx.com>; linux-arm-
> > kernel@lists.infradead.org; jwiedmann.dev@gmail.com; Robert Hancock
> > <robert.hancock@calian.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@calian.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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: axienet: Use napi_alloc_skb when refilling RX ring
  2022-03-08 21:10 [PATCH net-next] net: axienet: Use napi_alloc_skb when refilling RX ring Robert Hancock
  2022-03-09  8:17 ` Radhey Shyam Pandey
@ 2022-03-10  5:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-03-10  5:00 UTC (permalink / raw)
  To: Robert Hancock
  Cc: netdev, radhey.shyam.pandey, davem, kuba, michal.simek,
	linux-arm-kernel, jwiedmann.dev

Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Tue,  8 Mar 2022 15:10:13 -0600 you wrote:
> Use napi_alloc_skb to allocate memory when refilling the RX ring in
> axienet_poll for more efficiency.
> 
> Signed-off-by: Robert Hancock <robert.hancock@calian.com>
> ---
>  drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - [net-next] net: axienet: Use napi_alloc_skb when refilling RX ring
    https://git.kernel.org/netdev/net-next/c/6c7e7da2e0f2

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-10  5:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-08 21:10 [PATCH net-next] net: axienet: Use napi_alloc_skb when refilling RX ring Robert Hancock
2022-03-09  8:17 ` Radhey Shyam Pandey
2022-03-09 17:37   ` Robert Hancock
2022-03-10  5:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).