bpf: don't use raw processor id in generic helper
authorDaniel Borkmann <daniel@iogearbox.net>
Tue, 28 Jun 2016 10:18:26 +0000 (12:18 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 Jun 2016 09:54:40 +0000 (05:54 -0400)
commit80b48c445797a634d869c7e5a53e182ba2688931
tree18b46e8be4b541b966929a478c26c184e2ac3862
parent6816a7ffce32e999601825ddfd887f36d3052932
bpf: don't use raw processor id in generic helper

Use smp_processor_id() for the generic helper bpf_get_smp_processor_id()
instead of the raw variant. This allows for preemption checks when we
have DEBUG_PREEMPT, and otherwise uses the raw variant anyway. We only
need to keep the raw variant for socket filters, but we can reuse the
helper that is already there from cBPF side.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
kernel/bpf/helpers.c
net/core/filter.c