提交 669dc4d7 编写于 作者: D Daniel Borkmann 提交者: David S. Miller

bpf: use bpf_get_smp_processor_id_proto instead of raw one

Same motivation as in commit 80b48c44 ("bpf: don't use raw processor
id in generic helper"), but this time for XDP typed programs. Thus, allow
for preemption checks when we have DEBUG_PREEMPT enabled, and otherwise
use the raw variant.
Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
Acked-by: NAlexei Starovoitov <ast@kernel.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 2d48c5f9
...@@ -2551,6 +2551,8 @@ xdp_func_proto(enum bpf_func_id func_id) ...@@ -2551,6 +2551,8 @@ xdp_func_proto(enum bpf_func_id func_id)
switch (func_id) { switch (func_id) {
case BPF_FUNC_perf_event_output: case BPF_FUNC_perf_event_output:
return &bpf_xdp_event_output_proto; return &bpf_xdp_event_output_proto;
case BPF_FUNC_get_smp_processor_id:
return &bpf_get_smp_processor_id_proto;
default: default:
return sk_filter_func_proto(func_id); return sk_filter_func_proto(func_id);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册