All of lore.kernel.org
 help / color / mirror / Atom feed
From: Quentin Monnet <quentin.monnet@netronome.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
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
Subject: Re: [RFC bpf-next v2 4/8] bpf: add documentation for eBPF helpers (23-32)
Date: Fri, 13 Apr 2018 19:18:38 +0100	[thread overview]
Message-ID: <866e9593-0247-87e6-35d8-6fde1f8e382b@netronome.com> (raw)
In-Reply-To: <20180413002838.atu7shp5cuubx32p@ast-mbp.dhcp.thefacebook.com>

2018-04-12 17:28 UTC-0700 ~ Alexei Starovoitov
<alexei.starovoitov@gmail.com>
> On Tue, Apr 10, 2018 at 03:41:53PM +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, all
>> written by Daniel:
>>
>> - bpf_get_prandom_u32()
>> - bpf_get_smp_processor_id()
>> - bpf_get_cgroup_classid()
>> - bpf_get_route_realm()
>> - bpf_skb_load_bytes()
>> - bpf_csum_diff()
>> - bpf_skb_get_tunnel_opt()
>> - bpf_skb_set_tunnel_opt()
>> - bpf_skb_change_proto()
>> - bpf_skb_change_type()
>>
>> Cc: Daniel Borkmann <daniel@iogearbox.net>
>> Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
>> ---
>>  include/uapi/linux/bpf.h | 125 +++++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 125 insertions(+)
>>
>> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
>> index f3ea8824efbc..d147d9dd6a83 100644
>> --- a/include/uapi/linux/bpf.h
>> +++ b/include/uapi/linux/bpf.h

[...]

>> @@ -604,6 +612,13 @@ union bpf_attr {
>>   * 	Return
>>   * 		0 on success, or a negative error in case of failure.
>>   *
>> + * u32 bpf_get_cgroup_classid(struct sk_buff *skb)
>> + * 	Description
>> + * 		Retrieve the classid for the current task, i.e. for the
>> + * 		net_cls (network classifier) cgroup to which *skb* belongs.
> 
> please add that kernel should be configured with CONFIG_NET_CLS_CGROUP=y|m
> and mention Documentation/cgroup-v1/net_cls.txt

Ok.

> Otherwise 'network classifier' is way too generic.

I am not so familiar with cgroups. What would you suggest instead?

> I'd also mention that placing a task into net_cls controller
> disables all of cgroup-bpf.

Could you please explain a bit more? Placing a task into the controller
is using:

	echo <task_pid>  >  /sys/fs/cgroup/<my_cgroup_name>/tasks

correct? Then if I do this, it disables all of cgroup-bpf. Does this
mean that I loose the possibility to use or add BPF programs to all
cgroup-related attach points for this cgroup? I think I missed something
here.

>> + * 	Return
>> + * 		The classid, or 0 for the default unconfigured classid.
>> + *
>>   * int bpf_skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci)
>>   * 	Description
>>   * 		Push a *vlan_tci* (VLAN tag control information) of protocol

I have no particular comments on the other items you reported on this
patch, I will fix them. Thanks!

Quentin

WARNING: multiple messages have this Message-ID (diff)
From: Quentin Monnet <quentin.monnet@netronome.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
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
Subject: Re: [RFC bpf-next v2 4/8] bpf: add documentation for eBPF helpers (23-32)
Date: Fri, 13 Apr 2018 19:18:38 +0100	[thread overview]
Message-ID: <866e9593-0247-87e6-35d8-6fde1f8e382b@netronome.com> (raw)
In-Reply-To: <20180413002838.atu7shp5cuubx32p@ast-mbp.dhcp.thefacebook.com>

2018-04-12 17:28 UTC-0700 ~ Alexei Starovoitov
<alexei.starovoitov@gmail.com>
> On Tue, Apr 10, 2018 at 03:41:53PM +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, all
>> written by Daniel:
>>
>> - bpf_get_prandom_u32()
>> - bpf_get_smp_processor_id()
>> - bpf_get_cgroup_classid()
>> - bpf_get_route_realm()
>> - bpf_skb_load_bytes()
>> - bpf_csum_diff()
>> - bpf_skb_get_tunnel_opt()
>> - bpf_skb_set_tunnel_opt()
>> - bpf_skb_change_proto()
>> - bpf_skb_change_type()
>>
>> Cc: Daniel Borkmann <daniel@iogearbox.net>
>> Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
>> ---
>>  include/uapi/linux/bpf.h | 125 +++++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 125 insertions(+)
>>
>> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
>> index f3ea8824efbc..d147d9dd6a83 100644
>> --- a/include/uapi/linux/bpf.h
>> +++ b/include/uapi/linux/bpf.h

[...]

>> @@ -604,6 +612,13 @@ union bpf_attr {
>>   * 	Return
>>   * 		0 on success, or a negative error in case of failure.
>>   *
>> + * u32 bpf_get_cgroup_classid(struct sk_buff *skb)
>> + * 	Description
>> + * 		Retrieve the classid for the current task, i.e. for the
>> + * 		net_cls (network classifier) cgroup to which *skb* belongs.
> 
> please add that kernel should be configured with CONFIG_NET_CLS_CGROUP=y|m
> and mention Documentation/cgroup-v1/net_cls.txt

Ok.

> Otherwise 'network classifier' is way too generic.

I am not so familiar with cgroups. What would you suggest instead?

> I'd also mention that placing a task into net_cls controller
> disables all of cgroup-bpf.

Could you please explain a bit more? Placing a task into the controller
is using:

	echo <task_pid>  >  /sys/fs/cgroup/<my_cgroup_name>/tasks

correct? Then if I do this, it disables all of cgroup-bpf. Does this
mean that I loose the possibility to use or add BPF programs to all
cgroup-related attach points for this cgroup? I think I missed something
here.

>> + * 	Return
>> + * 		The classid, or 0 for the default unconfigured classid.
>> + *
>>   * int bpf_skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci)
>>   * 	Description
>>   * 		Push a *vlan_tci* (VLAN tag control information) of protocol

I have no particular comments on the other items you reported on this
patch, I will fix them. Thanks!

Quentin
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2018-04-13 18:18 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-10 14:41 [RFC bpf-next v2 0/8] bpf: document eBPF helpers and add a script to generate man page Quentin Monnet
2018-04-10 14:41 ` Quentin Monnet
2018-04-10 14:41 ` [RFC bpf-next v2 1/8] bpf: add script and prepare bpf.h for new helpers documentation Quentin Monnet
2018-04-10 14:41   ` Quentin Monnet
2018-04-10 18:16   ` Alexei Starovoitov
2018-04-10 18:16     ` Alexei Starovoitov
2018-04-11 15:41     ` Quentin Monnet
2018-04-11 15:41       ` Quentin Monnet
2018-04-10 14:41 ` [RFC bpf-next v2 2/8] bpf: add documentation for eBPF helpers (01-11) Quentin Monnet
2018-04-10 14:41   ` Quentin Monnet
2018-04-10 17:56   ` Alexei Starovoitov
2018-04-10 17:56     ` Alexei Starovoitov
2018-04-11 15:42     ` Quentin Monnet
2018-04-11 15:42       ` Quentin Monnet
2018-04-10 14:41 ` [RFC bpf-next v2 3/8] bpf: add documentation for eBPF helpers (12-22) Quentin Monnet
2018-04-10 14:41   ` Quentin Monnet
2018-04-10 22:43   ` Alexei Starovoitov
2018-04-10 22:43     ` Alexei Starovoitov
2018-04-11 15:43     ` Quentin Monnet
2018-04-11 15:43       ` Quentin Monnet
2018-04-10 14:41 ` [RFC bpf-next v2 4/8] bpf: add documentation for eBPF helpers (23-32) Quentin Monnet
2018-04-10 14:41   ` Quentin Monnet
2018-04-13  0:28   ` Alexei Starovoitov
2018-04-13  0:28     ` Alexei Starovoitov
2018-04-13 18:18     ` Quentin Monnet [this message]
2018-04-13 18:18       ` Quentin Monnet
2018-04-10 14:41 ` [RFC bpf-next v2 5/8] bpf: add documentation for eBPF helpers (33-41) Quentin Monnet
2018-04-10 14:41   ` Quentin Monnet
2018-04-10 14:41 ` [RFC bpf-next v2 6/8] bpf: add documentation for eBPF helpers (42-50) Quentin Monnet
2018-04-10 14:41   ` Quentin Monnet
2018-04-10 14:41 ` [RFC bpf-next v2 7/8] bpf: add documentation for eBPF helpers (51-57) Quentin Monnet
2018-04-10 14:41   ` Quentin Monnet
2018-04-10 16:58   ` Yonghong Song
2018-04-10 16:58     ` Yonghong Song
2018-04-11 15:44     ` Quentin Monnet
2018-04-11 15:44       ` Quentin Monnet
2018-04-11 18:01       ` Quentin Monnet
2018-04-11 18:01         ` Quentin Monnet
2018-04-10 17:50   ` Andrey Ignatov
2018-04-10 17:50     ` Andrey Ignatov
2018-04-11 15:45     ` Quentin Monnet
2018-04-11 15:45       ` Quentin Monnet
2018-04-10 14:41 ` [RFC bpf-next v2 8/8] bpf: add documentation for eBPF helpers (58-64) Quentin Monnet
2018-04-10 14:41   ` Quentin Monnet
2018-04-11 10:17   ` Jesper Dangaard Brouer
2018-04-11 10:17     ` Jesper Dangaard Brouer
2018-04-11 15:45     ` Quentin Monnet
2018-04-11 15:45       ` Quentin Monnet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=866e9593-0247-87e6-35d8-6fde1f8e382b@netronome.com \
    --to=quentin.monnet@netronome.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.