[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210604063116.234316-3-memxor@gmail.com>
Date: Fri, 4 Jun 2021 12:01:11 +0530
From: Kumar Kartikeya Dwivedi <memxor@...il.com>
To: bpf@...r.kernel.org
Cc: Kumar Kartikeya Dwivedi <memxor@...il.com>,
Toke Høiland-Jørgensen <toke@...hat.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>,
Jamal Hadi Salim <jhs@...atatu.com>,
Vlad Buslov <vladbu@...dia.com>,
Cong Wang <xiyou.wangcong@...il.com>,
Jesper Dangaard Brouer <brouer@...hat.com>,
netdev@...r.kernel.org
Subject: [PATCH bpf-next v2 2/7] bpf: export bpf_link functions for modules
These are required in a subsequent patch to implement the bpf_link
command for cls_bpf. Since the bpf_link object is tied to the
cls_bpf_prog object, it has to be initialized and managed from inside
the module.
Reviewed-by: Toke Høiland-Jørgensen <toke@...hat.com>.
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@...il.com>
---
kernel/bpf/syscall.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 50457019da27..e5934b748ced 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -2338,6 +2338,7 @@ void bpf_link_init(struct bpf_link *link, enum bpf_link_type type,
link->ops = ops;
link->prog = prog;
}
+EXPORT_SYMBOL_GPL(bpf_link_init);
static void bpf_link_free_id(int id)
{
@@ -2363,6 +2364,7 @@ void bpf_link_cleanup(struct bpf_link_primer *primer)
fput(primer->file);
put_unused_fd(primer->fd);
}
+EXPORT_SYMBOL_GPL(bpf_link_cleanup);
void bpf_link_inc(struct bpf_link *link)
{
@@ -2510,6 +2512,7 @@ int bpf_link_prime(struct bpf_link *link, struct bpf_link_primer *primer)
primer->id = id;
return 0;
}
+EXPORT_SYMBOL_GPL(bpf_link_prime);
int bpf_link_settle(struct bpf_link_primer *primer)
{
@@ -2522,6 +2525,7 @@ int bpf_link_settle(struct bpf_link_primer *primer)
/* pass through installed FD */
return primer->fd;
}
+EXPORT_SYMBOL_GPL(bpf_link_settle);
int bpf_link_new_fd(struct bpf_link *link)
{
--
2.31.1
Powered by blists - more mailing lists