Revert "net: stmmac: set PP_FLAG_DMA_SYNC_DEV only if XDP is enabled"
Subsystems (4)
Jakub Kicinski
maintainerPATCH 1/1 Revert "net: stmmac: set PP_FLAG_DMA_SYNC_DEV only if XDP is enabled"
This reverts commit b514c47ebf41a6536551ed28a05758036e6eca7c.
The commit describes that we don't have to sync the page when recycling, and it tries to optimize that case. But we do need to sync after allocation. Recycling side should be changed to pass the right sync size instead.
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +1 -1
@@ -2035,7 +2035,7 @@ static int __alloc_dma_rx_desc_resources(struct stmmac_priv *priv, rx_q->queue_index = queue; rx_q->priv_data = priv; - pp_params.flags =PP_FLAG_DMA_MAP | (xdp_prog ?PP_FLAG_DMA_SYNC_DEV :0 ); + pp_params.flags =PP_FLAG_DMA_MAP |PP_FLAG_DMA_SYNC_DEV ; pp_params.pool_size = dma_conf->dma_rx_size; num_pages =DIV_ROUND_UP (dma_conf->dma_buf_sz,PAGE_SIZE ); pp_params.order =ilog2 (num_pages);
Signature · 1 line
2.46.2
Quoted 6 lines · Jakub Kicinski
This reverts commit
b514c47ebf41a6536551ed28a05758036e6eca7c.The commit describes that we don't have to sync the page when recycling, and it tries to optimize that case. But we do need to sync after allocation. Recycling side should be changed to pass the right sync size instead.
Makes sense. A proper fix would be to pass something in from the recycling code to disable sink.
Quoted 28 lines
Fixes b514c47ebf41 ("net: stmmac: set PP_FLAG_DMA_SYNC_DEV only if XDP is enabled")Reported-by Jon Hunter <[email protected]>Signed-off-by Jakub Kicinski <[email protected]>---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +1
-1@@ -2035,7 +2035,7 @@ static int __alloc_dma_rx_desc_resources(struct stmmac_priv *priv, rx_q->queue_index = queue; rx_q->priv_data = priv; - pp_params.flags =PP_FLAG_DMA_MAP | (xdp_prog ?PP_FLAG_DMA_SYNC_DEV :0 ); + pp_params.flags =PP_FLAG_DMA_MAP |PP_FLAG_DMA_SYNC_DEV ; pp_params.pool_size = dma_conf->dma_rx_size; num_pages =DIV_ROUND_UP (dma_conf->dma_buf_sz,PAGE_SIZE ); pp_params.order =ilog2 (num_pages);
Quoted 6 lines · Jakub Kicinski
This reverts commit
b514c47ebf41a6536551ed28a05758036e6eca7c.The commit describes that we don't have to sync the page when recycling, and it tries to optimize that case. But we do need to sync after allocation. Recycling side should be changed to pass the right sync size instead.
Thanks for pointing this regression out.
I will send a new patch that passes the right sync size as you suggested after this revert is applied to all affected kernel versions to finish what I have stared :)
Quoted 28 lines
Fixes b514c47ebf41 ("net: stmmac: set PP_FLAG_DMA_SYNC_DEV only if XDP is enabled")Reported-by Jon Hunter <[email protected]>Signed-off-by Jakub Kicinski <[email protected]>---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +1
-1@@ -2035,7 +2035,7 @@ static int __alloc_dma_rx_desc_resources(struct stmmac_priv *priv, rx_q->queue_index = queue; rx_q->priv_data = priv; - pp_params.flags =PP_FLAG_DMA_MAP | (xdp_prog ?PP_FLAG_DMA_SYNC_DEV :0 ); + pp_params.flags =PP_FLAG_DMA_MAP |PP_FLAG_DMA_SYNC_DEV ; pp_params.pool_size = dma_conf->dma_rx_size; num_pages =DIV_ROUND_UP (dma_conf->dma_buf_sz,PAGE_SIZE ); pp_params.order =ilog2 (num_pages);
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Fri, 4 Oct 2024 07:21:15 -0700 you wrote:
This reverts commit
b514c47ebf41a6536551ed28a05758036e6eca7c.The commit describes that we don't have to sync the page when recycling, and it tries to optimize that case. But we do need to sync after allocation. Recycling side should be changed to pass the right sync size instead.
[...]
Here is the summary with links:
- [net] Revert "net: stmmac: set PP_FLAG_DMA_SYNC_DEV only if XDP is enabled"
https://git.kernel.org/netdev/net/c/5546da79e6cc
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html