Re: [PATCH bpf] bpf: zero-fill re-used per-cpu map element

2020-10-27 Thread David Verbeiren
On Mon, Oct 26, 2020 at 11:48 PM Andrii Nakryiko wrote: > > On Fri, Oct 23, 2020 at 8:48 AM David Verbeiren > wrote: > > [...] > > + if (!onallcpus) > > + for_each_possible_cpu(cpu) > > + memset((void *)per_

Re: [PATCH bpf] bpf: zero-fill re-used per-cpu map element

2020-10-26 Thread Andrii Nakryiko
On Fri, Oct 23, 2020 at 8:48 AM David Verbeiren wrote: > > Zero-fill element values for all cpus, just as when not using > prealloc. This is the only way the bpf program can ensure known > initial values for cpus other than the current one ('onallcpus' > cannot be set when coming from the bpf prog

[PATCH bpf] bpf: zero-fill re-used per-cpu map element

2020-10-23 Thread David Verbeiren
Zero-fill element values for all cpus, just as when not using prealloc. This is the only way the bpf program can ensure known initial values for cpus other than the current one ('onallcpus' cannot be set when coming from the bpf program). The scenario is: bpf program inserts some elements in a per