* [PATCH] bpf: Fix enum names for bpf_this_cpu_ptr() and bpf_per_cpu_ptr() helpers
@ 2020-12-11 21:36 Daniel Borkmann
2020-12-11 22:19 ` Linus Torvalds
0 siblings, 1 reply; 2+ messages in thread
From: Daniel Borkmann @ 2020-12-11 21:36 UTC (permalink / raw)
To: torvalds
Cc: davem, kuba, bpf, Andrii Nakryiko, Alexei Starovoitov, Daniel Borkmann
From: Andrii Nakryiko <andrii@kernel.org>
Remove bpf_ prefix, which causes these helpers to be reported in verifier
dump as bpf_bpf_this_cpu_ptr() and bpf_bpf_per_cpu_ptr(), respectively. Lets
fix it as long as it is still possible before UAPI freezes on these helpers.
Fixes: eaa6bcb71ef6 ("bpf: Introduce bpf_per_cpu_ptr()")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
---
[ Hi Linus, this small fix came unfortunately after we sent our last bpf
pull request to David's net tree, and as far as I'm aware no further pull
request for final 5.10 is planned at this moment from David's or Jakub's
side. If you could apply this last fix directly to your tree, that would
be very much appreciated. Thanks a lot! ]
include/uapi/linux/bpf.h | 4 ++--
kernel/bpf/helpers.c | 4 ++--
kernel/trace/bpf_trace.c | 4 ++--
tools/include/uapi/linux/bpf.h | 4 ++--
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index e6ceac3f7d62..556216dc9703 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -3897,8 +3897,8 @@ union bpf_attr {
FN(seq_printf_btf), \
FN(skb_cgroup_classid), \
FN(redirect_neigh), \
- FN(bpf_per_cpu_ptr), \
- FN(bpf_this_cpu_ptr), \
+ FN(per_cpu_ptr), \
+ FN(this_cpu_ptr), \
FN(redirect_peer), \
/* */
diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
index 25520f5eeaf6..deda1185237b 100644
--- a/kernel/bpf/helpers.c
+++ b/kernel/bpf/helpers.c
@@ -717,9 +717,9 @@ bpf_base_func_proto(enum bpf_func_id func_id)
return &bpf_snprintf_btf_proto;
case BPF_FUNC_jiffies64:
return &bpf_jiffies64_proto;
- case BPF_FUNC_bpf_per_cpu_ptr:
+ case BPF_FUNC_per_cpu_ptr:
return &bpf_per_cpu_ptr_proto;
- case BPF_FUNC_bpf_this_cpu_ptr:
+ case BPF_FUNC_this_cpu_ptr:
return &bpf_this_cpu_ptr_proto;
default:
break;
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index 048c655315f1..a125ea5e04cd 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -1337,9 +1337,9 @@ bpf_tracing_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
return prog->aux->sleepable ? &bpf_copy_from_user_proto : NULL;
case BPF_FUNC_snprintf_btf:
return &bpf_snprintf_btf_proto;
- case BPF_FUNC_bpf_per_cpu_ptr:
+ case BPF_FUNC_per_cpu_ptr:
return &bpf_per_cpu_ptr_proto;
- case BPF_FUNC_bpf_this_cpu_ptr:
+ case BPF_FUNC_this_cpu_ptr:
return &bpf_this_cpu_ptr_proto;
default:
return NULL;
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index e6ceac3f7d62..556216dc9703 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -3897,8 +3897,8 @@ union bpf_attr {
FN(seq_printf_btf), \
FN(skb_cgroup_classid), \
FN(redirect_neigh), \
- FN(bpf_per_cpu_ptr), \
- FN(bpf_this_cpu_ptr), \
+ FN(per_cpu_ptr), \
+ FN(this_cpu_ptr), \
FN(redirect_peer), \
/* */
--
2.21.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] bpf: Fix enum names for bpf_this_cpu_ptr() and bpf_per_cpu_ptr() helpers
2020-12-11 21:36 [PATCH] bpf: Fix enum names for bpf_this_cpu_ptr() and bpf_per_cpu_ptr() helpers Daniel Borkmann
@ 2020-12-11 22:19 ` Linus Torvalds
0 siblings, 0 replies; 2+ messages in thread
From: Linus Torvalds @ 2020-12-11 22:19 UTC (permalink / raw)
To: Daniel Borkmann
Cc: David Miller, Jakub Kicinski, bpf, Andrii Nakryiko, Alexei Starovoitov
On Fri, Dec 11, 2020 at 1:36 PM Daniel Borkmann <daniel@iogearbox.net> wrote:
>
> [ Hi Linus, this small fix came unfortunately after we sent our last bpf
> pull request to David's net tree, and as far as I'm aware no further pull
> request for final 5.10 is planned at this moment from David's or Jakub's
> side. If you could apply this last fix directly to your tree, that would
> be very much appreciated. Thanks a lot! ]
Applied, thanks,
Linus
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-11 23:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-11 21:36 [PATCH] bpf: Fix enum names for bpf_this_cpu_ptr() and bpf_per_cpu_ptr() helpers Daniel Borkmann
2020-12-11 22:19 ` Linus Torvalds
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.