From: Yonghong Song <yhs@fb.com>
To: Andrii Nakryiko <andriin@fb.com>, <bpf@vger.kernel.org>,
Martin KaFai Lau <kafai@fb.com>, <netdev@vger.kernel.org>
Cc: Alexei Starovoitov <ast@fb.com>,
Daniel Borkmann <daniel@iogearbox.net>, <kernel-team@fb.com>
Subject: [PATCH bpf-next v2 5/7] bpf: change func bpf_iter_unreg_target() signature
Date: Wed, 13 May 2020 11:02:20 -0700 [thread overview]
Message-ID: <20200513180220.2949737-1-yhs@fb.com> (raw)
In-Reply-To: <20200513180215.2949164-1-yhs@fb.com>
Change func bpf_iter_unreg_target() parameter from target
name to target reg_info, similar to bpf_iter_reg_target().
Acked-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Yonghong Song <yhs@fb.com>
---
include/linux/bpf.h | 2 +-
kernel/bpf/bpf_iter.c | 4 ++--
net/ipv6/route.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 6fa773e2d1bf..534174eca86b 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -1154,7 +1154,7 @@ struct bpf_iter_meta {
};
int bpf_iter_reg_target(const struct bpf_iter_reg *reg_info);
-void bpf_iter_unreg_target(const char *target);
+void bpf_iter_unreg_target(const struct bpf_iter_reg *reg_info);
bool bpf_iter_prog_supported(struct bpf_prog *prog);
int bpf_iter_link_attach(const union bpf_attr *attr, struct bpf_prog *prog);
int bpf_iter_new_fd(struct bpf_link *link);
diff --git a/kernel/bpf/bpf_iter.c b/kernel/bpf/bpf_iter.c
index 051fb8cab62a..644f8626b2c0 100644
--- a/kernel/bpf/bpf_iter.c
+++ b/kernel/bpf/bpf_iter.c
@@ -257,14 +257,14 @@ int bpf_iter_reg_target(const struct bpf_iter_reg *reg_info)
return 0;
}
-void bpf_iter_unreg_target(const char *target)
+void bpf_iter_unreg_target(const struct bpf_iter_reg *reg_info)
{
struct bpf_iter_target_info *tinfo;
bool found = false;
mutex_lock(&targets_mutex);
list_for_each_entry(tinfo, &targets, list) {
- if (!strcmp(target, tinfo->reg_info->target)) {
+ if (reg_info == tinfo->reg_info) {
list_del(&tinfo->list);
kfree(tinfo);
found = true;
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 6ad2fa51a23a..22bf4e36c093 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -6412,7 +6412,7 @@ static int __init bpf_iter_register(void)
static void bpf_iter_unregister(void)
{
- bpf_iter_unreg_target("ipv6_route");
+ bpf_iter_unreg_target(&ipv6_route_reg_info);
}
#endif
#endif
--
2.24.1
next prev parent reply other threads:[~2020-05-13 18:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-13 18:02 [PATCH bpf-next v2 0/7] bpf: misc fixes for bpf_iter Yonghong Song
2020-05-13 18:02 ` [PATCH bpf-next v2 1/7] tools/bpf: selftests : explain bpf_iter test failures with llvm 10.0.0 Yonghong Song
2020-05-13 18:02 ` [PATCH bpf-next v2 2/7] bpf: change btf_iter func proto prefix to "bpf_iter_" Yonghong Song
2020-05-13 18:02 ` [PATCH bpf-next v2 3/7] bpf: add comments to interpret bpf_prog return values Yonghong Song
2020-05-13 18:02 ` [PATCH bpf-next v2 4/7] bpf: net: refactor bpf_iter target registration Yonghong Song
2020-05-13 18:02 ` Yonghong Song [this message]
2020-05-13 18:02 ` [PATCH bpf-next v2 6/7] bpf: enable bpf_iter targets registering ctx argument types Yonghong Song
2020-05-13 18:02 ` [PATCH bpf-next v2 7/7] samples/bpf: remove compiler warnings Yonghong Song
2020-05-13 18:19 ` [PATCH bpf-next v2 0/7] bpf: misc fixes for bpf_iter Andrii Nakryiko
2020-05-13 19:38 ` 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=20200513180220.2949737-1-yhs@fb.com \
--to=yhs@fb.com \
--cc=andriin@fb.com \
--cc=ast@fb.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kafai@fb.com \
--cc=kernel-team@fb.com \
--cc=netdev@vger.kernel.org \
/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).