Re: [PATCH net] net: mana: Sync page pool RX frags for CPU
From: Simon Horman <horms@kernel.org>
Date: 2026-06-19 09:05:21
Also in:
linux-rdma, lkml, netdev, stable
From: Simon Horman <horms@kernel.org>
Date: 2026-06-19 09:05:21
Also in:
linux-rdma, lkml, netdev, stable
On Wed, Jun 17, 2026 at 08:50:29PM -0700, Dexuan Cui wrote:
MANA allocates RX buffers from page pool fragments when frag_count is greater than 1. In that case the buffers remain DMA mapped by page pool and the RX completion path does not call dma_unmap_single(). As a result, the implicit sync-for-CPU normally performed by dma_unmap_single() is missing before the packet data is passed to the networking stack. This breaks RX on configurations which require explicit DMA syncing, for example when booted with swiotlb=force. Fix this by recording the page pool page and DMA sync offset when the RX buffer is allocated, and syncing the received packet range for CPU access before handing the RX buffer to the stack. Also validate the packet length reported in the RX CQE before using it as a DMA sync length or passing it to skb processing. The CQE is supplied by the device and should not be blindly trusted by Confidential VMs.
I think this last part warrants being split out into a separate patch.
Fixes: 730ff06d3f5c ("net: mana: Use page pool fragments for RX buffers instead of full pages to improve memory efficiency.")
Cc: stable@vger.kernel.org
Signed-off-by: Dexuan Cui <decui@microsoft.com>...