aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrendan Jackman <jackmanb@google.com>2021-01-20 13:39:46 +0000
committerAlexei Starovoitov <ast@kernel.org>2021-01-20 17:03:21 -0800
commitb452ee005a9135ed89fc8c9dff14e042770eb4f1 (patch)
tree4cea1a22cf1ea9c9b6ffc275e5a0d74e6d2722ca
parentdocs: bpf: Fixup atomics markup (diff)
downloadlinux-dev-b452ee005a9135ed89fc8c9dff14e042770eb4f1.tar.xz
linux-dev-b452ee005a9135ed89fc8c9dff14e042770eb4f1.zip
docs: bpf: Clarify -mcpu=v3 requirement for atomic ops
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/ Signed-off-by: Brendan Jackman <jackmanb@google.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20210120133946.2107897-3-jackmanb@google.com
-rw-r--r--Documentation/networking/filter.rst7
1 files 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``,