Re: [PATCH bpf v2 1/2] bpf: Zero-fill other CPUs when BPF_F_CPU creates a per-cpu hash element
From: Donggeun Yoo
Date: Thu Sep 24 2026 - 06:42:01 EST
On Wed, 23 Sep 2026 10:09:40 +0800, Leon Hwang wrote:
> 'onallcpus ? map_flags >> 32' does not look reasonable.
>
> Based on the 'if' above, either of these looks straightforward to me.
>
> int init_cpu = !onallcpus ? raw_smp_processor_id() : map_flags >> 32;
>
> or
>
> int init_cpu = (map_flags & BPF_F_CPU) ? map_flags >> 32 :
> raw_smp_processor_id();
Agreed, v3 takes the second.
Thanks,
Donggeun