On Tue, Jan 16, 2018 at 04:05:21PM -0800, Jakub Kicinski wrote:
> From: Jiong Wang <jiong.w...@netronome.com>
> 
> 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.kicin...@netronome.com>
> Signed-off-by: Jiong Wang <jiong.w...@netronome.com>

awesome addition!
Acked-by: Alexei Starovoitov <a...@kernel.org>

> +     switch (vendor_id) {
> +     case 0x19ee:
> +             device_id = read_sysfs_netdev_hex_int(devname, "device");
> +             if (device_id != 0x4000 &&
> +                 device_id != 0x6000 &&
> +                 device_id != 0x6003)
> +                     p_info("Unknown NFP device ID, assuming it is NFP-6xxx 
> arch");
> +             return "NFP-6xxx";

is this a canonical name that bfd will understand?
a link to bfd patches?

Reply via email to