net/af_xdp: custom XDP program loading
PATCH v2 1/1 net/af_xdp: custom XDP program loading
The new 'xdp_prog=<string>' vdev arg allows the user to specify the path to a custom XDP program to be set on the device, instead of the default libbpf one. The program must have an XSK_MAP of name 'xsks_map' which will allow for the redirection of some packets to userspace and thus the PMD, using some criteria defined in the program. This can be useful for filtering purposes, for example if we only want a subset of packets to reach userspace or to drop or process a subset of packets in the kernel.
Note: a netdev may only load one program.
---
v2:
* Modified error checking for strnlen return.
* Fixed copyright header edits
* Updated commit message with more info on use cases
doc/guides/nics/af_xdp.rst | 3 +- drivers/net/af_xdp/rte_eth_af_xdp.c | 100 ++++++++++++++++++++++++++-- 2 files changed, 96 insertions(+), 7 deletions(-)
doc/guides/nics/af_xdp.rst +2 -1
@@ -1,5 +1,5 @@ .. SPDX-License-Identifier: BSD-3-Clause - Copyright(c) 2019 Intel Corporation. + Copyright(c) 2019-2020 Intel Corporation. AF_XDP Poll Mode Driver ==========================
@@ -32,6 +32,7 @@ The following options can be provided to set up an af_xdp port in DPDK. * ``iface`` - name of the Kernel interface to attach to (required); * ``start_queue`` - starting netdev queue id (optional, default 0); * ``queue_count`` - total netdev queue number (optional, default 1); +* ``xdp_prog`` - path to custom xdp program (optional, default none); Prerequisites -------------
drivers/net/af_xdp/rte_eth_af_xdp.c +94 -6
184 lines not on this page · raw message
Signature · 1 line
2.17.1