BPF XDP link
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest9 patches 10 repliesIn review
- v39 patches 5 repliesSuperseded
- v28 patches 1 replySuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 7 patches | 0 replies | Superseded |
Changes in v4 from the cover letter
- fix a compilation warning in one of drivers (Jakub);
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/9 | bpf: make bpf_link API available indepently of CONFIG_BPF_SYSCALLinclude/ | +55 | 0 replies | |
| 2/9 | bpf, xdp: maintain info on attached XDP BPF programs in net_deviceinclude/ net/ net/ | +105 | 3 replies | |
| 3/9 | bpf, xdp: extract common XDP program attachment logicnet/ | +91 | 6 replies | |
| 4/9 | bpf, xdp: add bpf_link-based XDP attachment APIinclude/ include/ kernel/ +1 more | +178 | 0 replies | |
| 5/9 | bpf, xdp: implement LINK_UPDATE for BPF XDP linknet/ | +43 | 0 replies | |
| 6/9 | bpf: implement BPF XDP link-specific introspection APIsinclude/ net/ | +34 | 0 replies | |
| 7/9 | libbpf: add support for BPF XDP linktools/ tools/ tools/ +2 more | +21 | 0 replies | |
| 8/9 | selftests/bpf: add BPF XDP link selfteststools/ tools/ | +149 | 0 replies | |
| 9/9 | bpf, xdp: remove XDP_QUERY_PROG and XDP_QUERY_PROG_HW XDP commandsdrivers/ drivers/ drivers/ +25 more | +2 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.
Cover letter [PATCH v4 bpf-next 0/9] BPF XDP link
Following cgroup and netns examples, implement bpf_link support for XDP.
The semantics is described in patch #2. Program and link attachments are mutually exclusive, in the sense that neither link can replace attached program nor program can replace attached link. Link can't replace attached link as well, as is the case for any other bpf_link implementation.
Patch #1 refactors existing BPF program-based attachment API and centralizes high-level query/attach decisions in generic kernel code, while drivers are kept simple and are instructed with low-level decisions about attaching and detaching specific bpf_prog. This also makes QUERY command unnecessary, and patch #8 removes support for it from all kernel drivers. If that's a bad idea, we can drop that patch altogether.
With refactoring in patch #1, adding bpf_xdp_link is completely transparent to drivers, they are still functioning at the level of "effective" bpf_prog, that should be called in XDP data path.
Corresponding libbpf support for BPF XDP link is added in patch #5.
v3->v4:
- fix a compilation warning in one of drivers (Jakub);
v2->v3:
- fix build when CONFIG_BPF_SYSCALL=n (kernel test robot);
v1->v2:
- fix prog refcounting bug (David);
- split dev_change_xdp_fd() changes into 2 patches (David);
- add extack messages to all user-induced errors (David).
Andrii Nakryiko (9):
bpf: make bpf_link API available indepently of CONFIG_BPF_SYSCALL bpf, xdp: maintain info on attached XDP BPF programs in net_device bpf, xdp: extract common XDP program attachment logic bpf, xdp: add bpf_link-based XDP attachment API
bpf, xdp: implement LINK_UPDATE for BPF XDP link
bpf: implement BPF XDP link-specific introspection APIs
libbpf: add support for BPF XDP link
selftests/bpf: add BPF XDP link selftests
bpf, xdp: remove XDP_QUERY_PROG and XDP_QUERY_PROG_HW XDP commands
drivers/net/ethernet/amazon/ena/ena_netdev.c | 6 - drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 4 - .../net/ethernet/cavium/thunder/nicvf_main.c | 3 - .../net/ethernet/freescale/dpaa2/dpaa2-eth.c | 5 - drivers/net/ethernet/intel/i40e/i40e_main.c | 3 - drivers/net/ethernet/intel/ice/ice_main.c | 3 - drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 4 - .../net/ethernet/intel/ixgbevf/ixgbevf_main.c | 6 - drivers/net/ethernet/marvell/mvneta.c | 5 - .../net/ethernet/marvell/mvpp2/mvpp2_main.c | 3 - .../net/ethernet/mellanox/mlx4/en_netdev.c | 24 - .../net/ethernet/mellanox/mlx5/core/en_main.c | 18 - .../ethernet/netronome/nfp/nfp_net_common.c | 4 - .../net/ethernet/qlogic/qede/qede_filter.c | 3 - drivers/net/ethernet/sfc/efx.c | 5 - drivers/net/ethernet/socionext/netsec.c | 3 - drivers/net/ethernet/ti/cpsw_priv.c | 3 - drivers/net/hyperv/netvsc_bpf.c | 21 +- drivers/net/netdevsim/bpf.c | 4 - drivers/net/netdevsim/netdevsim.h | 2 +- drivers/net/tun.c | 15 - drivers/net/veth.c | 15 - drivers/net/virtio_net.c | 17 - drivers/net/xen-netfront.c | 21 - include/linux/bpf.h | 81 ++- include/linux/netdevice.h | 29 +- include/net/xdp.h | 2 - include/uapi/linux/bpf.h | 10 +- kernel/bpf/syscall.c | 5 + net/core/dev.c | 530 +++++++++++++----- net/core/rtnetlink.c | 5 +- net/core/xdp.c | 9 - tools/include/uapi/linux/bpf.h | 10 +- tools/lib/bpf/libbpf.c | 9 +- tools/lib/bpf/libbpf.h | 2 + tools/lib/bpf/libbpf.map | 1 + .../selftests/bpf/prog_tests/section_names.c | 2 +- .../selftests/bpf/prog_tests/xdp_link.c | 137 +++++ .../selftests/bpf/progs/test_xdp_link.c | 12 + 39 files changed, 658 insertions(+), 383 deletions(-) create mode 100644 tools/testing/selftests/bpf/prog_tests/xdp_link.c create mode 100644 tools/testing/selftests/bpf/progs/test_xdp_link.c
Signature · 1 line
2.24.1