All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next] docs: bpf: Clarify BPF_CMPXCHG wording
@ 2021-02-10 14:28 Ilya Leoshkevich
  2021-02-12  6:24 ` Alexei Starovoitov
  0 siblings, 1 reply; 2+ messages in thread
From: Ilya Leoshkevich @ 2021-02-10 14:28 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann
  Cc: bpf, Heiko Carstens, Vasily Gorbik, Brendan Jackman,
	Ilya Leoshkevich

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 <iii@linux.ibm.com>
---
 Documentation/networking/filter.rst | 4 ++--
 1 file 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.
 
-- 
2.29.2


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

end of thread, other threads:[~2021-02-12  6:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-10 14:28 [PATCH bpf-next] docs: bpf: Clarify BPF_CMPXCHG wording Ilya Leoshkevich
2021-02-12  6:24 ` 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.