summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2016-09-23 01:28:36 +0200
committerMichael Bestas <mkbestas@lineageos.org>2022-04-19 00:51:46 +0300
commitbe326ad58cc8e9be9e8902d670c9d144d1af4d8b (patch)
tree32837e6ca3e4987b6f4f7b99f37946128302c37a /net
parent96faaeaafcac45ef8872c53b67fcfa1a72c4d758 (diff)
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')
-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 bfc5ab6ad10c..4d1cdf5dbb29 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -2611,6 +2611,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);
}