Skip to contentSkip to conversation

xsk: add missing virtual address conversion for page

PATCH In review Bui Quang Minh 2 participants 2 messages May 21, 2025 – May 22, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xsk: add missing virtual address conversion for page

In commit 7ead4405e06f ("xsk: convert xdp_copy_frags_from_zc() to use page_pool_dev_alloc()"), when converting from netmem to page, I missed a call to page_address() around skb_frag_page(frag) to get the virtual address of the page. This commit uses skb_frag_address() helper to fix the issue.

---
 net/core/xdp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
net/core/xdp.c +1 -2
index e6f22ba61c1e..491334b9b8be 100644
@@ -709,8 +709,7 @@ static noinline bool xdp_copy_frags_from_zc(struct sk_buff *skb,
 			return false;
 		}
 
-		memcpy(page_address(page) + offset,
-		       skb_frag_page(frag) + skb_frag_off(frag),
+		memcpy(page_address(page) + offset, skb_frag_address(frag),
 		       LARGEST_ALIGN(len));
 		__skb_fill_page_desc_noacc(sinfo, i, page, offset, len);
 
Signature · 1 line
2.43.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Bui Quang Minh

In commit 7ead4405e06f ("xsk: convert xdp_copy_frags_from_zc() to use page_pool_dev_alloc()"), when converting from netmem to page, I missed a call to page_address() around skb_frag_page(frag) to get the virtual address of the page. This commit uses skb_frag_address() helper to fix the issue.

I agree that this is a fix for net-next. But as such I think it needs:

Fixes 7ead4405e06f ("xsk: convert xdp_copy_frags_from_zc() to use page_pool_dev_alloc()")

Assuming that is correct then I don't think you need to repost just for this. The tag should be picked up by automation by virtue of being present in this email.