bpf: use bpf_get_smp_processor_id_proto instead of raw one
authorDaniel Borkmann <daniel@iogearbox.net>
Thu, 22 Sep 2016 23:28:36 +0000 (01:28 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 23 Sep 2016 12:40:28 +0000 (08:40 -0400)
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>
net/core/filter.c

index e5d997759d5e042d33cc29368baa891ed1e3508c..acf84fbfb0433febdfd09f3eb0220476e3d2885b 100644 (file)
@@ -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);
        }