All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next v3 0/2] BPF docs fixups
@ 2021-01-20 13:39 Brendan Jackman
  2021-01-20 13:39 ` [PATCH bpf-next v3 1/2] docs: bpf: Fixup atomics markup Brendan Jackman
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Brendan Jackman @ 2021-01-20 13:39 UTC (permalink / raw)
  To: bpf
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, KP Singh,
	Florent Revest, Lukas Bulwahn, linux-kernel, linux-doc,
	Jonathan Corbet, Brendan Jackman

Difference from v2->v3 [1]:

 * Just fixed a commite message, rebased, and added Lukas' review tag - thanks
   Lukas!

Difference from v1->v2 [1]:

 * Split into 2 patches

 * Avoided unnecessary ': ::' in .rst source

 * Tweaked wording of the -mcpu=v3 bit a little more

[1] Previous versions:
    v1: https://lore.kernel.org/bpf/CA+i-1C1LVKjfQLBYk6siiqhxfy0jCR7UBcAmJ4jCED0A9aWsxA@mail.gmail.com/T/#t
    v2: https://lore.kernel.org/bpf/20210118155735.532663-1-jackmanb@google.com/T/#t

Brendan Jackman (2):
  docs: bpf: Fixup atomics markup
  docs: bpf: Clarify -mcpu=v3 requirement for atomic ops

 Documentation/networking/filter.rst | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)


base-commit: 8edc0c67d09d6bf441eeb39ae9316fe07478093f
--
2.30.0.284.gd98b1dd5eaa7-goog


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH bpf-next v3 1/2] docs: bpf: Fixup atomics markup
  2021-01-20 13:39 [PATCH bpf-next v3 0/2] BPF docs fixups Brendan Jackman
@ 2021-01-20 13:39 ` Brendan Jackman
  2021-01-20 13:39 ` [PATCH bpf-next v3 2/2] docs: bpf: Clarify -mcpu=v3 requirement for atomic ops Brendan Jackman
  2021-01-21 18:53 ` [PATCH bpf-next v3 0/2] BPF docs fixups Jonathan Corbet
  2 siblings, 0 replies; 7+ messages in thread
From: Brendan Jackman @ 2021-01-20 13:39 UTC (permalink / raw)
  To: bpf
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, KP Singh,
	Florent Revest, Lukas Bulwahn, linux-kernel, linux-doc,
	Jonathan Corbet, Brendan Jackman

This fixes up the markup to fix a warning, be more consistent with
use of monospace, and use the correct .rst syntax for <em> (* instead
of _).

Signed-off-by: Brendan Jackman <jackmanb@google.com>
Reviewed-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>

---
 Documentation/networking/filter.rst | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/Documentation/networking/filter.rst b/Documentation/networking/filter.rst
index 45f6fde1776c..4c2bb4c6364d 100644
--- a/Documentation/networking/filter.rst
+++ b/Documentation/networking/filter.rst
@@ -1066,12 +1066,12 @@ memory location addresed by ``dst_reg + off`` is atomically modified, with
 immediate, then these operations also overwrite ``src_reg`` with the
 value that was in memory before it was modified.

-The more special operations are:
+The more special operations are::

     BPF_XCHG

 This atomically exchanges ``src_reg`` with the value addressed by ``dst_reg +
-off``.
+off``. ::

     BPF_CMPXCHG

@@ -1081,18 +1081,19 @@ before is loaded back to ``R0``.

 Note that 1 and 2 byte atomic operations are not supported.

-Except ``BPF_ADD`` _without_ ``BPF_FETCH`` (for legacy reasons), all 4 byte
+Except ``BPF_ADD`` *without* ``BPF_FETCH`` (for legacy reasons), all 4 byte
 atomic operations require alu32 mode. Clang enables this mode by default in
 architecture v3 (``-mcpu=v3``). For older versions it can be enabled with
 ``-Xclang -target-feature -Xclang +alu32``.

-You may encounter BPF_XADD - this is a legacy name for BPF_ATOMIC, referring to
-the exclusive-add operation encoded when the immediate field is zero.
+You may encounter ``BPF_XADD`` - this is a legacy name for ``BPF_ATOMIC``,
+referring to the exclusive-add operation encoded when the immediate field is
+zero.

-eBPF has one 16-byte instruction: BPF_LD | BPF_DW | BPF_IMM which consists
+eBPF has one 16-byte instruction: ``BPF_LD | BPF_DW | BPF_IMM`` which consists
 of two consecutive ``struct bpf_insn`` 8-byte blocks and interpreted as single
 instruction that loads 64-bit immediate value into a dst_reg.
-Classic BPF has similar instruction: BPF_LD | BPF_W | BPF_IMM which loads
+Classic BPF has similar instruction: ``BPF_LD | BPF_W | BPF_IMM`` which loads
 32-bit immediate value into a register.

 eBPF verifier
--
2.30.0.284.gd98b1dd5eaa7-goog


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH bpf-next v3 2/2] docs: bpf: Clarify -mcpu=v3 requirement for atomic ops
  2021-01-20 13:39 [PATCH bpf-next v3 0/2] BPF docs fixups Brendan Jackman
  2021-01-20 13:39 ` [PATCH bpf-next v3 1/2] docs: bpf: Fixup atomics markup Brendan Jackman
@ 2021-01-20 13:39 ` Brendan Jackman
  2021-01-20 19:57   ` Lukas Bulwahn
  2021-01-21 18:53 ` [PATCH bpf-next v3 0/2] BPF docs fixups Jonathan Corbet
  2 siblings, 1 reply; 7+ messages in thread
From: Brendan Jackman @ 2021-01-20 13:39 UTC (permalink / raw)
  To: bpf
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, KP Singh,
	Florent Revest, Lukas Bulwahn, linux-kernel, linux-doc,
	Jonathan Corbet, Brendan Jackman

Alexei pointed out [1] that this wording is pretty confusing. Here's
an attempt to be more explicit and clear.

[1] https://lore.kernel.org/bpf/CAADnVQJVvwoZsE1K+6qRxzF7+6CvZNzygnoBW9tZNWJELk5c=Q@mail.gmail.com/T/#m07264fc18fdc43af02fc1320968afefcc73d96f4

Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
 Documentation/networking/filter.rst | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/Documentation/networking/filter.rst b/Documentation/networking/filter.rst
index 4c2bb4c6364d..b3f457802836 100644
--- a/Documentation/networking/filter.rst
+++ b/Documentation/networking/filter.rst
@@ -1081,9 +1081,10 @@ before is loaded back to ``R0``.
 
 Note that 1 and 2 byte atomic operations are not supported.
 
-Except ``BPF_ADD`` *without* ``BPF_FETCH`` (for legacy reasons), all 4 byte
-atomic operations require alu32 mode. Clang enables this mode by default in
-architecture v3 (``-mcpu=v3``). For older versions it can be enabled with
+Clang can generate atomic instructions by default when ``-mcpu=v3`` is
+enabled. If a lower version for ``-mcpu`` is set, the only atomic instruction
+Clang can generate is ``BPF_ADD`` *without* ``BPF_FETCH``. If you need to enable
+the atomics features, while keeping a lower ``-mcpu`` version, you can use
 ``-Xclang -target-feature -Xclang +alu32``.
 
 You may encounter ``BPF_XADD`` - this is a legacy name for ``BPF_ATOMIC``,
-- 
2.30.0.284.gd98b1dd5eaa7-goog


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH bpf-next v3 2/2] docs: bpf: Clarify -mcpu=v3 requirement for atomic ops
  2021-01-20 13:39 ` [PATCH bpf-next v3 2/2] docs: bpf: Clarify -mcpu=v3 requirement for atomic ops Brendan Jackman
@ 2021-01-20 19:57   ` Lukas Bulwahn
  2021-01-21  1:07     ` Alexei Starovoitov
  0 siblings, 1 reply; 7+ messages in thread
From: Lukas Bulwahn @ 2021-01-20 19:57 UTC (permalink / raw)
  To: Brendan Jackman
  Cc: bpf, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	KP Singh, Florent Revest, Linux Kernel Mailing List,
	open list:DOCUMENTATION, Jonathan Corbet

On Wed, Jan 20, 2021 at 2:39 PM Brendan Jackman <jackmanb@google.com> wrote:
>
> Alexei pointed out [1] that this wording is pretty confusing. Here's
> an attempt to be more explicit and clear.
>
> [1] https://lore.kernel.org/bpf/CAADnVQJVvwoZsE1K+6qRxzF7+6CvZNzygnoBW9tZNWJELk5c=Q@mail.gmail.com/T/#m07264fc18fdc43af02fc1320968afefcc73d96f4
>

It is common practice to use "Link: URL" to refer to other mail
threads; and to use the "permalink":

https://lore.kernel.org/bpf/CAADnVQJVvwoZsE1K+6qRxzF7+6CvZNzygnoBW9tZNWJELk5c=Q@mail.gmail.com/

which is a bit shorter than the link you provided.

If you follow that convention with "Link: URL", checkpatch.pl will not
complain about this long line :)


Lukas

> Signed-off-by: Brendan Jackman <jackmanb@google.com>
> ---
>  Documentation/networking/filter.rst | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/networking/filter.rst b/Documentation/networking/filter.rst
> index 4c2bb4c6364d..b3f457802836 100644
> --- a/Documentation/networking/filter.rst
> +++ b/Documentation/networking/filter.rst
> @@ -1081,9 +1081,10 @@ before is loaded back to ``R0``.
>
>  Note that 1 and 2 byte atomic operations are not supported.
>
> -Except ``BPF_ADD`` *without* ``BPF_FETCH`` (for legacy reasons), all 4 byte
> -atomic operations require alu32 mode. Clang enables this mode by default in
> -architecture v3 (``-mcpu=v3``). For older versions it can be enabled with
> +Clang can generate atomic instructions by default when ``-mcpu=v3`` is
> +enabled. If a lower version for ``-mcpu`` is set, the only atomic instruction
> +Clang can generate is ``BPF_ADD`` *without* ``BPF_FETCH``. If you need to enable
> +the atomics features, while keeping a lower ``-mcpu`` version, you can use
>  ``-Xclang -target-feature -Xclang +alu32``.
>
>  You may encounter ``BPF_XADD`` - this is a legacy name for ``BPF_ATOMIC``,
> --
> 2.30.0.284.gd98b1dd5eaa7-goog
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH bpf-next v3 2/2] docs: bpf: Clarify -mcpu=v3 requirement for atomic ops
  2021-01-20 19:57   ` Lukas Bulwahn
@ 2021-01-21  1:07     ` Alexei Starovoitov
  0 siblings, 0 replies; 7+ messages in thread
From: Alexei Starovoitov @ 2021-01-21  1:07 UTC (permalink / raw)
  To: Lukas Bulwahn
  Cc: Brendan Jackman, bpf, Alexei Starovoitov, Daniel Borkmann,
	Andrii Nakryiko, KP Singh, Florent Revest,
	Linux Kernel Mailing List, open list:DOCUMENTATION,
	Jonathan Corbet

On Wed, Jan 20, 2021 at 11:57 AM Lukas Bulwahn <lukas.bulwahn@gmail.com> wrote:
>
> On Wed, Jan 20, 2021 at 2:39 PM Brendan Jackman <jackmanb@google.com> wrote:
> >
> > Alexei pointed out [1] that this wording is pretty confusing. Here's
> > an attempt to be more explicit and clear.
> >
> > [1] https://lore.kernel.org/bpf/CAADnVQJVvwoZsE1K+6qRxzF7+6CvZNzygnoBW9tZNWJELk5c=Q@mail.gmail.com/T/#m07264fc18fdc43af02fc1320968afefcc73d96f4
> >
>
> It is common practice to use "Link: URL" to refer to other mail
> threads; and to use the "permalink":
>
> https://lore.kernel.org/bpf/CAADnVQJVvwoZsE1K+6qRxzF7+6CvZNzygnoBW9tZNWJELk5c=Q@mail.gmail.com/
>
> which is a bit shorter than the link you provided.

I fixed it up while applying.
Thanks everyone.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH bpf-next v3 0/2] BPF docs fixups
  2021-01-20 13:39 [PATCH bpf-next v3 0/2] BPF docs fixups Brendan Jackman
  2021-01-20 13:39 ` [PATCH bpf-next v3 1/2] docs: bpf: Fixup atomics markup Brendan Jackman
  2021-01-20 13:39 ` [PATCH bpf-next v3 2/2] docs: bpf: Clarify -mcpu=v3 requirement for atomic ops Brendan Jackman
@ 2021-01-21 18:53 ` Jonathan Corbet
  2021-01-22  1:25   ` Alexei Starovoitov
  2 siblings, 1 reply; 7+ messages in thread
From: Jonathan Corbet @ 2021-01-21 18:53 UTC (permalink / raw)
  To: Brendan Jackman
  Cc: bpf, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	KP Singh, Florent Revest, Lukas Bulwahn, linux-kernel, linux-doc

On Wed, 20 Jan 2021 13:39:44 +0000
Brendan Jackman <jackmanb@google.com> wrote:

> Difference from v2->v3 [1]:
> 
>  * Just fixed a commite message, rebased, and added Lukas' review tag - thanks
>    Lukas!
> 
> Difference from v1->v2 [1]:
> 
>  * Split into 2 patches
> 
>  * Avoided unnecessary ': ::' in .rst source
> 
>  * Tweaked wording of the -mcpu=v3 bit a little more
> 
> [1] Previous versions:
>     v1: https://lore.kernel.org/bpf/CA+i-1C1LVKjfQLBYk6siiqhxfy0jCR7UBcAmJ4jCED0A9aWsxA@mail.gmail.com/T/#t
>     v2: https://lore.kernel.org/bpf/20210118155735.532663-1-jackmanb@google.com/T/#t
> 
> Brendan Jackman (2):
>   docs: bpf: Fixup atomics markup
>   docs: bpf: Clarify -mcpu=v3 requirement for atomic ops
> 
>  Documentation/networking/filter.rst | 20 +++++++++++---------
>  1 file changed, 11 insertions(+), 9 deletions(-)

I'm assuming these will go up through the BPF/networking trees; please let
me know if I should pick them up instead.

Thanks,

jon

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH bpf-next v3 0/2] BPF docs fixups
  2021-01-21 18:53 ` [PATCH bpf-next v3 0/2] BPF docs fixups Jonathan Corbet
@ 2021-01-22  1:25   ` Alexei Starovoitov
  0 siblings, 0 replies; 7+ messages in thread
From: Alexei Starovoitov @ 2021-01-22  1:25 UTC (permalink / raw)
  To: Jonathan Corbet
  Cc: Brendan Jackman, bpf, Alexei Starovoitov, Daniel Borkmann,
	Andrii Nakryiko, KP Singh, Florent Revest, Lukas Bulwahn, LKML,
	open list:DOCUMENTATION

On Thu, Jan 21, 2021 at 10:54 AM Jonathan Corbet <corbet@lwn.net> wrote:
>
> On Wed, 20 Jan 2021 13:39:44 +0000
> Brendan Jackman <jackmanb@google.com> wrote:
>
> > Difference from v2->v3 [1]:
> >
> >  * Just fixed a commite message, rebased, and added Lukas' review tag - thanks
> >    Lukas!
> >
> > Difference from v1->v2 [1]:
> >
> >  * Split into 2 patches
> >
> >  * Avoided unnecessary ': ::' in .rst source
> >
> >  * Tweaked wording of the -mcpu=v3 bit a little more
> >
> > [1] Previous versions:
> >     v1: https://lore.kernel.org/bpf/CA+i-1C1LVKjfQLBYk6siiqhxfy0jCR7UBcAmJ4jCED0A9aWsxA@mail.gmail.com/T/#t
> >     v2: https://lore.kernel.org/bpf/20210118155735.532663-1-jackmanb@google.com/T/#t
> >
> > Brendan Jackman (2):
> >   docs: bpf: Fixup atomics markup
> >   docs: bpf: Clarify -mcpu=v3 requirement for atomic ops
> >
> >  Documentation/networking/filter.rst | 20 +++++++++++---------
> >  1 file changed, 11 insertions(+), 9 deletions(-)
>
> I'm assuming these will go up through the BPF/networking trees; please let
> me know if I should pick them up instead.

I sent an email yesterday indicating that the set was applied to bpf-next.
There is no other tree it can be applied to without conflicts.
Looks like gmail is struggling again.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-01-22  1:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-20 13:39 [PATCH bpf-next v3 0/2] BPF docs fixups Brendan Jackman
2021-01-20 13:39 ` [PATCH bpf-next v3 1/2] docs: bpf: Fixup atomics markup Brendan Jackman
2021-01-20 13:39 ` [PATCH bpf-next v3 2/2] docs: bpf: Clarify -mcpu=v3 requirement for atomic ops Brendan Jackman
2021-01-20 19:57   ` Lukas Bulwahn
2021-01-21  1:07     ` Alexei Starovoitov
2021-01-21 18:53 ` [PATCH bpf-next v3 0/2] BPF docs fixups Jonathan Corbet
2021-01-22  1:25   ` Alexei Starovoitov

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.