diff options
| author | Alexander Lobakin <[email protected]> | 2025-06-12 16:02:23 +0000 |
|---|---|---|
| committer | Tony Nguyen <[email protected]> | 2025-06-16 18:40:14 +0000 |
| commit | 26ce8eb0bb7d47c5fb36f7c12f34e4a320f14cac (patch) | |
| tree | 557360c744c3bb285c27c96d4410832cd67cb713 /drivers/net/ethernet/intel/libeth/priv.h | |
| parent | libeth: xdp: add .ndo_xdp_xmit() helpers (diff) | |
| download | kernel-26ce8eb0bb7d47c5fb36f7c12f34e4a320f14cac.tar.gz kernel-26ce8eb0bb7d47c5fb36f7c12f34e4a320f14cac.zip | |
libeth: xdp: add XDPSQE completion helpers
Similarly to libeth_tx_complete(), add libeth_xdp_complete_tx() to
handle XDP_TX and xmit buffers. Both use bulk return under the hood.
Also add out of line libeth_tx_complete_any() which handles both
regular and XDP frames (if libeth_xdp is loaded), for example,
to call on queue destroy, where we don't need inlining but
convenience.
Signed-off-by: Alexander Lobakin <[email protected]>
Signed-off-by: Tony Nguyen <[email protected]>
Diffstat (limited to 'drivers/net/ethernet/intel/libeth/priv.h')
| -rw-r--r-- | drivers/net/ethernet/intel/libeth/priv.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/libeth/priv.h b/drivers/net/ethernet/intel/libeth/priv.h new file mode 100644 index 000000000000..1bd6e2d7a3e7 --- /dev/null +++ b/drivers/net/ethernet/intel/libeth/priv.h @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* Copyright (C) 2025 Intel Corporation */ + +#ifndef __LIBETH_PRIV_H +#define __LIBETH_PRIV_H + +#include <linux/types.h> + +/* XDP */ + +struct skb_shared_info; +struct xdp_frame_bulk; + +struct libeth_xdp_ops { + void (*bulk)(const struct skb_shared_info *sinfo, + struct xdp_frame_bulk *bq, bool frags); +}; + +void libeth_attach_xdp(const struct libeth_xdp_ops *ops); + +static inline void libeth_detach_xdp(void) +{ + libeth_attach_xdp(NULL); +} + +#endif /* __LIBETH_PRIV_H */ |
