I can get vendor and device IDs for the device providing a network interface using /sys/class/net/
:
$ cat /sys/class/net/p4p2/device/vendor /sys/class/net/p4p2/device/device
0x15b3
0x1013
Then I can get lspci
to show me info about that device:
$ lspci -d 0x15b3:0x1013
82:00.0 Infiniband controller: Mellanox Technologies MT27700 Family [ConnectX-4]
82:00.1 Ethernet controller: Mellanox Technologies MT27700 Family [ConnectX-4]
So it's dual-port. In this case I happen to know that device p4p2
is the ethernet side, but is there info in /sys/class/net/<dev>
which links it to the 82:00.1
entry? Or some other way which doesn't require sudo
?