• Home
  • Raw
  • Download

Lines Matching refs:BPF

44 local BPF = ffi.typeof('struct bpf')
60 [1] = BPF.B, [2] = BPF.H, [4] = BPF.W, [8] = BPF.DW,
120 emit(BPF.MEM + BPF.STX + BPF.DW, 10, vinfo.reg, -vinfo.spill, 0)
128 emit(BPF.MEM + BPF.LDX + BPF.DW, reg, 10, -vinfo.spill, 0)
209 emit(BPF.ALU64 + BPF.MOV + BPF.X, reg, src.reg, 0, 0)
217 emit(BPF.ALU64 + BPF.MOV + BPF.X, reg, 10, 0, 0)
218 emit(BPF.ALU64 + BPF.ADD + BPF.K, reg, 0, 0, -src.const.__base)
221 emit(BPF.ALU64 + BPF.MOV + BPF.K, reg, 0, 0, src.const.off or 0)
224 emit(BPF.LD + BPF.DW, reg, 0, 0, ffi.cast('uint32_t', src.const))
228 emit(BPF.ALU64 + BPF.MOV + BPF.K, reg, 0, 0, src.const)
254 emit(BPF.ALU64 + BPF.MOV + BPF.X, dst_reg, src_reg, 0, 0) -- dst = src
258 emit(BPF.JMP + BPF.JEQ + BPF.K, src_reg, 0, 1, 0) -- if (src != NULL)
260 emit(BPF.MEM + BPF.LDX + const_width[w], dst_reg, src_reg, 0, 0) -- dst = *src;
280 emit(BPF.MEM + BPF.ST + BPF.W, 10, 0, -(stack_top-sp), as_u32[0])
285 emit(BPF.ALU64 + BPF.MOV + BPF.K, 0, 0, 0, 0)
287 emit(BPF.MEM + BPF.STX + BPF.DW, 10, 0, -sp, 0)
302 emit(BPF.ALU64 + BPF.MOV + BPF.X, tmp_reg, src_reg, 0, 0)
308 emit(BPF.MEM + BPF.LDX + const_width[w], src_reg, 10, -V[a].const.__base, 0)
355 emit(BPF.ALU64 + BPF.MOV + BPF.K, acc, 0, 0, 0)
362 emit(BPF.MEM + BPF.LDX + BPF.W, tmp, 10, -(base-sp), 0)
363 emit(BPF.ALU64 + BPF.XOR + BPF.K, tmp, 0, 0, as_u32[0])
364 emit(BPF.ALU64 + BPF.OR + BPF.X, acc, tmp, 0, 0)
367 emit(BPF.JMP + BPF[op] + BPF.K, acc, 0, 0xffff, 0)
384 emit(BPF.JMP + BPF[op] + BPF.X, a_reg, b_reg, 0xffff, 0)
411 emit(BPF.JMP + BPF[op] + BPF.K, reg, 0, 0xffff, b)
447 emit(BPF.ALU64 + BPF[op] + BPF.K, dst_reg, 0, 0, b)
474 emit(BPF.ALU64 + BPF[op] + BPF.X, dst_reg, src_reg, 0, 0)
491 emit(BPF.LD + BPF.ABS + const_width[w], dst_reg, 0, 0, off)
493 emit(BPF.ALU + BPF.END + BPF.TO_BE, dst_reg, 0, 0, w * 8)
498 emit(BPF.LD + BPF.ABS + const_width[4], tmp_reg, 0, 0, off + 4)
500 emit(BPF.ALU + BPF.END + BPF.TO_BE, tmp_reg, 0, 0, 32)
504 emit(BPF.LD + BPF.ABS + const_width[4], dst_reg, 0, 0, off)
506 emit(BPF.ALU + BPF.END + BPF.TO_BE, dst_reg, 0, 0, 32)
518 emit(BPF.LD + BPF.IND + const_width[w], dst_reg, src_reg, 0, off or 0)
520 emit(BPF.ALU + BPF.END + BPF.TO_BE, dst_reg, 0, 0, w * 8)
527 emit(BPF.MEM + BPF.LDX + const_width[w], dst_reg, src_reg, off or 0, 0)
533 emit(BPF.LD + const_width[w], dst_reg, src_type, 0, ffi.cast('uint32_t', imm))
537 emit(BPF.LD + const_width[w], dst_reg, src_type, 0, imm)
638 LD_IMM_X(1, BPF.PSEUDO_MAP_FD, map.fd, ffi.sizeof(V[map_var].type))
642 local w = const_width[key_size] or BPF.DW
651 emit(BPF.MEM + BPF.ST + w, 10, 0, -sp, imm)
656 emit(BPF.MEM + BPF.LDX + w, 2, V[key].reg, 0, 0)
657 emit(BPF.MEM + BPF.STX + w, 10, 2, -sp, 0)
659 emit(BPF.MEM + BPF.STX + w, 10, V[key].reg, -sp, 0)
673 emit(BPF.ALU64 + BPF.MOV + BPF.X, 2, 10, 0, 0)
674 emit(BPF.ALU64 + BPF.ADD + BPF.K, 2, 0, 0, -sp)
685 emit(BPF.JMP + BPF.CALL, 0, 0, 0, HELPER.map_lookup_elem)
693 emit(BPF.JMP + BPF.CALL, 0, 0, 0, HELPER.map_delete_elem)
707 emit(BPF.ALU64 + BPF.MOV + BPF.K, 4, 0, 0, 0) -- BPF_ANY, create new element or update existing
711 local w = const_width[val_size] or BPF.DW
719 emit(BPF.MEM + BPF.ST + w, 10, 0, -sp, base)
725 emit(BPF.MEM + BPF.STX + w, 10, 3, -sp, 0)
727 emit(BPF.MEM + BPF.STX + w, 10, V[src].reg, -sp, 0)
736 emit(BPF.JMP + BPF.CALL, 0, 0, 0, HELPER.map_update_elem)
740 emit(BPF.MEM + BPF.STX + w, 10, 3, -sp, 0)
756 emit(BPF.ALU64 + BPF.MOV + BPF.X, 3, 10, 0, 0)
757 emit(BPF.ALU64 + BPF.ADD + BPF.K, 3, 0, 0, -sp)
758 emit(BPF.JMP + BPF.CALL, 0, 0, 0, HELPER.map_update_elem)
867 emit(BPF.MEM + BPF.ST + const_width[w], dst_reg, 0, d, const)
869 emit(BPF.MEM + BPF.STX + const_width[w], dst_reg, src_reg, d, 0)
875 emit(BPF.MEM + BPF.ST + const_width[w], 10, 0, -vinfo.__base + (d * w), const)
877 emit(BPF.MEM + BPF.STX + const_width[w], 10, src_reg, -vinfo.__base + (d * w), 0)
909 emit(BPF.MEM + BPF.ST + const_width[w], dst_reg, 0, 0, const)
911 emit(BPF.MEM + BPF.STX + const_width[w], dst_reg, src_reg, 0, 0)
922 emit(BPF.ALU64 + BPF.ADD + BPF.X, dst_reg, 10, 0, 0)
926 emit(BPF.MEM + BPF.ST + const_width[w], dst_reg, 0, -vinfo.__base, const)
928 emit(BPF.MEM + BPF.STX + const_width[w], dst_reg, src_reg, -vinfo.__base, 0)
954 emit(BPF.MEM + BPF.ST + const_width[w], dst_reg, 0, ofs, const)
956 emit(BPF.MEM + BPF.STX + const_width[w], dst_reg, src_reg, ofs, 0)
962 emit(BPF.MEM + BPF.ST + const_width[w], 10, 0, -base.__base + ofs, const)
964 emit(BPF.MEM + BPF.STX + const_width[w], 10, src_reg, -base.__base + ofs, 0)
1041 emit(BPF.MEM + BPF.LDX + const_width[w], dst_reg, 10, -base.__base+ofs, 0)
1055 emit(BPF.ALU64 + BPF.AND + BPF.K, vreg(a), 0, 0, mask)
1060 emit(BPF.ALU64 + BPF.RSH + BPF.K, vreg(a), 0, 0, shift)
1186 emit(BPF.ALU64 + BPF.MOV + BPF.K, dst_reg, 0, 0, 0)
1187 emit(BPF.JMP + BPF.JEQ + BPF.K, dst_reg, 0, 0xffff, 0)
1204 emit(BPF.JMP + BPF.EXIT, 0, 0, 0, 0)
1208 emit(BPF.ALU64 + BPF.MOV + BPF.K, 0, 0, 0, 0)
1209 emit(BPF.JMP + BPF.EXIT, 0, 0, 0, 0)
1224 emit(BPF.ALU64 + BPF.MOV + BPF.X, 6, 1, 0, 0)
1286 if mode == BPF.XADD then cls = 5 end -- The only mode
1293 if cls == BPF.LDX then src = string.format('[R%d%+d]', ins.src_reg, off) end
1294 if mode == BPF.ABS then src = string.format('skb[%d]', ins.imm) end
1295 if mode == BPF.IND then src = string.format('skb[R%d%+d]', ins.src_reg, ins.imm) end
1313 local src = (bit.band(ins.code, 0x08) == BPF.X) and 'R'..ins.src_reg or '#'..ins.imm
1349 local env = { pkt=proto.pkt, eth=proto.pkt, BPF=BPF, ffi=ffi }