aboutsummaryrefslogtreecommitdiffstats
path: root/tools/bpf/bpftool/prog.c
diff options
context:
space:
mode:
authorJakub Kicinski <jakub.kicinski@netronome.com>2018-10-18 14:34:55 -0400
committerDaniel Borkmann <daniel@iogearbox.net>2018-10-18 16:16:02 -0400
commit3ddeac6705aba31b7528c7d7a528eabb74475622 (patch)
tree597a7e02253df1425deec7189c2c973c9e88ea22 /tools/bpf/bpftool/prog.c
parent1bd70d2eba9d90eb787634361f0f6fa2c86b3f6d (diff)
tools: bpftool: use 4 context mode for the NFP disasm
The nfp driver is currently always JITing the BPF for 4 context/thread mode of the NFP flow processors. Tell this to the disassembler, otherwise some registers may be incorrectly decoded. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Jiong Wang <jiong.wang@netronome.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/bpf/bpftool/prog.c')
-rw-r--r--tools/bpf/bpftool/prog.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c
index 335028968dfb..5302ee282409 100644
--- a/tools/bpf/bpftool/prog.c
+++ b/tools/bpf/bpftool/prog.c
@@ -449,6 +449,7 @@ static int do_dump(int argc, char **argv)
449 unsigned long *func_ksyms = NULL; 449 unsigned long *func_ksyms = NULL;
450 struct bpf_prog_info info = {}; 450 struct bpf_prog_info info = {};
451 unsigned int *func_lens = NULL; 451 unsigned int *func_lens = NULL;
452 const char *disasm_opt = NULL;
452 unsigned int nr_func_ksyms; 453 unsigned int nr_func_ksyms;
453 unsigned int nr_func_lens; 454 unsigned int nr_func_lens;
454 struct dump_data dd = {}; 455 struct dump_data dd = {};
@@ -607,9 +608,10 @@ static int do_dump(int argc, char **argv)
607 const char *name = NULL; 608 const char *name = NULL;
608 609
609 if (info.ifindex) { 610 if (info.ifindex) {
610 name = ifindex_to_bfd_name_ns(info.ifindex, 611 name = ifindex_to_bfd_params(info.ifindex,
611 info.netns_dev, 612 info.netns_dev,
612 info.netns_ino); 613 info.netns_ino,
614 &disasm_opt);
613 if (!name) 615 if (!name)
614 goto err_free; 616 goto err_free;
615 } 617 }
@@ -651,7 +653,8 @@ static int do_dump(int argc, char **argv)
651 printf("%s:\n", sym_name); 653 printf("%s:\n", sym_name);
652 } 654 }
653 655
654 disasm_print_insn(img, lens[i], opcodes, name); 656 disasm_print_insn(img, lens[i], opcodes, name,
657 disasm_opt);
655 img += lens[i]; 658 img += lens[i];
656 659
657 if (json_output) 660 if (json_output)
@@ -663,7 +666,8 @@ static int do_dump(int argc, char **argv)
663 if (json_output) 666 if (json_output)
664 jsonw_end_array(json_wtr); 667 jsonw_end_array(json_wtr);
665 } else { 668 } else {
666 disasm_print_insn(buf, *member_len, opcodes, name); 669 disasm_print_insn(buf, *member_len, opcodes, name,
670 disasm_opt);
667 } 671 }
668 } else if (visual) { 672 } else if (visual) {
669 if (json_output) 673 if (json_output)