Lines Matching +full:off +full:- +full:by
1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2 /* Copyright (C) 2016-2018 Netronome Systems, Inc. */
25 backward = meta->n - insn_idx; in nfp_bpf_goto_meta()
26 forward = insn_idx - meta->n; in nfp_bpf_goto_meta()
28 if (min(forward, backward) > nfp_prog->n_insns - insn_idx - 1) { in nfp_bpf_goto_meta()
29 backward = nfp_prog->n_insns - insn_idx - 1; in nfp_bpf_goto_meta()
57 * case where there is only one adjust head by a constant. in nfp_record_adjust_head()
59 if (reg2->type != SCALAR_VALUE || !tnum_is_const(reg2->var_off)) in nfp_record_adjust_head()
61 imm = reg2->var_off.value; in nfp_record_adjust_head()
63 if (imm > ETH_ZLEN - ETH_HLEN) in nfp_record_adjust_head()
65 if (imm > (int)bpf->adjust_head.guaranteed_add || in nfp_record_adjust_head()
66 imm < -bpf->adjust_head.guaranteed_sub) in nfp_record_adjust_head()
69 if (nfp_prog->adjust_head_location) { in nfp_record_adjust_head()
71 if (nfp_prog->adjust_head_location != meta->n) in nfp_record_adjust_head()
74 if (meta->arg2.reg.var_off.value != imm) in nfp_record_adjust_head()
78 location = meta->n; in nfp_record_adjust_head()
80 nfp_prog->adjust_head_location = location; in nfp_record_adjust_head()
90 int off, i; in nfp_bpf_map_update_value_ok() local
92 state = env->cur_state->frame[reg3->frameno]; in nfp_bpf_map_update_value_ok()
94 /* We need to record each time update happens with non-zero words, in nfp_bpf_map_update_value_ok()
99 offmap = map_to_offmap(reg1->map_ptr); in nfp_bpf_map_update_value_ok()
100 nfp_map = offmap->dev_priv; in nfp_bpf_map_update_value_ok()
101 off = reg3->off + reg3->var_off.value; in nfp_bpf_map_update_value_ok()
103 for (i = 0; i < offmap->map.value_size; i++) { in nfp_bpf_map_update_value_ok()
107 soff = -(off + i) - 1; in nfp_bpf_map_update_value_ok()
108 stack_entry = &state->stack[soff / BPF_REG_SIZE]; in nfp_bpf_map_update_value_ok()
109 if (stack_entry->slot_type[soff % BPF_REG_SIZE] == STACK_ZERO) in nfp_bpf_map_update_value_ok()
112 if (nfp_map->use_map[i / 4].type == NFP_MAP_USE_ATOMIC_CNT) { in nfp_bpf_map_update_value_ok()
113 …pr_vlog(env, "value at offset %d/%d may be non-zero, bpf_map_update_elem() is required to initiali… in nfp_bpf_map_update_value_ok()
117 nfp_map->use_map[i / 4].non_zero_update = 1; in nfp_bpf_map_update_value_ok()
128 s64 off, old_off; in nfp_bpf_stack_arg_ok() local
130 if (reg->type != PTR_TO_STACK) { in nfp_bpf_stack_arg_ok()
132 fname, reg->type); in nfp_bpf_stack_arg_ok()
135 if (!tnum_is_const(reg->var_off)) { in nfp_bpf_stack_arg_ok()
140 off = reg->var_off.value + reg->off; in nfp_bpf_stack_arg_ok()
141 if (-off % 4) { in nfp_bpf_stack_arg_ok()
142 pr_vlog(env, "%s: unaligned stack pointer %lld\n", fname, -off); in nfp_bpf_stack_arg_ok()
146 /* Rest of the checks is only if we re-parse the same insn */ in nfp_bpf_stack_arg_ok()
150 old_off = old_arg->reg.var_off.value + old_arg->reg.off; in nfp_bpf_stack_arg_ok()
151 old_arg->var_off |= off != old_off; in nfp_bpf_stack_arg_ok()
162 pr_vlog(env, "%s: not supported by FW\n", fname); in nfp_bpf_map_call_ok()
177 struct nfp_app_bpf *bpf = nfp_prog->bpf; in nfp_bpf_check_helper_call()
178 u32 func_id = meta->insn.imm; in nfp_bpf_check_helper_call()
182 if (!bpf->adjust_head.off_max) { in nfp_bpf_check_helper_call()
183 pr_vlog(env, "adjust_head not supported by FW\n"); in nfp_bpf_check_helper_call()
184 return -EOPNOTSUPP; in nfp_bpf_check_helper_call()
186 if (!(bpf->adjust_head.flags & NFP_BPF_ADJUST_HEAD_NO_META)) { in nfp_bpf_check_helper_call()
187 pr_vlog(env, "adjust_head: FW requires shifting metadata, not supported by the driver\n"); in nfp_bpf_check_helper_call()
188 return -EOPNOTSUPP; in nfp_bpf_check_helper_call()
195 if (!bpf->adjust_tail) { in nfp_bpf_check_helper_call()
196 pr_vlog(env, "adjust_tail not supported by FW\n"); in nfp_bpf_check_helper_call()
197 return -EOPNOTSUPP; in nfp_bpf_check_helper_call()
203 bpf->helpers.map_lookup, reg1) || in nfp_bpf_check_helper_call()
205 meta->func_id ? &meta->arg2 : NULL)) in nfp_bpf_check_helper_call()
206 return -EOPNOTSUPP; in nfp_bpf_check_helper_call()
211 bpf->helpers.map_update, reg1) || in nfp_bpf_check_helper_call()
213 meta->func_id ? &meta->arg2 : NULL) || in nfp_bpf_check_helper_call()
216 return -EOPNOTSUPP; in nfp_bpf_check_helper_call()
221 bpf->helpers.map_delete, reg1) || in nfp_bpf_check_helper_call()
223 meta->func_id ? &meta->arg2 : NULL)) in nfp_bpf_check_helper_call()
224 return -EOPNOTSUPP; in nfp_bpf_check_helper_call()
228 if (bpf->pseudo_random) in nfp_bpf_check_helper_call()
231 return -EOPNOTSUPP; in nfp_bpf_check_helper_call()
239 if (!bpf->helpers.perf_event_output) { in nfp_bpf_check_helper_call()
240 pr_vlog(env, "event_output: not supported by FW\n"); in nfp_bpf_check_helper_call()
241 return -EOPNOTSUPP; in nfp_bpf_check_helper_call()
247 if (reg3->var_off.mask & BPF_F_INDEX_MASK || in nfp_bpf_check_helper_call()
248 (reg3->var_off.value & BPF_F_INDEX_MASK) != in nfp_bpf_check_helper_call()
252 tnum_strn(tn_buf, sizeof(tn_buf), reg3->var_off); in nfp_bpf_check_helper_call()
255 return -EOPNOTSUPP; in nfp_bpf_check_helper_call()
263 if (reg1->type != SCALAR_VALUE /* NULL ptr */ && in nfp_bpf_check_helper_call()
264 reg1->type != PTR_TO_STACK && in nfp_bpf_check_helper_call()
265 reg1->type != PTR_TO_MAP_VALUE && in nfp_bpf_check_helper_call()
266 reg1->type != PTR_TO_PACKET) { in nfp_bpf_check_helper_call()
268 reg1->type); in nfp_bpf_check_helper_call()
269 return -EOPNOTSUPP; in nfp_bpf_check_helper_call()
272 if (reg1->type == PTR_TO_STACK && in nfp_bpf_check_helper_call()
274 return -EOPNOTSUPP; in nfp_bpf_check_helper_call()
284 dev_warn_once(&nfp_prog->bpf->app->pf->pdev->dev, in nfp_bpf_check_helper_call()
288 if (!meta->func_id) in nfp_bpf_check_helper_call()
291 if (reg1->type != meta->arg1.type) { in nfp_bpf_check_helper_call()
293 meta->arg1.type, reg1->type); in nfp_bpf_check_helper_call()
294 return -EINVAL; in nfp_bpf_check_helper_call()
300 return -EOPNOTSUPP; in nfp_bpf_check_helper_call()
303 meta->func_id = func_id; in nfp_bpf_check_helper_call()
304 meta->arg1 = *reg1; in nfp_bpf_check_helper_call()
305 meta->arg2.reg = *reg2; in nfp_bpf_check_helper_call()
317 if (nfp_prog->type == BPF_PROG_TYPE_XDP) in nfp_bpf_check_exit()
320 if (!(reg0->type == SCALAR_VALUE && tnum_is_const(reg0->var_off))) { in nfp_bpf_check_exit()
323 tnum_strn(tn_buf, sizeof(tn_buf), reg0->var_off); in nfp_bpf_check_exit()
325 reg0->type, tn_buf); in nfp_bpf_check_exit()
326 return -EINVAL; in nfp_bpf_check_exit()
329 imm = reg0->var_off.value; in nfp_bpf_check_exit()
330 if (nfp_prog->type == BPF_PROG_TYPE_SCHED_CLS && in nfp_bpf_check_exit()
335 reg0->type, imm); in nfp_bpf_check_exit()
336 return -EINVAL; in nfp_bpf_check_exit()
350 if (reg->frameno != env->cur_state->curframe) in nfp_bpf_check_stack_access()
351 meta->flags |= FLAG_INSN_PTR_CALLER_STACK_FRAME; in nfp_bpf_check_stack_access()
353 if (!tnum_is_const(reg->var_off)) { in nfp_bpf_check_stack_access()
355 return -EINVAL; in nfp_bpf_check_stack_access()
358 if (meta->ptr.type == NOT_INIT) in nfp_bpf_check_stack_access()
361 old_off = meta->ptr.off + meta->ptr.var_off.value; in nfp_bpf_check_stack_access()
362 new_off = reg->off + reg->var_off.value; in nfp_bpf_check_stack_access()
364 meta->ptr_not_const |= old_off != new_off; in nfp_bpf_check_stack_access()
366 if (!meta->ptr_not_const) in nfp_bpf_check_stack_access()
374 return -EINVAL; in nfp_bpf_check_stack_access()
394 unsigned int off, enum nfp_bpf_map_use use) in nfp_bpf_map_mark_used_one() argument
396 if (nfp_map->use_map[off / 4].type != NFP_MAP_UNUSED && in nfp_bpf_map_mark_used_one()
397 nfp_map->use_map[off / 4].type != use) { in nfp_bpf_map_mark_used_one()
398 pr_vlog(env, "map value use type conflict %s vs %s off: %u\n", in nfp_bpf_map_mark_used_one()
399 nfp_bpf_map_use_name(nfp_map->use_map[off / 4].type), in nfp_bpf_map_mark_used_one()
400 nfp_bpf_map_use_name(use), off); in nfp_bpf_map_mark_used_one()
401 return -EOPNOTSUPP; in nfp_bpf_map_mark_used_one()
404 if (nfp_map->use_map[off / 4].non_zero_update && in nfp_bpf_map_mark_used_one()
406 pr_vlog(env, "atomic counter in map value may already be initialized to non-zero value off: %u\n", in nfp_bpf_map_mark_used_one()
407 off); in nfp_bpf_map_mark_used_one()
408 return -EOPNOTSUPP; in nfp_bpf_map_mark_used_one()
411 nfp_map->use_map[off / 4].type = use; in nfp_bpf_map_mark_used_one()
423 unsigned int size, off; in nfp_bpf_map_mark_used() local
426 if (!tnum_is_const(reg->var_off)) { in nfp_bpf_map_mark_used()
428 return -EOPNOTSUPP; in nfp_bpf_map_mark_used()
431 off = reg->var_off.value + meta->insn.off + reg->off; in nfp_bpf_map_mark_used()
432 size = BPF_LDST_BYTES(&meta->insn); in nfp_bpf_map_mark_used()
433 offmap = map_to_offmap(reg->map_ptr); in nfp_bpf_map_mark_used()
434 nfp_map = offmap->dev_priv; in nfp_bpf_map_mark_used()
436 if (off + size > offmap->map.value_size) { in nfp_bpf_map_mark_used()
437 pr_vlog(env, "map value access out-of-bounds\n"); in nfp_bpf_map_mark_used()
438 return -EINVAL; in nfp_bpf_map_mark_used()
441 for (i = 0; i < size; i += 4 - (off + i) % 4) { in nfp_bpf_map_mark_used()
442 err = nfp_bpf_map_mark_used_one(env, nfp_map, off + i, use); in nfp_bpf_map_mark_used()
457 if (reg->type != PTR_TO_CTX && in nfp_bpf_check_ptr()
458 reg->type != PTR_TO_STACK && in nfp_bpf_check_ptr()
459 reg->type != PTR_TO_MAP_VALUE && in nfp_bpf_check_ptr()
460 reg->type != PTR_TO_PACKET) { in nfp_bpf_check_ptr()
461 pr_vlog(env, "unsupported ptr type: %d\n", reg->type); in nfp_bpf_check_ptr()
462 return -EINVAL; in nfp_bpf_check_ptr()
465 if (reg->type == PTR_TO_STACK) { in nfp_bpf_check_ptr()
471 if (reg->type == PTR_TO_MAP_VALUE) { in nfp_bpf_check_ptr()
480 return -EOPNOTSUPP; in nfp_bpf_check_ptr()
490 if (meta->ptr.type != NOT_INIT && meta->ptr.type != reg->type) { in nfp_bpf_check_ptr()
491 pr_vlog(env, "ptr type changed for instruction %d -> %d\n", in nfp_bpf_check_ptr()
492 meta->ptr.type, reg->type); in nfp_bpf_check_ptr()
493 return -EINVAL; in nfp_bpf_check_ptr()
496 meta->ptr = *reg; in nfp_bpf_check_ptr()
505 const struct bpf_reg_state *reg = cur_regs(env) + meta->insn.dst_reg; in nfp_bpf_check_store()
507 if (reg->type == PTR_TO_CTX) { in nfp_bpf_check_store()
508 if (nfp_prog->type == BPF_PROG_TYPE_XDP) { in nfp_bpf_check_store()
510 switch (meta->insn.off) { in nfp_bpf_check_store()
512 if (nfp_prog->bpf->queue_select) in nfp_bpf_check_store()
514 pr_vlog(env, "queue selection not supported by FW\n"); in nfp_bpf_check_store()
515 return -EOPNOTSUPP; in nfp_bpf_check_store()
519 return -EOPNOTSUPP; in nfp_bpf_check_store()
522 return nfp_bpf_check_ptr(nfp_prog, meta, env, meta->insn.dst_reg); in nfp_bpf_check_store()
529 const struct bpf_reg_state *sreg = cur_regs(env) + meta->insn.src_reg; in nfp_bpf_check_atomic()
530 const struct bpf_reg_state *dreg = cur_regs(env) + meta->insn.dst_reg; in nfp_bpf_check_atomic()
532 if (meta->insn.imm != BPF_ADD) { in nfp_bpf_check_atomic()
533 pr_vlog(env, "atomic op not implemented: %d\n", meta->insn.imm); in nfp_bpf_check_atomic()
534 return -EOPNOTSUPP; in nfp_bpf_check_atomic()
537 if (dreg->type != PTR_TO_MAP_VALUE) { in nfp_bpf_check_atomic()
539 dreg->type); in nfp_bpf_check_atomic()
540 return -EOPNOTSUPP; in nfp_bpf_check_atomic()
542 if (sreg->type != SCALAR_VALUE) { in nfp_bpf_check_atomic()
543 pr_vlog(env, "atomic add not of a scalar: %d\n", sreg->type); in nfp_bpf_check_atomic()
544 return -EOPNOTSUPP; in nfp_bpf_check_atomic()
547 meta->xadd_over_16bit |= in nfp_bpf_check_atomic()
548 sreg->var_off.value > 0xffff || sreg->var_off.mask > 0xffff; in nfp_bpf_check_atomic()
549 meta->xadd_maybe_16bit |= in nfp_bpf_check_atomic()
550 (sreg->var_off.value & ~sreg->var_off.mask) <= 0xffff; in nfp_bpf_check_atomic()
552 return nfp_bpf_check_ptr(nfp_prog, meta, env, meta->insn.dst_reg); in nfp_bpf_check_atomic()
560 cur_regs(env) + meta->insn.src_reg; in nfp_bpf_check_alu()
562 cur_regs(env) + meta->insn.dst_reg; in nfp_bpf_check_alu()
564 meta->umin_src = min(meta->umin_src, sreg->umin_value); in nfp_bpf_check_alu()
565 meta->umax_src = max(meta->umax_src, sreg->umax_value); in nfp_bpf_check_alu()
566 meta->umin_dst = min(meta->umin_dst, dreg->umin_value); in nfp_bpf_check_alu()
567 meta->umax_dst = max(meta->umax_dst, dreg->umax_value); in nfp_bpf_check_alu()
578 * result is 32-bits and there is no difference on the low halve of in nfp_bpf_check_alu()
582 if (meta->umax_dst > U32_MAX) { in nfp_bpf_check_alu()
584 return -EINVAL; in nfp_bpf_check_alu()
586 if (mbpf_src(meta) == BPF_X && meta->umax_src > U32_MAX) { in nfp_bpf_check_alu()
588 return -EINVAL; in nfp_bpf_check_alu()
591 mbpf_src(meta) == BPF_K && meta->insn.imm < 0) { in nfp_bpf_check_alu()
593 return -EINVAL; in nfp_bpf_check_alu()
597 /* NFP doesn't have divide instructions, we support divide by constant in nfp_bpf_check_alu()
603 * language level by failing compilation. However LLVM assembler hasn't in nfp_bpf_check_alu()
608 if (meta->umax_dst > U32_MAX) { in nfp_bpf_check_alu()
610 return -EINVAL; in nfp_bpf_check_alu()
613 if (meta->umin_src != meta->umax_src) { in nfp_bpf_check_alu()
615 return -EINVAL; in nfp_bpf_check_alu()
617 if (meta->umax_src > U32_MAX) { in nfp_bpf_check_alu()
619 return -EINVAL; in nfp_bpf_check_alu()
622 if (mbpf_src(meta) == BPF_K && meta->insn.imm < 0) { in nfp_bpf_check_alu()
623 pr_vlog(env, "divide by negative constant is not supported\n"); in nfp_bpf_check_alu()
624 return -EINVAL; in nfp_bpf_check_alu()
634 struct nfp_prog *nfp_prog = env->prog->aux->offload->dev_priv; in nfp_verify_insn()
635 struct nfp_insn_meta *meta = nfp_prog->verifier_meta; in nfp_verify_insn()
638 nfp_prog->verifier_meta = meta; in nfp_verify_insn()
640 if (!nfp_bpf_supported_opcode(meta->insn.code)) { in nfp_verify_insn()
642 meta->insn.code); in nfp_verify_insn()
643 return -EINVAL; in nfp_verify_insn()
646 if (meta->insn.src_reg >= MAX_BPF_REG || in nfp_verify_insn()
647 meta->insn.dst_reg >= MAX_BPF_REG) { in nfp_verify_insn()
648 pr_vlog(env, "program uses extended registers - jit hardening?\n"); in nfp_verify_insn()
649 return -EINVAL; in nfp_verify_insn()
654 if (meta->insn.code == (BPF_JMP | BPF_EXIT)) in nfp_verify_insn()
659 meta->insn.src_reg); in nfp_verify_insn()
679 list_for_each_entry(meta, &nfp_prog->insns, l) { in nfp_assign_subprog_idx_and_regs()
682 meta->subprog_idx = index; in nfp_assign_subprog_idx_and_regs()
684 if (meta->insn.dst_reg >= BPF_REG_6 && in nfp_assign_subprog_idx_and_regs()
685 meta->insn.dst_reg <= BPF_REG_9) in nfp_assign_subprog_idx_and_regs()
686 nfp_prog->subprog[index].needs_reg_push = 1; in nfp_assign_subprog_idx_and_regs()
689 if (index + 1 != nfp_prog->subprog_cnt) { in nfp_assign_subprog_idx_and_regs()
691 index + 1, nfp_prog->subprog_cnt); in nfp_assign_subprog_idx_and_regs()
692 return -EFAULT; in nfp_assign_subprog_idx_and_regs()
705 unsigned short idx = meta->subprog_idx; in nfp_bpf_get_stack_usage()
710 * prevented by the kernel verifier, this algorithm only needs a local in nfp_bpf_get_stack_usage()
714 frame_depths[frame] = nfp_prog->subprog[idx].stack_depth; in nfp_bpf_get_stack_usage()
720 for (; meta != nfp_prog_last_meta(nfp_prog) && meta->subprog_idx == idx; in nfp_bpf_get_stack_usage()
733 meta->n + 1 + meta->insn.imm); in nfp_bpf_get_stack_usage()
734 idx = meta->subprog_idx; in nfp_bpf_get_stack_usage()
745 depth -= frame_depths[frame]; in nfp_bpf_get_stack_usage()
746 frame--; in nfp_bpf_get_stack_usage()
757 list_for_each_entry(meta, &nfp_prog->insns, l) { in nfp_bpf_insn_flag_zext()
758 if (aux[meta->n].zext_dst) in nfp_bpf_insn_flag_zext()
759 meta->flags |= FLAG_INSN_DO_ZEXT; in nfp_bpf_insn_flag_zext()
771 nfp_prog = env->prog->aux->offload->dev_priv; in nfp_bpf_finalize()
772 nfp_prog->subprog_cnt = env->subprog_cnt; in nfp_bpf_finalize()
773 nfp_prog->subprog = kcalloc(nfp_prog->subprog_cnt, in nfp_bpf_finalize()
774 sizeof(nfp_prog->subprog[0]), GFP_KERNEL); in nfp_bpf_finalize()
775 if (!nfp_prog->subprog) in nfp_bpf_finalize()
776 return -ENOMEM; in nfp_bpf_finalize()
780 info = env->subprog_info; in nfp_bpf_finalize()
781 for (i = 0; i < nfp_prog->subprog_cnt; i++) { in nfp_bpf_finalize()
782 nfp_prog->subprog[i].stack_depth = info[i].stack_depth; in nfp_bpf_finalize()
788 nfp_prog->subprog[i].stack_depth += REG_WIDTH; in nfp_bpf_finalize()
790 if (nfp_prog->subprog[i].needs_reg_push) in nfp_bpf_finalize()
791 nfp_prog->subprog[i].stack_depth += BPF_REG_SIZE * 4; in nfp_bpf_finalize()
794 nn = netdev_priv(env->prog->aux->offload->netdev); in nfp_bpf_finalize()
796 nfp_prog->stack_size = nfp_bpf_get_stack_usage(nfp_prog); in nfp_bpf_finalize()
797 if (nfp_prog->stack_size > max_stack) { in nfp_bpf_finalize()
799 nfp_prog->stack_size, max_stack); in nfp_bpf_finalize()
800 return -EOPNOTSUPP; in nfp_bpf_finalize()
803 nfp_bpf_insn_flag_zext(nfp_prog, env->insn_aux_data); in nfp_bpf_finalize()
807 int nfp_bpf_opt_replace_insn(struct bpf_verifier_env *env, u32 off, in nfp_bpf_opt_replace_insn() argument
810 struct nfp_prog *nfp_prog = env->prog->aux->offload->dev_priv; in nfp_bpf_opt_replace_insn()
811 struct bpf_insn_aux_data *aux_data = env->insn_aux_data; in nfp_bpf_opt_replace_insn()
812 struct nfp_insn_meta *meta = nfp_prog->verifier_meta; in nfp_bpf_opt_replace_insn()
814 meta = nfp_bpf_goto_meta(nfp_prog, meta, aux_data[off].orig_idx); in nfp_bpf_opt_replace_insn()
815 nfp_prog->verifier_meta = meta; in nfp_bpf_opt_replace_insn()
819 insn->code == (BPF_JMP | BPF_JA | BPF_K)) { in nfp_bpf_opt_replace_insn()
822 tgt_off = off + insn->off + 1; in nfp_bpf_opt_replace_insn()
824 if (!insn->off) { in nfp_bpf_opt_replace_insn()
825 meta->jmp_dst = list_next_entry(meta, l); in nfp_bpf_opt_replace_insn()
826 meta->jump_neg_op = false; in nfp_bpf_opt_replace_insn()
827 } else if (meta->jmp_dst->n != aux_data[tgt_off].orig_idx) { in nfp_bpf_opt_replace_insn()
828 pr_vlog(env, "branch hard wire at %d changes target %d -> %d\n", in nfp_bpf_opt_replace_insn()
829 off, meta->jmp_dst->n, in nfp_bpf_opt_replace_insn()
831 return -EINVAL; in nfp_bpf_opt_replace_insn()
836 pr_vlog(env, "unsupported instruction replacement %hhx -> %hhx\n", in nfp_bpf_opt_replace_insn()
837 meta->insn.code, insn->code); in nfp_bpf_opt_replace_insn()
838 return -EINVAL; in nfp_bpf_opt_replace_insn()
841 int nfp_bpf_opt_remove_insns(struct bpf_verifier_env *env, u32 off, u32 cnt) in nfp_bpf_opt_remove_insns() argument
843 struct nfp_prog *nfp_prog = env->prog->aux->offload->dev_priv; in nfp_bpf_opt_remove_insns()
844 struct bpf_insn_aux_data *aux_data = env->insn_aux_data; in nfp_bpf_opt_remove_insns()
845 struct nfp_insn_meta *meta = nfp_prog->verifier_meta; in nfp_bpf_opt_remove_insns()
848 meta = nfp_bpf_goto_meta(nfp_prog, meta, aux_data[off].orig_idx); in nfp_bpf_opt_remove_insns()
851 if (WARN_ON_ONCE(&meta->l == &nfp_prog->insns)) in nfp_bpf_opt_remove_insns()
852 return -EINVAL; in nfp_bpf_opt_remove_insns()
855 if (meta->flags & FLAG_INSN_SKIP_VERIFIER_OPT) in nfp_bpf_opt_remove_insns()
856 i--; in nfp_bpf_opt_remove_insns()
858 meta->flags |= FLAG_INSN_SKIP_VERIFIER_OPT; in nfp_bpf_opt_remove_insns()