diff options
| author | Alexander Lobakin <[email protected]> | 2024-12-18 17:44:30 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2024-12-20 03:51:13 +0000 |
| commit | 68ddc8ae17685a8c4ac78260bde8fe4a79511aef (patch) | |
| tree | 44869307108bf72eb0361d206ca7f8e1e42e0d06 /tools/testing/selftests/net/lib/py/utils.py | |
| parent | page_pool: add page_pool_dev_alloc_netmem() (diff) | |
| download | kernel-68ddc8ae17685a8c4ac78260bde8fe4a79511aef.tar.gz kernel-68ddc8ae17685a8c4ac78260bde8fe4a79511aef.zip | |
xdp: add generic xdp_buff_add_frag()
The code piece which would attach a frag to &xdp_buff is almost
identical across the drivers supporting XDP multi-buffer on Rx.
Make it a generic elegant "oneliner".
Also, I see lots of drivers calculating frags_truesize as
`xdp->frame_sz * nr_frags`. I can't say this is fully correct, since
frags might be backed by chunks of different sizes, especially with
stuff like the header split. Even page_pool_alloc() can give you two
different truesizes on two subsequent requests to allocate the same
buffer size. Add a field to &skb_shared_info (unionized as there's no
free slot currently on x86_64) to track the "true" truesize. It can
be used later when updating the skb.
Reviewed-by: Maciej Fijalkowski <[email protected]>
Signed-off-by: Alexander Lobakin <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'tools/testing/selftests/net/lib/py/utils.py')
0 files changed, 0 insertions, 0 deletions
