Thread (220 messages) 220 messages, 8 authors, 2021-10-31

Re: [dpdk-dev] [PATCH v8 05/12] bpf: add function to dump eBPF instructions

From: Stephen Hemminger <stephen@networkplumber.org>
Date: 2021-09-15 16:26:21

On Wed, 15 Sep 2021 11:04:41 +0000
"Ananyev, Konstantin" [off-list ref] wrote:
quoted
diff --git a/lib/bpf/bpf_convert.c b/lib/bpf/bpf_convert.c
index a46ffeb067dd..db84add7dcce 100644
--- a/lib/bpf/bpf_convert.c
+++ b/lib/bpf/bpf_convert.c
@@ -331,7 +331,12 @@ static int bpf_convert_filter(const struct bpf_insn *prog, size_t len,
 		case BPF_LD | BPF_IND | BPF_H:
 		case BPF_LD | BPF_IND | BPF_B:
 			/* All arithmetic insns map as-is. */
-			*insn = BPF_RAW_INSN(fp->code, BPF_REG_A, BPF_REG_X, 0, fp->k);
+			insn->code = fp->code;
+			insn->dst_reg = BPF_REG_A;
+			bpf_src = BPF_SRC(fp->code);
+			insn->src_reg = bpf_src == BPF_X ? BPF_REG_X : 0;
+			insn->off = 0;
+			insn->imm = fp->k;
 			break;  
Should it be part of that patch?
Looks like belongs to previous one, no?
Yes, moved it in next bundle.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help