bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/2] bpf: change uapi for bpf iterator map elements
@ 2020-08-02  4:21 Yonghong Song
  2020-08-02  4:21 ` [PATCH bpf-next 1/2] " Yonghong Song
  2020-08-02  4:21 ` [PATCH bpf-next 2/2] libbpf: support new uapi for map element bpf iterator Yonghong Song
  0 siblings, 2 replies; 9+ messages in thread
From: Yonghong Song @ 2020-08-02  4:21 UTC (permalink / raw)
  To: bpf, netdev; +Cc: Alexei Starovoitov, Daniel Borkmann, kernel-team

Andrii raised a concern that current uapi for bpf iterator map
element is a little restrictive and not suitable for future potential
complex customization. This is a valid suggestion, considering people
may indeed add more complex custimization to the iterator, e.g.,
cgroup_id + user_id, etc. for task or task_file. Another example might
be map_id plus additional control so that the bpf iterator may bail
out a bucket earlier if a bucket has too many elements which may hold
lock too long and impact other parts of systems.

Patch #1 modified uapi with kernel changes. Patch #2
adjusted libbpf api accordingly.

Yonghong Song (2):
  bpf: change uapi for bpf iterator map elements
  libbpf: support new uapi for map element bpf iterator

 include/linux/bpf.h            | 10 ++++---
 include/uapi/linux/bpf.h       | 15 +++++-----
 kernel/bpf/bpf_iter.c          | 52 +++++++++++++++-------------------
 kernel/bpf/map_iter.c          | 37 ++++++++++++++++++------
 kernel/bpf/syscall.c           |  2 +-
 net/core/bpf_sk_storage.c      | 37 ++++++++++++++++++------
 tools/include/uapi/linux/bpf.h | 15 +++++-----
 tools/lib/bpf/bpf.c            |  4 ++-
 tools/lib/bpf/bpf.h            |  5 ++--
 tools/lib/bpf/libbpf.c         |  7 +++--
 10 files changed, 115 insertions(+), 69 deletions(-)

-- 
2.24.1


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

end of thread, other threads:[~2020-08-03  6:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-02  4:21 [PATCH bpf-next 0/2] bpf: change uapi for bpf iterator map elements Yonghong Song
2020-08-02  4:21 ` [PATCH bpf-next 1/2] " Yonghong Song
2020-08-03  1:25   ` Andrii Nakryiko
2020-08-03  2:23     ` Yonghong Song
2020-08-03  5:11       ` Andrii Nakryiko
2020-08-03  6:21         ` Yonghong Song
2020-08-02  4:21 ` [PATCH bpf-next 2/2] libbpf: support new uapi for map element bpf iterator Yonghong Song
2020-08-03  1:35   ` Andrii Nakryiko
2020-08-03  2:30     ` Yonghong Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).