bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Sitnicki <jakub@cloudflare.com>
To: bpf@vger.kernel.org
Cc: Martin Lau <kafai@fb.com>, kernel-team@cloudflare.com
Subject: [PATCH bpf-next 01/10] libbpf: Recognize SK_REUSEPORT programs from section name
Date: Thu, 12 Dec 2019 11:22:50 +0100	[thread overview]
Message-ID: <20191212102259.418536-2-jakub@cloudflare.com> (raw)
In-Reply-To: <20191212102259.418536-1-jakub@cloudflare.com>

Allow loading BPF object files that contain SK_REUSEPORT programs without
having to manually set the program type before load if the the section name
is set to "sk_reuseport".

Makes user-space code needed to load SK_REUSEPORT BPF program more concise.

Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
---
 tools/lib/bpf/libbpf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 3f09772192f1..13f6db467cdd 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -4982,6 +4982,7 @@ static const struct {
 	enum bpf_attach_type attach_type;
 } section_names[] = {
 	BPF_PROG_SEC("socket",			BPF_PROG_TYPE_SOCKET_FILTER),
+	BPF_PROG_SEC("sk_reuseport",		BPF_PROG_TYPE_SK_REUSEPORT),
 	BPF_PROG_SEC("kprobe/",			BPF_PROG_TYPE_KPROBE),
 	BPF_PROG_SEC("uprobe/",			BPF_PROG_TYPE_KPROBE),
 	BPF_PROG_SEC("kretprobe/",		BPF_PROG_TYPE_KPROBE),
-- 
2.23.0


  reply	other threads:[~2019-12-12 10:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-12 10:22 [PATCH bpf-next 00/10] Switch reuseport tests for test_progs framework Jakub Sitnicki
2019-12-12 10:22 ` Jakub Sitnicki [this message]
2019-12-12 10:22 ` [PATCH bpf-next 02/10] selftests/bpf: Let libbpf determine program type from section name Jakub Sitnicki
2019-12-12 10:22 ` [PATCH bpf-next 03/10] selftests/bpf: Use sa_family_t everywhere in reuseport tests Jakub Sitnicki
2019-12-12 10:22 ` [PATCH bpf-next 04/10] selftests/bpf: Add helpers for getting socket family & type name Jakub Sitnicki
2019-12-12 10:22 ` [PATCH bpf-next 05/10] selftests/bpf: Unroll the main loop in reuseport test Jakub Sitnicki
2019-12-12 10:22 ` [PATCH bpf-next 06/10] selftests/bpf: Run reuseport tests in a loop Jakub Sitnicki
2019-12-12 10:22 ` [PATCH bpf-next 07/10] selftests/bpf: Propagate errors during setup for reuseport tests Jakub Sitnicki
2019-12-12 10:22 ` [PATCH bpf-next 08/10] selftests/bpf: Pull up printing the test name into test runner Jakub Sitnicki
2019-12-12 10:22 ` [PATCH bpf-next 09/10] selftests/bpf: Move reuseport tests under prog_tests/ Jakub Sitnicki
2019-12-12 10:22 ` [PATCH bpf-next 10/10] selftests/bpf: Switch reuseport tests for test_progs framework Jakub Sitnicki
2019-12-13  5:36 ` [PATCH bpf-next 00/10] " Alexei Starovoitov
2019-12-13 16:30   ` Martin Lau
2019-12-13 20:41     ` Alexei Starovoitov

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=20191212102259.418536-2-jakub@cloudflare.com \
    --to=jakub@cloudflare.com \
    --cc=bpf@vger.kernel.org \
    --cc=kafai@fb.com \
    --cc=kernel-team@cloudflare.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 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).