]> git.ipfire.org Git - thirdparty/linux.git/commit
libeth: xdp: add XDP_TX buffers sending
authorAlexander Lobakin <aleksander.lobakin@intel.com>
Thu, 12 Jun 2025 16:02:21 +0000 (18:02 +0200)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Mon, 16 Jun 2025 18:40:14 +0000 (11:40 -0700)
commit8591c3afe8882a00d9070daf78c384b003b596f3
tree64ad692b45b2a8f0393bb5eb84ec529e365563a1
parent35c64b6500ef7308155bf0dc556c646e4d7b0fd3
libeth: xdp: add XDP_TX buffers sending

Start adding XDP-specific code to libeth, namely handling XDP_TX buffers
(only sending).
The idea is that we accumulate up to 16 buffers on the stack, then,
if either the limit is reached or the polling is finished, flush them
at once with only one XDPSQ cleaning (if needed). The main sending
function will be aware of the sending budget and already have all the
info to send the buffers, so it can't fail.
Drivers need to provide 2 inline callbacks to the main sending function:
for cleaning an XDPSQ and for filling descriptors; the library code
takes care of the rest.
Note that unlike the generic code, multi-buffer support is not wrapped
here with unlikely() to not hurt header split setups.

&libeth_xdp_buff is a simple extension over &xdp_buff which has a direct
pointer to the corresponding Rx descriptor (and, luckily, precisely 1 CL
size and 16-byte alignment on x86_64).

Suggested-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> # xmit logic
Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/libeth/Kconfig
drivers/net/ethernet/intel/libeth/Makefile
drivers/net/ethernet/intel/libeth/xdp.c [new file with mode: 0644]
include/net/libeth/tx.h
include/net/libeth/xdp.h [new file with mode: 0644]