Skip to content

Commit

Permalink
bpf, docs: Fix definition of BPF_NEG operation
Browse files Browse the repository at this point in the history
Instruction is an arithmetic negative, not a bitwise inverse.

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: David Vernet <void@manifault.com>
Link: https://lore.kernel.org/bpf/20230627213912.951-1-dthaler1968@googlemail.com
  • Loading branch information
dthaler authored and borkmann committed Jun 29, 2023
1 parent bbaf1ff commit 85b0c6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Documentation/bpf/instruction-set.rst
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ BPF_OR 0x40 dst \|= src
BPF_AND 0x50 dst &= src
BPF_LSH 0x60 dst <<= (src & mask)
BPF_RSH 0x70 dst >>= (src & mask)
BPF_NEG 0x80 dst = ~src
BPF_NEG 0x80 dst = -src
BPF_MOD 0x90 dst = (src != 0) ? (dst % src) : dst
BPF_XOR 0xa0 dst ^= src
BPF_MOV 0xb0 dst = src
Expand Down

0 comments on commit 85b0c6d

Please sign in to comment.