diff options
| author | Maciej Fijalkowski <[email protected]> | 2024-01-24 19:16:00 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2024-01-25 00:24:07 +0000 |
| commit | fbadd83a612c3b7aad2987893faca6bd24aaebb3 (patch) | |
| tree | d8b7dc0009593267cd7895da2301e00306da5731 | |
| parent | ice: update xdp_rxq_info::frag_size for ZC enabled Rx queue (diff) | |
| download | kernel-fbadd83a612c3b7aad2987893faca6bd24aaebb3.tar.gz kernel-fbadd83a612c3b7aad2987893faca6bd24aaebb3.zip | |
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: 24ea50127ecf ("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]>
| -rw-r--r-- | net/core/filter.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/core/filter.c b/net/core/filter.c index 36fb5ae8af69..ef3e78b6a39c 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -4093,6 +4093,8 @@ static int bpf_xdp_frags_increase_tail(struct xdp_buff *xdp, int offset) memset(skb_frag_address(frag) + skb_frag_size(frag), 0, offset); skb_frag_size_add(frag, offset); sinfo->xdp_frags_size += offset; + if (rxq->mem.type == MEM_TYPE_XSK_BUFF_POOL) + xsk_buff_get_tail(xdp)->data_end += offset; return 0; } |
