dpdk_nic_bind will only handle Ethernet devices, but Mellanox ConnectX-3 Pro,
for example, is a Network class device, but not an Ethernet one. Even though
this allows other devices in the list, like Wireless devices, this should not be
a problem.
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
import subprocess
from os.path import exists, abspath, dirname, basename
import subprocess
from os.path import exists, abspath, dirname, basename
-# The PCI device class for ETHERNET devices
-ETHERNET_CLASS = "0200"
+# The PCI base class for NETWORK devices
+NETWORK_BASE_CLASS = "02"
# global dict ethernet devices present. Dictionary indexed by PCI address.
# Each device within this is itself a dictionary of device properties
# global dict ethernet devices present. Dictionary indexed by PCI address.
# Each device within this is itself a dictionary of device properties
dev_lines = check_output(["lspci", "-Dvmmn"]).splitlines()
for dev_line in dev_lines:
if (len(dev_line) == 0):
dev_lines = check_output(["lspci", "-Dvmmn"]).splitlines()
for dev_line in dev_lines:
if (len(dev_line) == 0):
- if dev["Class"] == ETHERNET_CLASS:
+ if dev["Class"][0:2] == NETWORK_BASE_CLASS:
# convert device and vendor ids to numbers, then add to global
dev["Vendor"] = int(dev["Vendor"], 16)
dev["Device"] = int(dev["Device"], 16)
# convert device and vendor ids to numbers, then add to global
dev["Vendor"] = int(dev["Vendor"], 16)
dev["Device"] = int(dev["Device"], 16)