bpf: Fix enum names for bpf_this_cpu_ptr() and bpf_per_cpu_ptr() helpers
authorAndrii Nakryiko <andrii@kernel.org>
Fri, 11 Dec 2020 21:36:25 +0000 (22:36 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 11 Dec 2020 22:19:07 +0000 (14:19 -0800)
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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/uapi/linux/bpf.h
kernel/bpf/helpers.c
kernel/trace/bpf_trace.c
tools/include/uapi/linux/bpf.h

index e6ceac3f7d624ec45f4828e76a77cce43cc3aa9b..556216dc97030587d3c7a2edcb040cdef7065877 100644 (file)
@@ -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),              \
        /* */
 
index 25520f5eeaf687d836079b42ca159aeb977ae0c7..deda1185237b81eeaf30f26a7a2b97b211313dfa 100644 (file)
@@ -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;
index 048c655315f13a8be5678d1c2a328026ffc5b597..a125ea5e04cd75ac4a9e1751bb24192350bdc55d 100644 (file)
@@ -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;
index e6ceac3f7d624ec45f4828e76a77cce43cc3aa9b..556216dc97030587d3c7a2edcb040cdef7065877 100644 (file)
@@ -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),              \
        /* */