Skip to content

introduction of bpf_xdp_adjust_tail

Nikita V. Shirokov netdev 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest11 patches 4 repliesIn review
  2. v211 patches 6 repliesSuperseded
  3. v110 patches 10 repliesSuperseded

Changes in v3 from the cover letter

* adding missed "signed off by" in v2

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11bpf: adding bpf_xdp_adjust_tail helperinclude/uapi/linux/bpf.h net/core/filter.c+37 -21 reply
2/11bpf: make generic xdp compatible w/ bpf_xdp_adjust_tailnet/core/dev.c+9 -10 replies
3/11bpf: make mlx4 compatible w/ bpf_xdp_adjust_taildrivers/net/ethernet/mellanox/mlx4/en_rx.c+1 -10 replies
4/11bpf: make bnxt compatible w/ bpf_xdp_adjust_taildrivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c+1 -11 reply
5/11bpf: make cavium thunder compatible w/ bpf_xdp_adjust_taildrivers/net/ethernet/cavium/thunder/nicvf_main.c+1 -10 replies
6/11bpf: make netronome nfp compatible w/ bpf_xdp_adjust_taildrivers/net/ethernet/netronome/nfp/nfp_net_common.c+1 -10 replies
7/11bpf: make tun compatible w/ bpf_xdp_adjust_taildrivers/net/tun.c+2 -11 reply
8/11bpf: make virtio compatible w/ bpf_xdp_adjust_taildrivers/net/virtio_net.c+6 -10 replies
9/11bpf: making bpf_prog_test run aware of possible data_end ptr changenet/bpf/test_run.c+2 -10 replies
10/11bpf: adding tests for bpf_xdp_adjust_tailtools/include/uapi/linux/bpf.h tools/testing/selftests/bpf/Makefile tools/testing/selftests/bpf/bpf_helpers.h +2 more+75 -20 replies
11/11bpf: add bpf_xdp_adjust_tail sample progsamples/bpf/Makefile samples/bpf/xdp_adjust_tail_kern.c samples/bpf/xdp_adjust_tail_user.c +1 more+300 -00 replies

Reviews trailers per patch

8 of 11 patches have a Reviewed-by or Acked-by.

PatchAlexei StarovoitovTariq ToukanJakub KicinskiJason WangMichael S. TsirkinMichael Chan
1/11A-b
2/11A-b
3/11A-b A-b
4/11A-b A-b
5/11A-b
6/11A-b A-b
7/11R-b A-b
8/11R-b
9/11
10/11
11/11

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 6 reviewers.

Read the v3 thread

Cover letter [PATCH bpf-next v3 00/11] introduction of bpf_xdp_adjust_tail

In this patch series i'm add new bpf helper which allow to manupulate xdp's data_end pointer. right now only "shrinking" (reduce packet's size by moving pointer) is supported (and i see no use case for "growing"). Main use case for such helper is to be able to generate controll (ICMP) messages from XDP context. such messages usually contains first N bytes from original packets as a payload, and this is exactly what this helper would allow us to do (see patch 3 for sample program, where we generate ICMP "packet too big" message). This helper could be usefull for load balancing applications where after additional encapsulation, resulting packet could be bigger then interface MTU.
Aside from new helper this patch series contains minor changes in device drivers (for ones which requires), so they would recal packet's length not only when head pointer was adjusted, but if tail's one as well.

v2->v3:
* adding missed "signed off by" in v2

v1->v2:
* fixed kbuild warning
* made offset eq 0 invalid for xdp_bpf_adjust_tail
* splitted bpf_prog_test_run fix and selftests in sep commits
* added SPDX licence where applicable
* some reshuffling in patches order (tests now in the end)

Nikita V. Shirokov (11):
bpf: making bpf_prog_test run aware of possible data_end ptr change
bpf: adding tests for bpf_xdp_adjust_tail
bpf: adding bpf_xdp_adjust_tail helper
bpf: make generic xdp compatible w/ bpf_xdp_adjust_tail
bpf: make mlx4 compatible w/ bpf_xdp_adjust_tail
bpf: make bnxt compatible w/ bpf_xdp_adjust_tail
bpf: make cavium thunder compatible w/ bpf_xdp_adjust_tail
bpf: make netronome nfp compatible w/ bpf_xdp_adjust_tail
bpf: make tun compatible w/ bpf_xdp_adjust_tail
bpf: make virtio compatible w/ bpf_xdp_adjust_tail
bpf: add bpf_xdp_adjust_tail sample prog

 drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c      |   2 +-
 drivers/net/ethernet/cavium/thunder/nicvf_main.c   |   2 +-
 drivers/net/ethernet/mellanox/mlx4/en_rx.c         |   2 +-
 .../net/ethernet/netronome/nfp/nfp_net_common.c    |   2 +-
 drivers/net/tun.c                                  |   3 +-
 drivers/net/virtio_net.c                           |   7 +-
 include/uapi/linux/bpf.h                           |  10 +-
 net/bpf/test_run.c                                 |   3 +-
 net/core/dev.c                                     |  10 +-
 net/core/filter.c                                  |  29 +++-
 samples/bpf/Makefile                               |   4 +
 samples/bpf/xdp_adjust_tail_kern.c                 | 152 +++++++++++++++++++++
 samples/bpf/xdp_adjust_tail_user.c                 | 142 +++++++++++++++++++
 tools/include/uapi/linux/bpf.h                     |  10 +-
 tools/testing/selftests/bpf/Makefile               |   2 +-
 tools/testing/selftests/bpf/bpf_helpers.h          |   5 +
 tools/testing/selftests/bpf/test_adjust_tail.c     |  30 ++++
 tools/testing/selftests/bpf/test_progs.c           |  32 +++++
 18 files changed, 435 insertions(+), 12 deletions(-)
 create mode 100644 samples/bpf/xdp_adjust_tail_kern.c
 create mode 100644 samples/bpf/xdp_adjust_tail_user.c
 create mode 100644 tools/testing/selftests/bpf/test_adjust_tail.c
Signature · 1 line
2.15.1