]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: airoha: dma map xmit frags with skb_frag_dma_map()
authorLorenzo Bianconi <lorenzo@kernel.org>
Thu, 25 Jun 2026 09:42:46 +0000 (11:42 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 27 Jun 2026 22:44:30 +0000 (15:44 -0700)
commit32f1c2bbb26ae2be476c8b66e3b41789b6b97bfc
tree32655a6009299d4b1975f7837026a6cca63874bf
parentd4be5f6f9094c7c7e96b2fef6d030e23ce9211f3
net: airoha: dma map xmit frags with skb_frag_dma_map()

Map xmit skb fragments using skb_frag_dma_map() instead of
dma_map_single(skb_frag_address()). skb_frag_address() relies on
page_address() to obtain a kernel virtual address, which is not
guaranteed to work for all page types (e.g. highmem pages or
user-pinned pages from MSG_ZEROCOPY).
skb_frag_dma_map() maps the fragment directly via its struct page and
offset through dma_map_page(), avoiding the need for a kernel virtual
address entirely.
Introduce an enum airoha_dma_map_type to track how each queue entry was
mapped (single vs page), so that the matching unmap function is called
on completion and in error paths.

Fixes: 23020f049327 ("net: airoha: Introduce ethernet support for EN7581 SoC")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Reviewed-by: Harshitha Ramamurthy <hramamurthy@google.com>
Link: https://patch.msgid.link/20260625-airoha-eth-skb_frag_dma_map-v1-1-31d9e460aae6@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/airoha/airoha_eth.c
drivers/net/ethernet/airoha/airoha_eth.h