Skip to content

Commit b7906b7

Browse files
anakryikotorvalds
authored andcommitted
bpf: Fix enum names for bpf_this_cpu_ptr() and bpf_per_cpu_ptr() helpers
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: eaa6bcb ("bpf: Introduce bpf_per_cpu_ptr()") Signed-off-by: Andrii Nakryiko <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent a06caa4 commit b7906b7

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

include/uapi/linux/bpf.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3897,8 +3897,8 @@ union bpf_attr {
38973897
FN(seq_printf_btf), \
38983898
FN(skb_cgroup_classid), \
38993899
FN(redirect_neigh), \
3900-
FN(bpf_per_cpu_ptr), \
3901-
FN(bpf_this_cpu_ptr), \
3900+
FN(per_cpu_ptr), \
3901+
FN(this_cpu_ptr), \
39023902
FN(redirect_peer), \
39033903
/* */
39043904

kernel/bpf/helpers.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -717,9 +717,9 @@ bpf_base_func_proto(enum bpf_func_id func_id)
717717
return &bpf_snprintf_btf_proto;
718718
case BPF_FUNC_jiffies64:
719719
return &bpf_jiffies64_proto;
720-
case BPF_FUNC_bpf_per_cpu_ptr:
720+
case BPF_FUNC_per_cpu_ptr:
721721
return &bpf_per_cpu_ptr_proto;
722-
case BPF_FUNC_bpf_this_cpu_ptr:
722+
case BPF_FUNC_this_cpu_ptr:
723723
return &bpf_this_cpu_ptr_proto;
724724
default:
725725
break;

kernel/trace/bpf_trace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,9 +1337,9 @@ bpf_tracing_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
13371337
return prog->aux->sleepable ? &bpf_copy_from_user_proto : NULL;
13381338
case BPF_FUNC_snprintf_btf:
13391339
return &bpf_snprintf_btf_proto;
1340-
case BPF_FUNC_bpf_per_cpu_ptr:
1340+
case BPF_FUNC_per_cpu_ptr:
13411341
return &bpf_per_cpu_ptr_proto;
1342-
case BPF_FUNC_bpf_this_cpu_ptr:
1342+
case BPF_FUNC_this_cpu_ptr:
13431343
return &bpf_this_cpu_ptr_proto;
13441344
default:
13451345
return NULL;

tools/include/uapi/linux/bpf.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3897,8 +3897,8 @@ union bpf_attr {
38973897
FN(seq_printf_btf), \
38983898
FN(skb_cgroup_classid), \
38993899
FN(redirect_neigh), \
3900-
FN(bpf_per_cpu_ptr), \
3901-
FN(bpf_this_cpu_ptr), \
3900+
FN(per_cpu_ptr), \
3901+
FN(this_cpu_ptr), \
39023902
FN(redirect_peer), \
39033903
/* */
39043904

0 commit comments

Comments
 (0)