From: Dave Thaler Date: Tue, 27 Jun 2023 21:39:12 +0000 (+0000) Subject: bpf, docs: Fix definition of BPF_NEG operation X-Git-Tag: v6.6-rc1~162^2~405^2~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=85b0c6d4905ec21cd22cb18da701aa02278ccc4c;p=thirdparty%2Fkernel%2Flinux.git bpf, docs: Fix definition of BPF_NEG operation Instruction is an arithmetic negative, not a bitwise inverse. Signed-off-by: Dave Thaler Signed-off-by: Daniel Borkmann Acked-by: David Vernet Link: https://lore.kernel.org/bpf/20230627213912.951-1-dthaler1968@googlemail.com --- diff --git a/Documentation/bpf/instruction-set.rst b/Documentation/bpf/instruction-set.rst index 6644842cd3ea1..751e657973f0b 100644 --- a/Documentation/bpf/instruction-set.rst +++ b/Documentation/bpf/instruction-set.rst @@ -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