net: axienet: Use napi_alloc_skb when refilling RX ring
authorRobert Hancock <robert.hancock@calian.com>
Tue, 8 Mar 2022 21:10:13 +0000 (15:10 -0600)
committerJakub Kicinski <kuba@kernel.org>
Thu, 10 Mar 2022 04:19:16 +0000 (20:19 -0800)
Use napi_alloc_skb to allocate memory when refilling the RX ring
in axienet_poll for more efficiency. napi_alloc_skb() can reuse
softirq-local cache of freed skbs which may still be cache-warm
and skipping allocator calls.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
Link: https://lore.kernel.org/r/20220308211013.1530955-1-robert.hancock@calian.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/xilinx/xilinx_axienet_main.c

index 1d8c6e910279c1fdf67c4d2fb728e8bf4ffaf9e2..c7eb05e4a6bf40f20cdae60e3444f4ac83dd9771 100644 (file)
@@ -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;