Re: [PATCH net-next v2 3/3] net: devmem: decode DMA addresses for TX

From: Paolo Abeni

Date: Tue Sep 29 2026 - 09:42:35 EST


On 9/29/26 11:43, Paolo Abeni wrote:
On 9/25/26 22:15, Stanislav Fomichev wrote:
On 32-bit architectures where dma_addr_t is wider than unsigned long,
page_pool_set_dma_addr_netmem() stores page-aligned DMA addresses shifted
by PAGE_SHIFT. The net_iov branch of __skb_frag_dma_map() adds byte offsets
to the encoded value, so the NIC is programmed with an invalid DMA address.
This can trigger an IOMMU fault or DMA from unintended memory.

Consolidate DMA address encoding, decoding, and representability checks in
netmem helpers. Use the common decoder from the page pool and net_iov TX
paths so both interpret stored addresses consistently.

Fixes: bd61848900bf ("net: devmem: Implement TX path")
Reviewed-by: Mina Almasry <almasrymina@xxxxxxxxxx>
Signed-off-by: Stanislav Fomichev <sdf@xxxxxxxxxxx>
Fixes tag for net-next patches pointing to old code are highly discouraged.
My understanding is that netem on 32 bits is mostly a theoretical thing,
i.e. no actual usage.
Would you be ok to strip the tag? No need to repost, just reply here.
Actually the above is more FYI than a real request. I'll apply the
series stripping the tag.

/P