diff options
author | e.kubanski <e.kubanski@partner.samsung.com> | 2025-04-16 13:29:25 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2025-04-24 17:11:52 -0700 |
commit | bf20af07909925ec0ae6cd4f3b7be0279dfa8768 (patch) | |
tree | 5b9b5c771d39bf0752843699344e3440807e049a /include | |
parent | a1356ac7749cafc4e27aa62c0c4604b5dca4983e (diff) |
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: bea14124bacb ("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>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/xsk_buff_pool.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/xsk_buff_pool.h b/include/net/xsk_buff_pool.h index 3b243ea70e38..cac56e6b0869 100644 --- a/include/net/xsk_buff_pool.h +++ b/include/net/xsk_buff_pool.h @@ -240,8 +240,8 @@ static inline u64 xp_get_handle(struct xdp_buff_xsk *xskb, return orig_addr; offset = xskb->xdp.data - xskb->xdp.data_hard_start; - orig_addr -= offset; offset += pool->headroom; + orig_addr -= offset; return orig_addr + (offset << XSK_UNALIGNED_BUF_OFFSET_SHIFT); } |