History

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.

Andrii Nakryiko committed 5 years ago

Commit b7906b71 parent a06caa44 files · +8 −8Browse files

Unified · Split

4 files
  1. include/uapi/linux/bpf.h +2 −2
  2. kernel/bpf/helpers.c +2 −2
  3. kernel/trace/bpf_trace.c +2 −2
  4. tools/include/uapi/linux/bpf.h +2 −2
include/uapi/linux/bpf.h+2−2
@@ -3897,8 +3897,8 @@ union bpf_attr { · 3896 unmodified lines
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+2−2
@@ -717,9 +717,9 @@ bpf_base_func_proto(enum bpf_func_id func_id) · 716 unmodified lines
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+2−2
@@ -1337,9 +1337,9 @@ bpf_tracing_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) · 1336 unmodified lines
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+2−2
@@ -3897,8 +3897,8 @@ union bpf_attr { · 3896 unmodified lines
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