numam-dpdk/drivers/net/af_xdp
Ciara Loftus 01fa83c94d net/af_xdp: workaround custom program loading
Since v0.4.0, if the underlying kernel supports it, libbpf uses 'bpf
link' to manage the programs on the interfaces of the XDP sockets (xsks).
This is not compatible with the PMD's custom XDP program loading feature
which uses the netlink-based method for loading custom programs.

The conflict arises when libbpf searches for a custom program on the
interface using bpf link, but doesn't find one because the netlink
method was used. libbpf then proceeds to try to load the default program
on the interface, but fails due to the presence of the custom program.

To work around this, the PMD now uses the
XSK_LIBBPF_FLAGS__INHIBIT_PROG_LOAD flag which prevents libbpf from
attempting to search for or load a program. One repercussion is that
DPDK must now insert the xsk into the xsks_map as this was previously
handled by libbpf during the routines for program loading/probing.

Ideally, the PMD would use bpf link to load the custom program, however
at present there is no convenient and reliable way of detecting whether
the underlying kernel supports bpf link. Perhaps this may become
available in a future libbpf release, at which point we can switch the
PMD over to the new bpf link based method.

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
2021-11-15 18:01:09 +01:00
..
af_xdp_deps.h
compat.h net/af_xdp: revert use BPF link for XDP programs 2021-11-15 18:01:09 +01:00
meson.build net/af_xdp: revert use BPF link for XDP programs 2021-11-15 18:01:09 +01:00
rte_eth_af_xdp.c net/af_xdp: workaround custom program loading 2021-11-15 18:01:09 +01:00
version.map version: 21.11-rc0 2021-08-17 08:37:52 +02:00