diff options
| author | Sebastian Andrzej Siewior <[email protected]> | 2024-02-02 16:32:20 +0000 |
|---|---|---|
| committer | Daniel Borkmann <[email protected]> | 2024-02-13 22:10:29 +0000 |
| commit | 2127c604383666675789fd4a5fc2aead46c73aad (patch) | |
| tree | 02052833aea3ecc5810989ab53e4eeaa550c4a5f /scripts/bpf_doc.py | |
| parent | bpf: Fix warning for bpf_cpumask in verifier (diff) | |
| download | kernel-2127c604383666675789fd4a5fc2aead46c73aad.tar.gz kernel-2127c604383666675789fd4a5fc2aead46c73aad.zip | |
xsk: Add truesize to skb_add_rx_frag().
xsk_build_skb() allocates a page and adds it to the skb via
skb_add_rx_frag() and specifies 0 for truesize. This leads to a warning
in skb_add_rx_frag() with CONFIG_DEBUG_NET enabled because size is
larger than truesize.
Increasing truesize requires to add the same amount to socket's
sk_wmem_alloc counter in order not to underflow the counter during
release in the destructor (sock_wfree()).
Pass the size of the allocated page as truesize to skb_add_rx_frag().
Add this mount to socket's sk_wmem_alloc counter.
Fixes: cf24f5a5feea ("xsk: add support for AF_XDP multi-buffer on Tx path")
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Acked-by: Maciej Fijalkowski <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'scripts/bpf_doc.py')
0 files changed, 0 insertions, 0 deletions
