All of lore.kernel.org
 help / color / mirror / Atom feed
* [bpf-next PATCH v2 0/5] bpf: Add sk_msg and networking helpers
@ 2020-05-15 22:05 John Fastabend
  2020-05-15 22:05 ` [bpf-next PATCH v2 1/5] bpf: sk_msg add some generic helpers that may be useful from sk_msg John Fastabend
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: John Fastabend @ 2020-05-15 22:05 UTC (permalink / raw)
  To: yhs, ast, daniel; +Cc: lmb, bpf, john.fastabend, jakub, netdev

This series adds helpers for sk_msg program type and based on feedback
from v1 adds *_task_* helpers and probe_* helpers to all networking
programs with perfmon_capable() capabilities.

The list of helpers breaks down as follows,

Networking with perfmon_capable() guard (patch2):

 BPF_FUNC_get_current_task
 BPF_FUNC_current_task_under_cgroup
 BPF_FUNC_probe_read_user
 BPF_FUNC_probe_read_kernel
 BPF_FUNC_probe_read_user_str
 BPF_FUNC_probe_read_kernel_str

Added to sk_msg program types (patch1,3):

 BPF_FUNC_perf_event_output
 BPF_FUNC_get_current_uid_gid
 BPF_FUNC_get_current_pid_tgid
 BPF_FUNC_get_current_cgroup_id
 BPF_FUNC_get_current_ancestor_cgroup_id
 BPF_FUNC_get_cgroup_classid

 BPF_FUNC_sk_storage_get
 BPF_FUNC_sk_storage_delete

For testing we create two tests. One specifically for the sk_msg
program types which encodes a common pattern we use to test verifier
logic now and as the verifier evolves.

Next we have skb classifier test. This uses the test run infra to
run a test which uses the get_current_task, current_task_under_cgroup,
probe_read_kernel, and probe_reak_kernel_str.

Note we dropped the old probe_read variants probe_read() and
probe_read_str() in v2.

v1->v2:
 Pulled generic helpers *current_task* and probe_* into the
 base func helper so they can be used more widely in netowrking scope.

 BPF capabilities patch is now in bpf-next so use perfmon_capable() check
 instead of CAP_SYS_ADMIN.

 Drop old probe helpers, probe_read() and probe_read_str()

 Added tests. 

 Thanks to Daniel and Yonghong for review and feedback.

---

John Fastabend (5):
      bpf: sk_msg add some generic helpers that may be useful from sk_msg
      bpf: extend bpf_base_func_proto helpers with probe_* and *current_task*
      bpf: sk_msg add get socket storage helpers
      bpf: selftests, add sk_msg helpers load and attach test
      bpf: selftests, test probe_* helpers from SCHED_CLS


 include/uapi/linux/bpf.h                           |    2 +
 kernel/bpf/helpers.c                               |   27 +++++++++
 kernel/trace/bpf_trace.c                           |   16 +++---
 net/core/filter.c                                  |   31 +++++++++++
 tools/include/uapi/linux/bpf.h                     |    2 +
 .../testing/selftests/bpf/prog_tests/skb_helpers.c |   30 +++++++++++
 .../selftests/bpf/prog_tests/sockmap_basic.c       |   57 ++++++++++++++++++++
 .../testing/selftests/bpf/progs/test_skb_helpers.c |   33 ++++++++++++
 .../selftests/bpf/progs/test_skmsg_load_helpers.c  |   48 +++++++++++++++++
 9 files changed, 238 insertions(+), 8 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/skb_helpers.c
 create mode 100644 tools/testing/selftests/bpf/progs/test_skb_helpers.c
 create mode 100644 tools/testing/selftests/bpf/progs/test_skmsg_load_helpers.c

--
Signature

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-05-18  5:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-15 22:05 [bpf-next PATCH v2 0/5] bpf: Add sk_msg and networking helpers John Fastabend
2020-05-15 22:05 ` [bpf-next PATCH v2 1/5] bpf: sk_msg add some generic helpers that may be useful from sk_msg John Fastabend
2020-05-15 22:06 ` [bpf-next PATCH v2 2/5] bpf: extend bpf_base_func_proto helpers with probe_* and *current_task* John Fastabend
2020-05-18  5:13   ` Yonghong Song
2020-05-15 22:06 ` [bpf-next PATCH v2 3/5] bpf: sk_msg add get socket storage helpers John Fastabend
2020-05-18  5:24   ` Yonghong Song
2020-05-15 22:06 ` [bpf-next PATCH v2 4/5] bpf: selftests, add sk_msg helpers load and attach test John Fastabend
2020-05-15 22:07 ` [bpf-next PATCH v2 5/5] bpf: selftests, test probe_* helpers from SCHED_CLS John Fastabend

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.