Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: mvneta: try to use in-irq pp cache in mvneta_txq_bufs_free

Try to recycle the xdp tx buffer into the in-irq page_pool cache if
mvneta_txq_bufs_free is executed in the NAPI context for XDP_TX use case

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Lorenzo Bianconi and committed by
David S. Miller
632bb64f 35d37709

+7 -4
+7 -4
drivers/net/ethernet/marvell/mvneta.c
··· 1831 1831 /* Free tx queue skbuffs */ 1832 1832 static void mvneta_txq_bufs_free(struct mvneta_port *pp, 1833 1833 struct mvneta_tx_queue *txq, int num, 1834 - struct netdev_queue *nq) 1834 + struct netdev_queue *nq, bool napi) 1835 1835 { 1836 1836 unsigned int bytes_compl = 0, pkts_compl = 0; 1837 1837 int i; ··· 1854 1854 dev_kfree_skb_any(buf->skb); 1855 1855 } else if (buf->type == MVNETA_TYPE_XDP_TX || 1856 1856 buf->type == MVNETA_TYPE_XDP_NDO) { 1857 - xdp_return_frame(buf->xdpf); 1857 + if (napi && buf->type == MVNETA_TYPE_XDP_TX) 1858 + xdp_return_frame_rx_napi(buf->xdpf); 1859 + else 1860 + xdp_return_frame(buf->xdpf); 1858 1861 } 1859 1862 } 1860 1863 ··· 1875 1872 if (!tx_done) 1876 1873 return; 1877 1874 1878 - mvneta_txq_bufs_free(pp, txq, tx_done, nq); 1875 + mvneta_txq_bufs_free(pp, txq, tx_done, nq, true); 1879 1876 1880 1877 txq->count -= tx_done; 1881 1878 ··· 2862 2859 struct netdev_queue *nq = netdev_get_tx_queue(pp->dev, txq->id); 2863 2860 int tx_done = txq->count; 2864 2861 2865 - mvneta_txq_bufs_free(pp, txq, tx_done, nq); 2862 + mvneta_txq_bufs_free(pp, txq, tx_done, nq, false); 2866 2863 2867 2864 /* reset txq */ 2868 2865 txq->count = 0;