[PATCH net-next] net: axienet: Use napi_alloc_skb when refilling RX ring

Radhey Shyam Pandey radheys at xilinx.com
Wed Mar 9 00:17:00 PST 2022


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




More information about the linux-arm-kernel mailing list