aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Leoshkevich <[email protected]>2021-02-10 15:28:52 +0100
committerAlexei Starovoitov <[email protected]>2021-02-11 22:01:13 -0800
commit6a5df969ff80c1589ba9fd9136b77a4fb93371d0 (patch)
tree8ac323eeaf198fc99730c65495799149aa85e880
parent1336c662474edec3966c96c8de026f794d16b804 (diff)
docs: bpf: Clarify BPF_CMPXCHG wording
Based on [1], BPF_CMPXCHG should always load the old value into R0. The phrasing in bpf.rst is somewhat ambiguous in this regard, improve it to make this aspect crystal clear. [1] https://lore.kernel.org/bpf/CAADnVQJFcFwxEz=wnV=hkie-EDwa8s5JGbBQeFt1TGux1OihJw@mail.gmail.com/ Signed-off-by: Ilya Leoshkevich <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
-rw-r--r--Documentation/networking/filter.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/Documentation/networking/filter.rst b/Documentation/networking/filter.rst
index b3f457802836..251c6bd73d15 100644
--- a/Documentation/networking/filter.rst
+++ b/Documentation/networking/filter.rst
@@ -1076,8 +1076,8 @@ off``. ::
BPF_CMPXCHG
This atomically compares the value addressed by ``dst_reg + off`` with
-``R0``. If they match it is replaced with ``src_reg``, The value that was there
-before is loaded back to ``R0``.
+``R0``. If they match it is replaced with ``src_reg``. In either case, the
+value that was there before is zero-extended and loaded back to ``R0``.
Note that 1 and 2 byte atomic operations are not supported.