Skip to content

bpf: add XDP_SOCK type

Jonathan Lemon netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1bpf: Allow bpf_map_lookup_elem() on an xskmapinclude/linux/bpf.h include/net/xdp_sock.h include/uapi/linux/bpf.h +6 more+107 -193 replies

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by.

PatchMartin KaFai Lau
1/1A-b

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

Read the v1 thread

Cover letter [PATCH bpf-next 0/1] bpf: add XDP_SOCK type

Have the xskmap version of bpf_map_lookup_elem() return an XDP_SOCK type. This can be used to verify the existence of an entry, and then check the sock properties.

Further improvements would include passing the pointer directly to a helper for redirrection instead of referencing the map again.

Jonathan Lemon (1):
bpf: Allow bpf_map_lookup_elem() on an xskmap

 include/linux/bpf.h                           |  8 ++++
 include/net/xdp_sock.h                        |  4 +-
 include/uapi/linux/bpf.h                      |  4 ++
 kernel/bpf/verifier.c                         | 26 +++++++++++-
 kernel/bpf/xskmap.c                           |  7 ++++
 net/core/filter.c                             | 40 +++++++++++++++++++
 tools/include/uapi/linux/bpf.h                |  4 ++
 .../bpf/verifier/prevent_map_lookup.c         | 15 -------
 tools/testing/selftests/bpf/verifier/sock.c   | 18 +++++++++
 9 files changed, 107 insertions(+), 19 deletions(-)
Signature · 1 line
2.17.1