All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitrii Dolgov <9erthalion6@gmail.com>
To: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net,
	andrii@kernel.org, yhs@fb.com, songliubraving@fb.com
Cc: Dmitrii Dolgov <9erthalion6@gmail.com>
Subject: [RFC PATCH bpf-next 0/2] bpf: bpf link iterator
Date: Fri, 22 Apr 2022 20:22:52 +0200	[thread overview]
Message-ID: <20220422182254.13693-1-9erthalion6@gmail.com> (raw)

Bpf links seem to be one of the important structures for which no
iterator is provided. Such iterator could be useful in those cases when
generic 'task/file' is not suitable or better performance is needed.

The implementation is mostly copied from prog iterator, and I would like
to get any high-level feedback about what needs to be different or have
to be taken into account. As a side note, I would also appreciate if
someone could point me out to some guide about writing selftests for bpf
subsystem -- for some unclear reason I couldn't compile the test from
this changeset, and was testing it only manually with a custom test
program.

Dmitrii Dolgov (2):
  bpf: Add bpf_link iterator
  selftests/bpf: Add bpf_link test

 include/linux/bpf.h                           |   1 +
 kernel/bpf/Makefile                           |   2 +-
 kernel/bpf/link_iter.c                        | 107 ++++++++++++++++++
 kernel/bpf/syscall.c                          |  19 ++++
 .../selftests/bpf/prog_tests/bpf_iter.c       |  15 +++
 .../selftests/bpf/progs/bpf_iter_bpf_link.c   |  18 +++
 6 files changed, 161 insertions(+), 1 deletion(-)
 create mode 100644 kernel/bpf/link_iter.c
 create mode 100644 tools/testing/selftests/bpf/progs/bpf_iter_bpf_link.c

-- 
2.32.0


             reply	other threads:[~2022-04-22 18:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-22 18:22 Dmitrii Dolgov [this message]
2022-04-22 18:22 ` [RFC PATCH bpf-next 1/2] bpf: Add bpf_link iterator Dmitrii Dolgov
2022-04-27 19:03   ` Andrii Nakryiko
2022-04-28 16:14   ` Yonghong Song
     [not found]     ` <CA+q6zcXkSBrmnUt3jS+zggqJjUFJQ2J_qUmA4HXtcFmYzYppMg@mail.gmail.com>
2022-04-28 21:02       ` Yonghong Song
2022-04-22 18:22 ` [RFC PATCH bpf-next 2/2] selftests/bpf: Add bpf link iter test Dmitrii Dolgov
2022-04-27 19:03   ` Andrii Nakryiko
2022-04-28 16:42   ` Yonghong Song
2022-04-27 19:04 ` [RFC PATCH bpf-next 0/2] bpf: bpf link iterator Andrii Nakryiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220422182254.13693-1-9erthalion6@gmail.com \
    --to=9erthalion6@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.