Skip to content

Support bpf_get_socket_cookie in more prog types

Andrey Ignatov netdev 2 versions – Applied

Status from this message: Applied to bpf-next, thanks Andrey!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 2 repliesApplied
  2. v14 patches 5 repliesSuperseded

Changes in v2 from the cover letter

- simplify attach_type guessing logic in selftest.

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/4bpf: Support bpf_get_socket_cookie in more prog typesinclude/uapi/linux/bpf.h net/core/filter.c+42 -00 replies
2/4bpf: Sync bpf.h to tools/tools/include/uapi/linux/bpf.h+14 -00 replies
3/4selftests/bpf: Add bpf_get_socket_cookie to bpf_helpers.htools/testing/selftests/bpf/bpf_helpers.h+2 -00 replies
4/4selftests/bpf: Test for get_socket_cookietools/testing/selftests/bpf/Makefile tools/testing/selftests/bpf/socket_cookie_prog.c tools/testing/selftests/bpf/test_socket_cookie.c+289 -21 reply

Reviews trailers per patch

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

PatchYonghong Song
1/4A-b
2/4A-b
3/4A-b
4/4A-b

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/4] Support bpf_get_socket_cookie in more prog types

v1->v2:
- simplify attach_type guessing logic in selftest.

This patch set adds support to call bpf_get_socket_cookie() helper from two more program types:
* BPF_PROG_TYPE_CGROUP_SOCK_ADDR;
* BPF_PROG_TYPE_SOCK_OPS.

Patch 1 adds kernel support and provides more details. Patch 2 syncs UAPI changes to tools/.
Patch 3 adds missing helper to bpf_helpers.h. Patch 4 adds selftest for new functionality.

Andrey Ignatov (4):
bpf: Support bpf_get_socket_cookie in more prog types
bpf: Sync bpf.h to tools/
selftests/bpf: Add bpf_get_socket_cookie to bpf_helpers.h selftests/bpf: Test for get_socket_cookie

 include/uapi/linux/bpf.h                      |  14 ++
 net/core/filter.c                             |  28 +++
 tools/include/uapi/linux/bpf.h                |  14 ++
 tools/testing/selftests/bpf/Makefile          |   6 +-
 tools/testing/selftests/bpf/bpf_helpers.h     |   2 +
 .../selftests/bpf/socket_cookie_prog.c        |  60 +++++
 .../selftests/bpf/test_socket_cookie.c        | 225 ++++++++++++++++++
 7 files changed, 347 insertions(+), 2 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/socket_cookie_prog.c
 create mode 100644 tools/testing/selftests/bpf/test_socket_cookie.c
Signature · 1 line
2.17.1