diff options
| author | Alexander Lobakin <[email protected]> | 2023-02-10 17:06:17 +0000 |
|---|---|---|
| committer | Daniel Borkmann <[email protected]> | 2023-02-13 18:13:12 +0000 |
| commit | 055d0920685e53ed8c2ad914888724d69dca17c6 (patch) | |
| tree | 1ac7f341a0cd0de5386bcb358597dc9ecbaf897d /tools/testing/selftests/bpf/prog_tests/recursion.c | |
| parent | ice: Robustify cleaning/completing XDP Tx buffers (diff) | |
| download | kernel-055d0920685e53ed8c2ad914888724d69dca17c6.tar.gz kernel-055d0920685e53ed8c2ad914888724d69dca17c6.zip | |
ice: Fix freeing XDP frames backed by Page Pool
As already mentioned, freeing any &xdp_frame via page_frag_free() is
wrong, as it assumes the frame is backed by either an order-0 page or
a page with no "patrons" behind them, while in fact frames backed by
Page Pool can be redirected to a device, which's driver doesn't use it.
Keep storing a pointer to the raw buffer and then freeing it
unconditionally via page_frag_free() for %XDP_TX frames, but introduce
a separate type in the enum for frames coming through .ndo_xdp_xmit(),
and free them via xdp_return_frame_bulk(). Note that saving xdpf as
xdp_buff->data_hard_start is intentional and is always true when
everything is configured properly.
After this change, %XDP_REDIRECT from a Page Pool based driver to ice
becomes zero-alloc as it should be and horrendous 3.3 Mpps / queue
turn into 6.6, hehe.
Let it go with no "Fixes:" tag as it spans across good 5+ commits and
can't be trivially backported.
Signed-off-by: Alexander Lobakin <[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 'tools/testing/selftests/bpf/prog_tests/recursion.c')
0 files changed, 0 insertions, 0 deletions
