Skip to content

Commit bf20af0

Browse files
e.kubanskikuba-moo
authored andcommitted
xsk: Fix offset calculation in unaligned mode
Bring back previous offset calculation behaviour in AF_XDP unaligned umem mode. In unaligned mode, upper 16 bits should contain data offset, lower 48 bits should contain only specific chunk location without offset. Remove pool->headroom duplication into 48bit address. Signed-off-by: Eryk Kubanski <e.kubanski@partner.samsung.com> Fixes: bea1412 ("xsk: Get rid of xdp_buff_xsk::orig_addr") Acked-by: Magnus Karlsson <magnus.karlsson@intel.com> Link: https://patch.msgid.link/20250416112925.7501-1-e.kubanski@partner.samsung.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent a1356ac commit bf20af0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/net/xsk_buff_pool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ static inline u64 xp_get_handle(struct xdp_buff_xsk *xskb,
240240
return orig_addr;
241241

242242
offset = xskb->xdp.data - xskb->xdp.data_hard_start;
243-
orig_addr -= offset;
244243
offset += pool->headroom;
244+
orig_addr -= offset;
245245
return orig_addr + (offset << XSK_UNALIGNED_BUF_OFFSET_SHIFT);
246246
}
247247

0 commit comments

Comments
 (0)