Re: [PATCH bpf-next v3 2/4] bpf: Expose bpf_get_socket_cookie to tracing programs

2020-12-09 Thread Florent Revest
On Tue, 2020-12-08 at 23:08 +0100, KP Singh wrote: > My understanding is you can simply always call sock_gen_cookie and > not have two protos. > > This will disable preemption in sleepable programs and not have any > effect in non-sleepable programs since preemption will already be > disabled. Su

Re: [PATCH bpf-next v3 2/4] bpf: Expose bpf_get_socket_cookie to tracing programs

2020-12-08 Thread KP Singh
On Tue, Dec 8, 2020 at 9:20 PM Florent Revest wrote: > > This needs two new helpers, one that works in a sleepable context (using > sock_gen_cookie which disables/enables preemption) and one that does not > (for performance reasons). Both take a struct sock pointer and need to > check it for NULLn

[PATCH bpf-next v3 2/4] bpf: Expose bpf_get_socket_cookie to tracing programs

2020-12-08 Thread Florent Revest
This needs two new helpers, one that works in a sleepable context (using sock_gen_cookie which disables/enables preemption) and one that does not (for performance reasons). Both take a struct sock pointer and need to check it for NULLness. This helper could also be useful to other BPF program type