Skip to content

BPF: support mark in bpf_fib_lookup

Anton Protopopov bpf netdev 2 versions – Applied

Status from this message: This series was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 1 replyApplied 3/3
  2. v12 patches 6 repliesSuperseded

Changes in v2 from the cover letter

- simplify the selftests (Martin)
- add a static check for sizeof(struct bpf_fib_lookup) (David)

Patches in v2 All 3 applied

#Subject and filesSizeRepliesApplied
1/3bpf: add support for passing mark with bpf_fib_lookupinclude/uapi/linux/bpf.h net/core/filter.c tools/include/uapi/linux/bpf.h+45 -70 repliesApplied
2/3selftests/bpf: Add BPF_FIB_LOOKUP_MARK teststools/testing/selftests/bpf/prog_tests/fib_lookup.c+105 -291 replyApplied
3/3bpf: add a check for struct bpf_fib_lookup sizenet/core/filter.c+3 -00 repliesApplied

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchDaniel BorkmannDavid Ahern
1/3A-b R-b
2/3A-b
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 bpf-next 0/3] BPF: support mark in bpf_fib_lookup

This patch series adds policy routing support in bpf_fib_lookup. This is a useful functionality which was missing for a long time, as without it some networking setups can't be implemented in BPF. One example can be found here [1].

A while ago there was an attempt to add this functionality [2] by Rumen Telbizov and David Ahern. I've completely refactored the code, except that the changes to the struct bpf_fib_lookup were copy-pasted from the original patch.

The first patch implements the functionality, the second patch adds a few selftests, the third patch adds a build time check of the size of the struct bpf_fib_lookup.

[1] https://github.com/cilium/cilium/pull/12770
[2] https://lore.kernel.org/all/[email protected]/

v1 -> v2:
- simplify the selftests (Martin)
- add a static check for sizeof(struct bpf_fib_lookup) (David)

Anton Protopopov (3):
bpf: add support for passing mark with bpf_fib_lookup selftests/bpf: Add BPF_FIB_LOOKUP_MARK tests
bpf: add a check for struct bpf_fib_lookup size

 include/uapi/linux/bpf.h                      |  20 ++-
 net/core/filter.c                             |  15 +-
 tools/include/uapi/linux/bpf.h                |  20 ++-
 .../selftests/bpf/prog_tests/fib_lookup.c     | 134 ++++++++++++++----
 4 files changed, 153 insertions(+), 36 deletions(-)
Signature · 1 line
2.34.1