]> git.baikalelectronics.ru Git - kernel.git/commit
tools: bpftool: improve architecture detection by using ifindex
authorJiong Wang <jiong.wang@netronome.com>
Wed, 17 Jan 2018 00:05:21 +0000 (16:05 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 18 Jan 2018 00:26:15 +0000 (01:26 +0100)
commitbd9006cc450aaae3eab8f15e2992ddbb7a4092d7
tree173640edb8a446423ab1dd4e00add1c782c17048
parent6e976734bba52fec0f2b8d78b6e05414100c7c61
tools: bpftool: improve architecture detection by using ifindex

The current architecture detection method in bpftool is designed for host
case.

For offload case, we can't use the architecture of "bpftool" itself.
Instead, we could call the existing "ifindex_to_name_ns" to get DEVNAME,
then read pci id from /sys/class/dev/DEVNAME/device/vendor, finally we map
vendor id to bfd arch name which will finally be used to select bfd backend
for the disassembler.

Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/bpf/bpftool/common.c
tools/bpf/bpftool/jit_disasm.c
tools/bpf/bpftool/main.h
tools/bpf/bpftool/prog.c