Skip to content

Commit 44ac082

Browse files
Björn TöpelAlexei Starovoitov
authored andcommitted
xsk: Fix xsk_umem_xdp_frame_sz()
Calculating the "data_hard_end" for an XDP buffer coming from AF_XDP zero-copy mode, the return value of xsk_umem_xdp_frame_sz() is added to "data_hard_start". Currently, the chunk size of the UMEM is returned by xsk_umem_xdp_frame_sz(). This is not correct, if the fixed UMEM headroom is non-zero. Fix this by returning the chunk_size without the UMEM headroom. Fixes: 2a637c5 ("xdp: For Intel AF_XDP drivers add XDP frame_sz") Signed-off-by: Björn Töpel <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent dda18a5 commit 44ac082

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/net/xdp_sock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ static inline u64 xsk_umem_adjust_offset(struct xdp_umem *umem, u64 address,
239239

240240
static inline u32 xsk_umem_xdp_frame_sz(struct xdp_umem *umem)
241241
{
242-
return umem->chunk_size_nohr + umem->headroom;
242+
return umem->chunk_size_nohr;
243243
}
244244

245245
#else

0 commit comments

Comments
 (0)