mbox series

[bpf-next,0/2,v2] Add bpf_skc_to_unix_sock() helper

Message ID 20211007141331.723149-1-hengqi.chen@gmail.com (mailing list archive)
Headers show
Series Add bpf_skc_to_unix_sock() helper | expand

Message

Hengqi Chen Oct. 7, 2021, 2:13 p.m. UTC
This patch set adds a new BPF helper bpf_skc_to_unix_sock().
The helper is used in tracing programs to cast a socket
pointer to a unix_sock pointer.

v1->v2:
 - Update selftest, remove trailing spaces changes (Song)

Hengqi Chen (2):
  bpf: Add bpf_skc_to_unix_sock() helper
  selftests/bpf: Test bpf_skc_to_unix_sock() helper

 include/linux/bpf.h                           |  1 +
 include/uapi/linux/bpf.h                      |  7 +++
 kernel/trace/bpf_trace.c                      |  2 +
 net/core/filter.c                             | 23 ++++++++
 scripts/bpf_doc.py                            |  2 +
 tools/include/uapi/linux/bpf.h                |  7 +++
 .../bpf/prog_tests/skc_to_unix_sock.c         | 54 +++++++++++++++++++
 .../bpf/progs/test_skc_to_unix_sock.c         | 29 ++++++++++
 8 files changed, 130 insertions(+), 5 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/skc_to_unix_sock.c
 create mode 100644 tools/testing/selftests/bpf/progs/test_skc_to_unix_sock.c

--
2.25.1