From: Furong Xu <0x1207@gmail.com> Date: Fri, 3 Jan 2025 09:37:33 +0000 (+0800) Subject: net: stmmac: Set dma_sync_size to zero for discarded frames X-Git-Tag: v6.14-rc1~162^2~133 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=51cfbed198ca4aa140babde816387db0e71f09e7;p=thirdparty%2Flinux.git 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 --- diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 2f518ec845ecf..70c8f60d34f2c 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -5467,7 +5467,7 @@ read_again: if (priv->extend_desc) stmmac_rx_extended_status(priv, &priv->xstats, rx_q->dma_erx + entry); if (unlikely(status == discard_frame)) { - page_pool_recycle_direct(rx_q->page_pool, buf->page); + page_pool_put_page(rx_q->page_pool, buf->page, 0, true); buf->page = NULL; error = 1; if (!priv->hwts_rx_en)