@@ -109,9 +109,9 @@ The encoding of the 'opcode' field varies and can be determined from
109
109
the three least significant bits (LSB) of the 'opcode' field which holds
110
110
the "instruction class", as follows:
111
111
112
- ========= ===== =============================== =================
112
+ ========= ===== =============================== ===================================
113
113
class value description reference
114
- ========= ===== =============================== =================
114
+ ========= ===== =============================== ===================================
115
115
BPF_LD 0x00 non-standard load operations `Load and store instructions `_
116
116
BPF_LDX 0x01 load into register operations `Load and store instructions `_
117
117
BPF_ST 0x02 store from immediate operations `Load and store instructions `_
@@ -120,7 +120,7 @@ BPF_ALU 0x04 32-bit arithmetic operations `Arithmetic and jump instruct
120
120
BPF_JMP 0x05 64-bit jump operations `Arithmetic and jump instructions `_
121
121
BPF_JMP32 0x06 32-bit jump operations `Arithmetic and jump instructions `_
122
122
BPF_ALU64 0x07 64-bit arithmetic operations `Arithmetic and jump instructions `_
123
- ========= ===== =============================== =================
123
+ ========= ===== =============================== ===================================
124
124
125
125
Arithmetic and jump instructions
126
126
================================
@@ -140,12 +140,12 @@ code
140
140
source
141
141
the source operand location, which unless otherwise specified is one of:
142
142
143
- ====== ===== ========================================
143
+ ====== ===== ==========================================
144
144
source value description
145
- ====== ===== ========================================
145
+ ====== ===== ==========================================
146
146
BPF_K 0x00 use 32-bit 'imm' value as source operand
147
147
BPF_X 0x08 use 'src' register value as source operand
148
- ====== ===== ========================================
148
+ ====== ===== ==========================================
149
149
150
150
instruction class
151
151
the instruction class (see `Instruction classes `_)
@@ -159,9 +159,9 @@ otherwise identical operations.
159
159
160
160
The 4-bit 'code' field encodes the operation as follows:
161
161
162
- ======== ===== =================================================
162
+ ======== ===== ==========================================================
163
163
code value description
164
- ======== ===== =================================================
164
+ ======== ===== ==========================================================
165
165
BPF_ADD 0x00 dst += src
166
166
BPF_SUB 0x10 dst -= src
167
167
BPF_MUL 0x20 dst \* = src
@@ -176,7 +176,7 @@ BPF_XOR 0xa0 dst ^= src
176
176
BPF_MOV 0xb0 dst = src
177
177
BPF_ARSH 0xc0 sign extending shift right
178
178
BPF_END 0xd0 byte swap operations (see `Byte swap instructions `_ below)
179
- ======== ===== =================================================
179
+ ======== ===== ==========================================================
180
180
181
181
where 'src' is the source operand value.
182
182
@@ -268,22 +268,22 @@ The 4-bit 'code' field encodes the operation as below, where PC is the program c
268
268
======== ===== === ========================== ========================
269
269
code value src description notes
270
270
======== ===== === ========================== ========================
271
- BPF_JA 0x00 0x0 PC += offset BPF_JMP only
272
- BPF_JEQ 0x10 any PC += offset if dst == src
273
- BPF_JGT 0x20 any PC += offset if dst > src unsigned
274
- BPF_JGE 0x30 any PC += offset if dst >= src unsigned
275
- BPF_JSET 0x40 any PC += offset if dst & src
276
- BPF_JNE 0x50 any PC += offset if dst != src
277
- BPF_JSGT 0x60 any PC += offset if dst > src signed
278
- BPF_JSGE 0x70 any PC += offset if dst >= src signed
279
- BPF_CALL 0x80 0x0 call helper function imm see `Helper functions `_
280
- BPF_CALL 0x80 0x1 call PC += offset see `eBPF functions `_
281
- BPF_CALL 0x80 0x2 call runtime function imm see `Runtime functions `_
282
- BPF_EXIT 0x95 0x0 return BPF_JMP only
283
- BPF_JLT 0xa0 any PC += offset if dst < src unsigned
284
- BPF_JLE 0xb0 any PC += offset if dst <= src unsigned
285
- BPF_JSLT 0xc0 any PC += offset if dst < src signed
286
- BPF_JSLE 0xd0 any PC += offset if dst <= src signed
271
+ BPF_JA 0x0 0x0 PC += offset BPF_JMP only
272
+ BPF_JEQ 0x1 any PC += offset if dst == src
273
+ BPF_JGT 0x2 any PC += offset if dst > src unsigned
274
+ BPF_JGE 0x3 any PC += offset if dst >= src unsigned
275
+ BPF_JSET 0x4 any PC += offset if dst & src
276
+ BPF_JNE 0x5 any PC += offset if dst != src
277
+ BPF_JSGT 0x6 any PC += offset if dst > src signed
278
+ BPF_JSGE 0x7 any PC += offset if dst >= src signed
279
+ BPF_CALL 0x8 0x0 call helper function imm see `Helper functions `_
280
+ BPF_CALL 0x8 0x1 call PC += offset see `eBPF functions `_
281
+ BPF_CALL 0x8 0x2 call runtime function imm see `Runtime functions `_
282
+ BPF_EXIT 0x9 0x0 return BPF_JMP only
283
+ BPF_JLT 0xa any PC += offset if dst < src unsigned
284
+ BPF_JLE 0xb any PC += offset if dst <= src unsigned
285
+ BPF_JSLT 0xc any PC += offset if dst < src signed
286
+ BPF_JSLE 0xd any PC += offset if dst <= src signed
287
287
======== ===== === ========================== ========================
288
288
289
289
Helper functions
@@ -401,7 +401,7 @@ The 'imm' field is used to encode the actual atomic operation.
401
401
Simple atomic operation use a subset of the values defined to encode
402
402
arithmetic operations in the 'imm' field to encode the atomic operation:
403
403
404
- ======== ===== ===========
404
+ ======== ===== ===========
405
405
imm value description
406
406
======== ===== ===========
407
407
BPF_ADD 0x00 atomic add
0 commit comments