Skip to content

Commit 669dc4d

Browse files
borkmanndavem330
authored andcommitted
bpf: use bpf_get_smp_processor_id_proto instead of raw one
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 <daniel@iogearbox.net> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 2d48c5f commit 669dc4d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

net/core/filter.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2551,6 +2551,8 @@ xdp_func_proto(enum bpf_func_id func_id)
25512551
switch (func_id) {
25522552
case BPF_FUNC_perf_event_output:
25532553
return &bpf_xdp_event_output_proto;
2554+
case BPF_FUNC_get_smp_processor_id:
2555+
return &bpf_get_smp_processor_id_proto;
25542556
default:
25552557
return sk_filter_func_proto(func_id);
25562558
}

0 commit comments

Comments
 (0)