diff options
| author | Alexander Lobakin <[email protected]> | 2025-06-12 16:02:32 +0000 |
|---|---|---|
| committer | Tony Nguyen <[email protected]> | 2025-06-16 18:40:15 +0000 |
| commit | 5495c58c65aa3d650cccaa19dc59115b9a0069a5 (patch) | |
| tree | 3daff5094f628a535455e7e3884141cf937b2e58 /drivers/net/ethernet/intel/libeth/xdp.c | |
| parent | libeth: xsk: add XSk xmit functions (diff) | |
| download | kernel-5495c58c65aa3d650cccaa19dc59115b9a0069a5.tar.gz kernel-5495c58c65aa3d650cccaa19dc59115b9a0069a5.zip | |
libeth: xsk: add XSk Rx processing support
Add XSk counterparts for preparing XSk &libeth_xdp_buff (adding head and
frags), running the program, and handling the verdict, inc. XDP_PASS.
Shortcuts in comparison with regular Rx: frags and all verdicts except
XDP_REDIRECT are under unlikely() and out of line; no checks for XDP
program presence as it's always true for XSk.
Suggested-by: Maciej Fijalkowski <[email protected]> # optimizations
Signed-off-by: Alexander Lobakin <[email protected]>
Signed-off-by: Tony Nguyen <[email protected]>
Diffstat (limited to 'drivers/net/ethernet/intel/libeth/xdp.c')
| -rw-r--r-- | drivers/net/ethernet/intel/libeth/xdp.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/ethernet/intel/libeth/xdp.c b/drivers/net/ethernet/intel/libeth/xdp.c index b5fb2ce92da8..d4ac027d9584 100644 --- a/drivers/net/ethernet/intel/libeth/xdp.c +++ b/drivers/net/ethernet/intel/libeth/xdp.c @@ -286,7 +286,8 @@ EXPORT_SYMBOL_GPL(libeth_xdp_buff_add_frag); * @act: original XDP prog verdict * @ret: error code if redirect failed * - * External helper used by __libeth_xdp_run_prog(), do not call directly. + * External helper used by __libeth_xdp_run_prog() and + * __libeth_xsk_run_prog_slow(), do not call directly. * Reports invalid @act, XDP exception trace event and frees the buffer. * * Return: libeth_xdp XDP prog verdict. @@ -300,6 +301,9 @@ u32 __cold libeth_xdp_prog_exception(const struct libeth_xdp_tx_bulk *bq, libeth_trace_xdp_exception(bq->dev, bq->prog, act); + if (xdp->base.rxq->mem.type == MEM_TYPE_XSK_BUFF_POOL) + return libeth_xsk_prog_exception(xdp, act, ret); + libeth_xdp_return_buff_slow(xdp); return LIBETH_XDP_DROP; |
