Re: [PATCH v2 2/5] bpf: Add a bpf_sock_from_file helper

2020-11-19 Thread Martin KaFai Lau
On Thu, Nov 19, 2020 at 05:26:51PM +0100, Florent Revest wrote: > From: Florent Revest > > While eBPF programs can check whether a file is a socket by file->f_op > == _file_ops, they cannot convert the void private_data pointer > to a struct socket BTF pointer. In order to do this a new helper >

Re: [PATCH v2 2/5] bpf: Add a bpf_sock_from_file helper

2020-11-19 Thread KP Singh
On Thu, Nov 19, 2020 at 5:27 PM Florent Revest wrote: > > From: Florent Revest > > While eBPF programs can check whether a file is a socket by file->f_op > == _file_ops, they cannot convert the void private_data pointer > to a struct socket BTF pointer. In order to do this a new helper >

[PATCH v2 2/5] bpf: Add a bpf_sock_from_file helper

2020-11-19 Thread Florent Revest
From: Florent Revest While eBPF programs can check whether a file is a socket by file->f_op == _file_ops, they cannot convert the void private_data pointer to a struct socket BTF pointer. In order to do this a new helper wrapping sock_from_file is added. This is useful to tracing programs but