331
331
BPF_ABS 0x20 legacy BPF packet access (absolute) `Legacy BPF Packet access instructions `_
332
332
BPF_IND 0x40 legacy BPF packet access (indirect) `Legacy BPF Packet access instructions `_
333
333
BPF_MEM 0x60 regular load and store operations `Regular load and store operations `_
334
- BPF_ATOMIC 0xc0 atomic operations `Atomic operations `
334
+ BPF_ATOMIC 0xc0 atomic operations `Atomic operations `_
335
335
============= ===== ==================================== =============
336
336
337
337
size
@@ -392,10 +392,10 @@ arithmetic operations in the 'imm' field to encode the atomic operation:
392
392
======== ===== =========== =======
393
393
imm value description version
394
394
======== ===== =========== =======
395
- BPF_ADD 0x00 atomic add v1
396
- BPF_OR 0x40 atomic or v3
397
- BPF_AND 0x50 atomic and v3
398
- BPF_XOR 0xa0 atomic xor v3
395
+ BPF_ADD 0x00 atomic add 1
396
+ BPF_OR 0x40 atomic or 3
397
+ BPF_AND 0x50 atomic and 3
398
+ BPF_XOR 0xa0 atomic xor 3
399
399
======== ===== =========== =======
400
400
401
401
where 'version' indicates the first ISA version in which the value was supported.
@@ -408,17 +408,18 @@ where 'version' indicates the first ISA version in which the value was supported
408
408
409
409
*(uint64_t *)(dst + offset) += src
410
410
411
- *Linux implementation note *: ``BPF_XADD `` is a deprecated name for ``BPF_ATOMIC | BPF_ADD ``.
411
+ ``BPF_XADD `` appeared in version 1, but is now considered to be a deprecated alias
412
+ for ``BPF_ATOMIC | BPF_ADD ``.
412
413
413
414
In addition to the simple atomic operations above, there also is a modifier and
414
415
two complex atomic operations:
415
416
416
417
=========== ================ =========================== =======
417
418
imm value description version
418
419
=========== ================ =========================== =======
419
- BPF_FETCH 0x01 modifier: return old value v3
420
- BPF_XCHG 0xe0 | BPF_FETCH atomic exchange v3
421
- BPF_CMPXCHG 0xf0 | BPF_FETCH atomic compare and exchange v3
420
+ BPF_FETCH 0x01 modifier: return old value 3
421
+ BPF_XCHG 0xe0 | BPF_FETCH atomic exchange 3
422
+ BPF_CMPXCHG 0xf0 | BPF_FETCH atomic compare and exchange 3
422
423
=========== ================ =========================== =======
423
424
424
425
The ``BPF_FETCH `` modifier is optional for simple atomic operations, and
0 commit comments