summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2016-09-23 01:28:36 +0200
committerDavid S. Miller <davem@davemloft.net>2016-09-23 08:40:28 -0400
commit669dc4d76d0ecc2d795df735839f43cfddf9f617 (patch)
treec0b392f13de4aa1e6210ed53bb8dbb961816e831 /net/core
parent2d48c5f9335e48ddac7a52db10bf3bfd01986b9c (diff)
downloadlinux-669dc4d76d0ecc2d795df735839f43cfddf9f617.tar.bz2
bpf: use bpf_get_smp_processor_id_proto instead of raw one
Same motivation as in commit 80b48c445797 ("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: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/filter.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/core/filter.c b/net/core/filter.c
index e5d997759d5e..acf84fbfb043 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -2551,6 +2551,8 @@ xdp_func_proto(enum bpf_func_id func_id)
switch (func_id) {
case BPF_FUNC_perf_event_output:
return &bpf_xdp_event_output_proto;
+ case BPF_FUNC_get_smp_processor_id:
+ return &bpf_get_smp_processor_id_proto;
default:
return sk_filter_func_proto(func_id);
}