Skip to content

Commit

Permalink
bpf: use bpf_get_smp_processor_id_proto instead of raw one
Browse files Browse the repository at this point in the history
Same motivation as in commit 80b48c4 ("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 <[email protected]>
Acked-by: Alexei Starovoitov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
borkmann authored and davem330 committed Sep 23, 2016
1 parent 2d48c5f commit 669dc4d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/core/filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 669dc4d

Please sign in to comment.