* [PATCH net] net: hibmcge: fix page_pool DMA direction mismatch
@ 2026-08-20 12:43 Jijie Shao
2026-08-22 21:00 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Jijie Shao @ 2026-08-20 12:43 UTC (permalink / raw)
To: davem, edumazet, kuba, pabeni, andrew+netdev, horms
Cc: shenjian15, liuyonglong, chenhao418, yangshuaisong, ningwei15,
netdev, linux-kernel, shaojijie
From: Jian Shen <shenjian15@huawei.com>
The driver memsets the RX buffer page head to zero before
submitting it to hardware, then calls dma_sync_single_for_device()
with DMA_TO_DEVICE. This sync direction does not match the pool
dma_dir which is DMA_FROM_DEVICE, violating the DMA API contract
that the sync direction must match the mapping direction.
On swiotlb platforms the mismatch can cause incorrect bounce-buffer
behaviour, and CONFIG_DMA_API_DEBUG emits a warning.
Switch the page_pool dma_dir to DMA_BIDIRECTIONAL so that the
CPU-to-device memset sync becomes legal.
Fixes: c30595917585 ("net: hibmcge: add support for pagepool on rx")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
---
drivers/net/ethernet/hisilicon/hibmcge/hbg_txrx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/hisilicon/hibmcge/hbg_txrx.c b/drivers/net/ethernet/hisilicon/hibmcge/hbg_txrx.c
index 0ae314994676..3e6ae2aa0d4b 100644
--- a/drivers/net/ethernet/hisilicon/hibmcge/hbg_txrx.c
+++ b/drivers/net/ethernet/hisilicon/hibmcge/hbg_txrx.c
@@ -553,7 +553,7 @@ static int hbg_ring_page_pool_init(struct hbg_priv *priv, struct hbg_ring *ring)
.nid = dev_to_node(&priv->pdev->dev),
.dev = &priv->pdev->dev,
.napi = &ring->napi,
- .dma_dir = DMA_FROM_DEVICE,
+ .dma_dir = DMA_BIDIRECTIONAL,
.offset = 0,
.max_len = hbg_get_page_size(ring),
};
base-commit: e2466392a0b8496000e12181cb1ee1535eb0da25
--
2.33.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] net: hibmcge: fix page_pool DMA direction mismatch
2026-08-20 12:43 [PATCH net] net: hibmcge: fix page_pool DMA direction mismatch Jijie Shao
@ 2026-08-22 21:00 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-08-22 21:00 UTC (permalink / raw)
To: Jijie Shao
Cc: davem, edumazet, kuba, pabeni, andrew+netdev, horms, shenjian15,
liuyonglong, chenhao418, yangshuaisong, ningwei15, netdev,
linux-kernel
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 20 Aug 2026 20:43:46 +0800 you wrote:
> From: Jian Shen <shenjian15@huawei.com>
>
> The driver memsets the RX buffer page head to zero before
> submitting it to hardware, then calls dma_sync_single_for_device()
> with DMA_TO_DEVICE. This sync direction does not match the pool
> dma_dir which is DMA_FROM_DEVICE, violating the DMA API contract
> that the sync direction must match the mapping direction.
>
> [...]
Here is the summary with links:
- [net] net: hibmcge: fix page_pool DMA direction mismatch
https://git.kernel.org/netdev/net/c/11efd7963dac
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-22 21:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-20 12:43 [PATCH net] net: hibmcge: fix page_pool DMA direction mismatch Jijie Shao
2026-08-22 21:00 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox