netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 bpf-next 0/3] BPF: support mark in bpf_fib_lookup
@ 2024-03-26 10:17 Anton Protopopov
  2024-03-26 10:17 ` [PATCH v2 bpf-next 1/3] bpf: add support for passing mark with bpf_fib_lookup Anton Protopopov
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Anton Protopopov @ 2024-03-26 10:17 UTC (permalink / raw)
  To: Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann, Jiri Olsa,
	Martin KaFai Lau, Stanislav Fomichev, bpf
  Cc: Anton Protopopov, Rumen Telbizov, David Ahern, netdev

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/20210629185537.78008-2-rumen.telbizov@menlosecurity.com/

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(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-03-26 21:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-26 10:17 [PATCH v2 bpf-next 0/3] BPF: support mark in bpf_fib_lookup Anton Protopopov
2024-03-26 10:17 ` [PATCH v2 bpf-next 1/3] bpf: add support for passing mark with bpf_fib_lookup Anton Protopopov
2024-03-26 10:17 ` [PATCH v2 bpf-next 2/3] selftests/bpf: Add BPF_FIB_LOOKUP_MARK tests Anton Protopopov
2024-03-26 21:51   ` Martin KaFai Lau
2024-03-26 10:17 ` [PATCH v2 bpf-next 3/3] bpf: add a check for struct bpf_fib_lookup size Anton Protopopov
2024-03-26 21:50 ` [PATCH v2 bpf-next 0/3] BPF: support mark in bpf_fib_lookup patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).