[PATCH] docs:CodeGenerator:eBPF: Correct wrong values for BPF_X and BPF_K

Wang YanQing via llvm-commits llvm-commits at lists.llvm.org
Wed May 9 00:58:11 PDT 2018


According to Documentation/networking/filter.txt in linux kernel
source:
"
When BPF_CLASS(code) == BPF_ALU or BPF_JMP, 4th bit encodes source operand ...

  BPF_K     0x00
  BPF_X     0x08
"

The right value for BPF_X is 0x1, and the right value for BPF_K is 0x0.

Signed-off-by: Wang YanQing <udknight at gmail.com>
---
 docs/CodeGenerator.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/CodeGenerator.rst b/docs/CodeGenerator.rst
index a9e5070..71351bb 100644
--- a/docs/CodeGenerator.rst
+++ b/docs/CodeGenerator.rst
@@ -2513,8 +2513,8 @@ When BPF_CLASS(code) == BPF_ALU or BPF_ALU64 or BPF_JMP,
 
 ::
 
-  BPF_X     0x0  use src_reg register as source operand
-  BPF_K     0x1  use 32 bit immediate as source operand
+  BPF_X     0x1  use src_reg register as source operand
+  BPF_K     0x0  use 32 bit immediate as source operand
 
 and four MSB bits store operation code
 
-- 
1.8.5.6.2.g3d8a54e.dirty


More information about the llvm-commits mailing list