Skip to content

Commit

Permalink
net: axienet: Use napi_alloc_skb when refilling RX ring
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Robert Hancock authored and Jakub Kicinski committed Mar 10, 2022
1 parent 6546690 commit 6c7e7da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/xilinx/xilinx_axienet_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 6c7e7da

Please sign in to comment.