Lines Matching refs:insn
208 struct bpf_insn *insn = insn_buf; in array_map_gen_lookup() local
217 *insn++ = BPF_ALU64_IMM(BPF_ADD, map_ptr, offsetof(struct bpf_array, value)); in array_map_gen_lookup()
218 *insn++ = BPF_LDX_MEM(BPF_W, ret, index, 0); in array_map_gen_lookup()
220 *insn++ = BPF_JMP_IMM(BPF_JGE, ret, map->max_entries, 4); in array_map_gen_lookup()
221 *insn++ = BPF_ALU32_IMM(BPF_AND, ret, array->index_mask); in array_map_gen_lookup()
223 *insn++ = BPF_JMP_IMM(BPF_JGE, ret, map->max_entries, 3); in array_map_gen_lookup()
227 *insn++ = BPF_ALU64_IMM(BPF_LSH, ret, ilog2(elem_size)); in array_map_gen_lookup()
229 *insn++ = BPF_ALU64_IMM(BPF_MUL, ret, elem_size); in array_map_gen_lookup()
231 *insn++ = BPF_ALU64_REG(BPF_ADD, ret, map_ptr); in array_map_gen_lookup()
232 *insn++ = BPF_JMP_IMM(BPF_JA, 0, 0, 1); in array_map_gen_lookup()
233 *insn++ = BPF_MOV64_IMM(ret, 0); in array_map_gen_lookup()
234 return insn - insn_buf; in array_map_gen_lookup()
1313 struct bpf_insn *insn = insn_buf; in array_of_map_gen_lookup() local
1318 *insn++ = BPF_ALU64_IMM(BPF_ADD, map_ptr, offsetof(struct bpf_array, value)); in array_of_map_gen_lookup()
1319 *insn++ = BPF_LDX_MEM(BPF_W, ret, index, 0); in array_of_map_gen_lookup()
1321 *insn++ = BPF_JMP_IMM(BPF_JGE, ret, map->max_entries, 6); in array_of_map_gen_lookup()
1322 *insn++ = BPF_ALU32_IMM(BPF_AND, ret, array->index_mask); in array_of_map_gen_lookup()
1324 *insn++ = BPF_JMP_IMM(BPF_JGE, ret, map->max_entries, 5); in array_of_map_gen_lookup()
1327 *insn++ = BPF_ALU64_IMM(BPF_LSH, ret, ilog2(elem_size)); in array_of_map_gen_lookup()
1329 *insn++ = BPF_ALU64_IMM(BPF_MUL, ret, elem_size); in array_of_map_gen_lookup()
1330 *insn++ = BPF_ALU64_REG(BPF_ADD, ret, map_ptr); in array_of_map_gen_lookup()
1331 *insn++ = BPF_LDX_MEM(BPF_DW, ret, ret, 0); in array_of_map_gen_lookup()
1332 *insn++ = BPF_JMP_IMM(BPF_JEQ, ret, 0, 1); in array_of_map_gen_lookup()
1333 *insn++ = BPF_JMP_IMM(BPF_JA, 0, 0, 1); in array_of_map_gen_lookup()
1334 *insn++ = BPF_MOV64_IMM(ret, 0); in array_of_map_gen_lookup()
1336 return insn - insn_buf; in array_of_map_gen_lookup()