Skip to content

Commit

Permalink
net: fec: use napi_consume_skb() in fec_enet_tx_queue()
Browse files Browse the repository at this point in the history
Now that the "budget" is passed into fec_enet_tx_queue(), one
optimization we can do is to use napi_consume_skb() to instead
of dev_kfree_skb_any().

Signed-off-by: Wei Fang <wei.fang@nxp.com>
Suggested-by: Alexander H Duyck <alexander.duyck@gmail.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Link: https://lore.kernel.org/r/20230816090242.463822-1-wei.fang@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Wei Fang authored and Jakub Kicinski committed Aug 18, 2023
1 parent 5cce781 commit 91a10ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/freescale/fec_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1494,7 +1494,7 @@ fec_enet_tx_queue(struct net_device *ndev, u16 queue_id, int budget)
}

/* Free the sk buffer associated with this last transmit */
dev_kfree_skb_any(skb);
napi_consume_skb(skb, budget);
} else if (txq->tx_buf[index].type == FEC_TXBUF_T_XDP_NDO) {
xdp_return_frame_rx_napi(xdpf);
} else { /* recycle pages of XDP_TX frames */
Expand Down

0 comments on commit 91a10ef

Please sign in to comment.