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

Configure Feed

Select the types of activity you want to include in your feed.

net: stmmac: Set dma_sync_size to zero for discarded frames

If a frame is going to be discarded by driver, this frame is never touched
by driver and the cache lines never become dirty obviously,
page_pool_recycle_direct() wastes CPU cycles on unnecessary calling of
page_pool_dma_sync_for_device() to sync entire frame.
page_pool_put_page() with sync_size setting to 0 is the proper method.

Signed-off-by: Furong Xu <0x1207@gmail.com>
Link: https://patch.msgid.link/20250103093733.3872939-1-0x1207@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Furong Xu and committed by
Paolo Abeni
51cfbed1 49afc040

+1 -1
+1 -1
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 5467 5467 if (priv->extend_desc) 5468 5468 stmmac_rx_extended_status(priv, &priv->xstats, rx_q->dma_erx + entry); 5469 5469 if (unlikely(status == discard_frame)) { 5470 - page_pool_recycle_direct(rx_q->page_pool, buf->page); 5470 + page_pool_put_page(rx_q->page_pool, buf->page, 0, true); 5471 5471 buf->page = NULL; 5472 5472 error = 1; 5473 5473 if (!priv->hwts_rx_en)