Re: [PATCH bpf-next v2 5/6] bpf: Introduce bpf_this_cpu_ptr()

2020-09-13 Thread Hao Luo
Thanks for taking a look! On Fri, Sep 4, 2020 at 1:09 PM Andrii Nakryiko wrote: > > On Thu, Sep 3, 2020 at 3:35 PM Hao Luo wrote: > > > > Add bpf_this_cpu_ptr() to help access percpu var on this cpu. This > > helper always returns a valid pointer, therefore no need to check > > returned value fo

Re: [PATCH bpf-next v2 5/6] bpf: Introduce bpf_this_cpu_ptr()

2020-09-04 Thread Andrii Nakryiko
On Thu, Sep 3, 2020 at 3:35 PM Hao Luo wrote: > > Add bpf_this_cpu_ptr() to help access percpu var on this cpu. This > helper always returns a valid pointer, therefore no need to check > returned value for NULL. Also note that all programs run with > preemption disabled, which means that the retur

[PATCH bpf-next v2 5/6] bpf: Introduce bpf_this_cpu_ptr()

2020-09-03 Thread Hao Luo
Add bpf_this_cpu_ptr() to help access percpu var on this cpu. This helper always returns a valid pointer, therefore no need to check returned value for NULL. Also note that all programs run with preemption disabled, which means that the returned pointer is stable during all the execution of the pro