* [PATCH bpf-next v1] bpf: fix bpf_skb_pull_data documentation
@ 2022-07-14 22:47 Joanne Koong
2022-07-14 23:14 ` Joanne Koong
2022-07-15 13:43 ` Daniel Borkmann
0 siblings, 2 replies; 6+ messages in thread
From: Joanne Koong @ 2022-07-14 22:47 UTC (permalink / raw)
To: bpf; +Cc: daniel, quentin, andrii, ast, Joanne Koong
Fix documentation for bpf_skb_pull_data() helper for
when flags == 0.
Fixes: fa15601ab31e ("bpf: add documentation for eBPF helpers (33-41)")
Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
---
include/uapi/linux/bpf.h | 3 ++-
tools/include/uapi/linux/bpf.h | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 379e68fb866f..a80c1f6bbe25 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -2361,7 +2361,8 @@ union bpf_attr {
* Pull in non-linear data in case the *skb* is non-linear and not
* all of *len* are part of the linear section. Make *len* bytes
* from *skb* readable and writable. If a zero value is passed for
- * *len*, then the whole length of the *skb* is pulled.
+ * *len*, then all bytes in the head of the skb will be made readable
+ * and writable.
*
* This helper is only needed for reading and writing with direct
* packet access.
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index 379e68fb866f..a80c1f6bbe25 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -2361,7 +2361,8 @@ union bpf_attr {
* Pull in non-linear data in case the *skb* is non-linear and not
* all of *len* are part of the linear section. Make *len* bytes
* from *skb* readable and writable. If a zero value is passed for
- * *len*, then the whole length of the *skb* is pulled.
+ * *len*, then all bytes in the head of the skb will be made readable
+ * and writable.
*
* This helper is only needed for reading and writing with direct
* packet access.
--
2.30.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH bpf-next v1] bpf: fix bpf_skb_pull_data documentation
2022-07-14 22:47 [PATCH bpf-next v1] bpf: fix bpf_skb_pull_data documentation Joanne Koong
@ 2022-07-14 23:14 ` Joanne Koong
2022-07-15 8:51 ` Quentin Monnet
2022-07-15 13:43 ` Daniel Borkmann
1 sibling, 1 reply; 6+ messages in thread
From: Joanne Koong @ 2022-07-14 23:14 UTC (permalink / raw)
To: bpf; +Cc: Daniel Borkmann, quentin, Andrii Nakryiko, Alexei Starovoitov
On Thu, Jul 14, 2022 at 3:48 PM Joanne Koong <joannelkoong@gmail.com> wrote:
>
> Fix documentation for bpf_skb_pull_data() helper for
> when flags == 0.
sorry, this commit message should be "when len == 0" (not flags).
>
> Fixes: fa15601ab31e ("bpf: add documentation for eBPF helpers (33-41)")
> Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
> ---
> include/uapi/linux/bpf.h | 3 ++-
> tools/include/uapi/linux/bpf.h | 3 ++-
> 2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
> index 379e68fb866f..a80c1f6bbe25 100644
> --- a/include/uapi/linux/bpf.h
> +++ b/include/uapi/linux/bpf.h
> @@ -2361,7 +2361,8 @@ union bpf_attr {
> * Pull in non-linear data in case the *skb* is non-linear and not
> * all of *len* are part of the linear section. Make *len* bytes
> * from *skb* readable and writable. If a zero value is passed for
> - * *len*, then the whole length of the *skb* is pulled.
> + * *len*, then all bytes in the head of the skb will be made readable
> + * and writable.
> *
> * This helper is only needed for reading and writing with direct
> * packet access.
> diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
> index 379e68fb866f..a80c1f6bbe25 100644
> --- a/tools/include/uapi/linux/bpf.h
> +++ b/tools/include/uapi/linux/bpf.h
> @@ -2361,7 +2361,8 @@ union bpf_attr {
> * Pull in non-linear data in case the *skb* is non-linear and not
> * all of *len* are part of the linear section. Make *len* bytes
> * from *skb* readable and writable. If a zero value is passed for
> - * *len*, then the whole length of the *skb* is pulled.
> + * *len*, then all bytes in the head of the skb will be made readable
> + * and writable.
> *
> * This helper is only needed for reading and writing with direct
> * packet access.
> --
> 2.30.2
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH bpf-next v1] bpf: fix bpf_skb_pull_data documentation
2022-07-14 23:14 ` Joanne Koong
@ 2022-07-15 8:51 ` Quentin Monnet
0 siblings, 0 replies; 6+ messages in thread
From: Quentin Monnet @ 2022-07-15 8:51 UTC (permalink / raw)
To: Joanne Koong, bpf
Cc: Daniel Borkmann, Andrii Nakryiko, Alexei Starovoitov,
Rumen Telbizov
On 15/07/2022 00:14, Joanne Koong wrote:
> On Thu, Jul 14, 2022 at 3:48 PM Joanne Koong <joannelkoong@gmail.com> wrote:
>>
>> Fix documentation for bpf_skb_pull_data() helper for
>> when flags == 0.
> sorry, this commit message should be "when len == 0" (not flags).
>>
>> Fixes: fa15601ab31e ("bpf: add documentation for eBPF helpers (33-41)")
>> Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Yes, Rumen reported this to me some time ago but I never took the time
to send a fix. Thanks a lot!
Acked-by: Quentin Monnet <quentin@isovalent.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH bpf-next v1] bpf: fix bpf_skb_pull_data documentation
2022-07-14 22:47 [PATCH bpf-next v1] bpf: fix bpf_skb_pull_data documentation Joanne Koong
2022-07-14 23:14 ` Joanne Koong
@ 2022-07-15 13:43 ` Daniel Borkmann
2022-07-15 13:50 ` Quentin Monnet
1 sibling, 1 reply; 6+ messages in thread
From: Daniel Borkmann @ 2022-07-15 13:43 UTC (permalink / raw)
To: Joanne Koong, bpf; +Cc: quentin, andrii, ast
On 7/15/22 12:47 AM, Joanne Koong wrote:
> Fix documentation for bpf_skb_pull_data() helper for
> when flags == 0.
>
> Fixes: fa15601ab31e ("bpf: add documentation for eBPF helpers (33-41)")
> Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
> ---
> include/uapi/linux/bpf.h | 3 ++-
> tools/include/uapi/linux/bpf.h | 3 ++-
> 2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
> index 379e68fb866f..a80c1f6bbe25 100644
> --- a/include/uapi/linux/bpf.h
> +++ b/include/uapi/linux/bpf.h
> @@ -2361,7 +2361,8 @@ union bpf_attr {
> * Pull in non-linear data in case the *skb* is non-linear and not
> * all of *len* are part of the linear section. Make *len* bytes
> * from *skb* readable and writable. If a zero value is passed for
> - * *len*, then the whole length of the *skb* is pulled.
> + * *len*, then all bytes in the head of the skb will be made readable
Quentin, should the formatting be '*skb*' instead of 'skb'?
Maybe it's more clear if we speak of 'all bytes in the linear part' instead of 'all
bytes in the head' of the skb to make it clearer? Either is ok with me though.
Thanks,
Daniel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH bpf-next v1] bpf: fix bpf_skb_pull_data documentation
2022-07-15 13:43 ` Daniel Borkmann
@ 2022-07-15 13:50 ` Quentin Monnet
2022-07-15 17:44 ` Joanne Koong
0 siblings, 1 reply; 6+ messages in thread
From: Quentin Monnet @ 2022-07-15 13:50 UTC (permalink / raw)
To: Daniel Borkmann, Joanne Koong, bpf; +Cc: andrii, ast
On 15/07/2022 14:43, Daniel Borkmann wrote:
> On 7/15/22 12:47 AM, Joanne Koong wrote:
>> Fix documentation for bpf_skb_pull_data() helper for
>> when flags == 0.
>>
>> Fixes: fa15601ab31e ("bpf: add documentation for eBPF helpers (33-41)")
>> Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
>> ---
>> include/uapi/linux/bpf.h | 3 ++-
>> tools/include/uapi/linux/bpf.h | 3 ++-
>> 2 files changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
>> index 379e68fb866f..a80c1f6bbe25 100644
>> --- a/include/uapi/linux/bpf.h
>> +++ b/include/uapi/linux/bpf.h
>> @@ -2361,7 +2361,8 @@ union bpf_attr {
>> * Pull in non-linear data in case the *skb* is non-linear
>> and not
>> * all of *len* are part of the linear section. Make *len*
>> bytes
>> * from *skb* readable and writable. If a zero value is
>> passed for
>> - * *len*, then the whole length of the *skb* is pulled.
>> + * *len*, then all bytes in the head of the skb will be made
>> readable
>
> Quentin, should the formatting be '*skb*' instead of 'skb'?
Correct
> Maybe it's more clear if we speak of 'all bytes in the linear part'
> instead of 'all
> bytes in the head' of the skb to make it clearer? Either is ok with me
> though.
Good suggestion, “linear part” is maybe easier to understand given that
the paragraph has no other mention the “head”.
Would it be worth, even, linking to e.g. Dave's doc
(http://vger.kernel.org/~davem/skb.html) here, to provide more details?
People reading the header file may not need that, but folks reading the
generated man page may not be aware of what a skb contains.
Quentin
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH bpf-next v1] bpf: fix bpf_skb_pull_data documentation
2022-07-15 13:50 ` Quentin Monnet
@ 2022-07-15 17:44 ` Joanne Koong
0 siblings, 0 replies; 6+ messages in thread
From: Joanne Koong @ 2022-07-15 17:44 UTC (permalink / raw)
To: Quentin Monnet; +Cc: Daniel Borkmann, bpf, Andrii Nakryiko, Alexei Starovoitov
On Fri, Jul 15, 2022 at 6:50 AM Quentin Monnet <quentin@isovalent.com> wrote:
>
> On 15/07/2022 14:43, Daniel Borkmann wrote:
> > On 7/15/22 12:47 AM, Joanne Koong wrote:
> >> Fix documentation for bpf_skb_pull_data() helper for
> >> when flags == 0.
> >>
> >> Fixes: fa15601ab31e ("bpf: add documentation for eBPF helpers (33-41)")
> >> Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
> >> ---
> >> include/uapi/linux/bpf.h | 3 ++-
> >> tools/include/uapi/linux/bpf.h | 3 ++-
> >> 2 files changed, 4 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
> >> index 379e68fb866f..a80c1f6bbe25 100644
> >> --- a/include/uapi/linux/bpf.h
> >> +++ b/include/uapi/linux/bpf.h
> >> @@ -2361,7 +2361,8 @@ union bpf_attr {
> >> * Pull in non-linear data in case the *skb* is non-linear
> >> and not
> >> * all of *len* are part of the linear section. Make *len*
> >> bytes
> >> * from *skb* readable and writable. If a zero value is
> >> passed for
> >> - * *len*, then the whole length of the *skb* is pulled.
> >> + * *len*, then all bytes in the head of the skb will be made
> >> readable
> >
> > Quentin, should the formatting be '*skb*' instead of 'skb'?
>
> Correct
>
> > Maybe it's more clear if we speak of 'all bytes in the linear part'
> > instead of 'all
> > bytes in the head' of the skb to make it clearer? Either is ok with me
> > though.
>
> Good suggestion, “linear part” is maybe easier to understand given that
> the paragraph has no other mention the “head”.
>
Great, I'll send out v2 with these edits:
* changing skb -> *skb*
* changing "all bytes in the head" -> "all bytes in the linear part"
> Would it be worth, even, linking to e.g. Dave's doc
> (http://vger.kernel.org/~davem/skb.html) here, to provide more details?
> People reading the header file may not need that, but folks reading the
> generated man page may not be aware of what a skb contains.
In my personal opinion, I think people who are writing programs that
are using skbs will already have read that page and/or know the
internals of skbs. But I'm also happy to add that link in if you think
it'd provide more context.
>
> Quentin
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-07-15 17:44 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-14 22:47 [PATCH bpf-next v1] bpf: fix bpf_skb_pull_data documentation Joanne Koong
2022-07-14 23:14 ` Joanne Koong
2022-07-15 8:51 ` Quentin Monnet
2022-07-15 13:43 ` Daniel Borkmann
2022-07-15 13:50 ` Quentin Monnet
2022-07-15 17:44 ` Joanne Koong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox