From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexei Starovoitov Subject: Re: [PATCH bpf-next v3 6/8] bpf: add documentation for eBPF helpers (42-50) Date: Wed, 18 Apr 2018 16:29:22 -0700 Message-ID: <20180418232920.xqwxoqy7rlv54pvg@ast-mbp> References: <20180417143438.7018-1-quentin.monnet@netronome.com> <20180417143438.7018-7-quentin.monnet@netronome.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20180417143438.7018-7-quentin.monnet@netronome.com> Sender: netdev-owner@vger.kernel.org To: Quentin Monnet Cc: daniel@iogearbox.net, ast@kernel.org, netdev@vger.kernel.org, oss-drivers@netronome.com, linux-doc@vger.kernel.org, linux-man@vger.kernel.org, Kaixu Xia , Martin KaFai Lau , Sargun Dhillon , Thomas Graf , Gianluca Borello , Chenbo Feng List-Id: linux-man@vger.kernel.org On Tue, Apr 17, 2018 at 03:34:36PM +0100, Quentin Monnet wrote: > Add documentation for eBPF helper functions to bpf.h user header file. > This documentation can be parsed with the Python script provided in > another commit of the patch series, in order to provide a RST document > that can later be converted into a man page. > > The objective is to make the documentation easily understandable and > accessible to all eBPF developers, including beginners. > > This patch contains descriptions for the following helper functions: > > Helper from Kaixu: > - bpf_perf_event_read() > > Helpers from Martin: > - bpf_skb_under_cgroup() > - bpf_xdp_adjust_head() > > Helpers from Sargun: > - bpf_probe_write_user() > - bpf_current_task_under_cgroup() > > Helper from Thomas: > - bpf_skb_change_head() > > Helper from Gianluca: > - bpf_probe_read_str() > > Helpers from Chenbo: > - bpf_get_socket_cookie() > - bpf_get_socket_uid() > > v3: > - bpf_perf_event_read(): Fix time of selection for perf event type in > description. Remove occurences of "cores" to avoid confusion with > "CPU". > > Cc: Kaixu Xia > Cc: Martin KaFai Lau > Cc: Sargun Dhillon > Cc: Thomas Graf > Cc: Gianluca Borello > Cc: Chenbo Feng > Signed-off-by: Quentin Monnet ... > + * > + * u64 bpf_get_socket_cookie(struct sk_buff *skb) > + * Description > + * Retrieve the socket cookie generated by the kernel from a > + * **struct sk_buff** with a known socket. If none has been set this bit could use some improvement, since it reads as cookie is generated from sk_buff, whereas it has nothing to do with this particular sk_buff. Cookie belongs to the socket and generated for the socket. Would be good to explain that cookie is stable for the life of the socket. For the rest: Acked-by: Alexei Starovoitov