Skip to content

Commit fbadd83

Browse files
mfijalkoAlexei Starovoitov
authored andcommitted
xdp: reflect tail increase for MEM_TYPE_XSK_BUFF_POOL
XSK ZC Rx path calculates the size of data that will be posted to XSK Rx queue via subtracting xdp_buff::data_end from xdp_buff::data. In bpf_xdp_frags_increase_tail(), when underlying memory type of xdp_rxq_info is MEM_TYPE_XSK_BUFF_POOL, add offset to data_end in tail fragment, so that later on user space will be able to take into account the amount of bytes added by XDP program. Fixes: 24ea501 ("xsk: support mbuf on ZC RX") Signed-off-by: Maciej Fijalkowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 3de38c8 commit fbadd83

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/core/filter.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4093,6 +4093,8 @@ static int bpf_xdp_frags_increase_tail(struct xdp_buff *xdp, int offset)
40934093
memset(skb_frag_address(frag) + skb_frag_size(frag), 0, offset);
40944094
skb_frag_size_add(frag, offset);
40954095
sinfo->xdp_frags_size += offset;
4096+
if (rxq->mem.type == MEM_TYPE_XSK_BUFF_POOL)
4097+
xsk_buff_get_tail(xdp)->data_end += offset;
40964098

40974099
return 0;
40984100
}

0 commit comments

Comments
 (0)