diff options
author | Alexander Lobakin <[email protected]> | 2023-02-10 18:06:17 +0100 |
---|---|---|
committer | Daniel Borkmann <[email protected]> | 2023-02-13 19:13:12 +0100 |
commit | 055d0920685e53ed8c2ad914888724d69dca17c6 (patch) | |
tree | 1ac7f341a0cd0de5386bcb358597dc9ecbaf897d /tools/testing/selftests/bpf/prog_tests/kfunc_dynptr_param.c | |
parent | aa1d3faf71a6a46f9b859daa8ffa5b86fa07217c (diff) |
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/kfunc_dynptr_param.c')
0 files changed, 0 insertions, 0 deletions