mbox series

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

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

Message

Hengqi Chen Oct. 21, 2021, 1:47 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.

v2->v3:
 - Use abstract socket in selftest (Alexei)
 - Run checkpatch script over patches (Andrii)

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         | 40 ++++++++++++++
 8 files changed, 136 insertions(+)
 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.30.2