Skip to content

bpf: Support socket lookup in CGROUP_SOCK_ADDR progs

Andrey Ignatov netdev 2 versions – Applied

Status from this message: applied, thanks

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 2 repliesApplied
  2. v14 patches 4 repliesSuperseded

Changes in v2 from the cover letter

- remove "Split bpf_sk_lookup" patch since it was already split by:
commit c8123ead13a5 ("bpf: Extend the sk_lookup() helper to XDP hookpoint.");
- avoid unnecessary bpf_sock_addr_sk_lookup function.

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/3bpf: Fix IPv6 dport byte order in bpf_sk_lookup_udpnet/core/filter.c+2 -30 replies
2/3bpf: Support socket lookup in CGROUP_SOCK_ADDR progsnet/core/filter.c+45 -01 reply
3/3selftest/bpf: Use bpf_sk_lookup_{tcp,udp} in test_sock_addrtools/testing/selftests/bpf/connect4_prog.c tools/testing/selftests/bpf/connect6_prog.c+78 -210 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchAlexei StarovoitovMartin KaFai LauJoe Stringer
1/3A-b A-b
2/3A-b A-b
3/3A-b A-b

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

Read the v2 thread

Cover letter [PATCH bpf-next v2 0/3] bpf: Support socket lookup in CGROUP_SOCK_ADDR progs

This patch set makes bpf_sk_lookup_tcp, bpf_sk_lookup_udp and bpf_sk_release helpers available in programs of type BPF_PROG_TYPE_CGROUP_SOCK_ADDR.

Patch 1 is a fix for bpf_sk_lookup_udp that was already merged to bpf (stable) tree. Here it's prerequisite for patch 3.

Patch 2 is the main patch in the set, it makes the helpers available for BPF_PROG_TYPE_CGROUP_SOCK_ADDR and provides more details about use-case.

Patch 3 adds selftest for new functionality.

v1->v2:
- remove "Split bpf_sk_lookup" patch since it was already split by:
commit c8123ead13a5 ("bpf: Extend the sk_lookup() helper to XDP hookpoint.");
- avoid unnecessary bpf_sock_addr_sk_lookup function.

Andrey Ignatov (3):
bpf: Fix IPv6 dport byte order in bpf_sk_lookup_udp
bpf: Support socket lookup in CGROUP_SOCK_ADDR progs selftest/bpf: Use bpf_sk_lookup_{tcp,udp} in test_sock_addr

 net/core/filter.c                           | 50 ++++++++++++++++--
 tools/testing/selftests/bpf/connect4_prog.c | 43 ++++++++++++----
 tools/testing/selftests/bpf/connect6_prog.c | 56 ++++++++++++++++-----
 3 files changed, 125 insertions(+), 24 deletions(-)
Signature · 1 line
2.17.1