android_kernel_msm-6.1_noth.../tools/include/uapi
Martin KaFai Lau 8904d8848b bpf: Add BPF_FIB_LOOKUP_SKIP_NEIGH for bpf_fib_lookup
[ Upstream commit 31de4105f00d64570139bc5494a201b0bd57349f ]

The bpf_fib_lookup() also looks up the neigh table.
This was done before bpf_redirect_neigh() was added.

In the use case that does not manage the neigh table
and requires bpf_fib_lookup() to lookup a fib to
decide if it needs to redirect or not, the bpf prog can
depend only on using bpf_redirect_neigh() to lookup the
neigh. It also keeps the neigh entries fresh and connected.

This patch adds a bpf_fib_lookup flag, SKIP_NEIGH, to avoid
the double neigh lookup when the bpf prog always call
bpf_redirect_neigh() to do the neigh lookup. The params->smac
output is skipped together when SKIP_NEIGH is set because
bpf_redirect_neigh() will figure out the smac also.

Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20230217205515.3583372-1-martin.lau@linux.dev
Stable-dep-of: 5baa0433a15e ("neighbour: fix data-races around n->output")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-10-10 22:00:42 +02:00
..
asm tools/include/uapi: Fix <asm/errno.h> for parisc and xtensa 2022-09-13 14:04:35 +02:00
asm-generic open: return EINVAL for O_DIRECTORY | O_CREAT 2023-05-24 17:32:34 +01:00
drm tools headers UAPI: Sync drm/i915_drm.h with the kernel sources 2022-08-19 15:30:34 -03:00
linux bpf: Add BPF_FIB_LOOKUP_SKIP_NEIGH for bpf_fib_lookup 2023-10-10 22:00:42 +02:00
sound tools include UAPI: Sync sound/asound.h copy with the kernel sources 2022-10-25 17:40:48 -03:00