summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorThadeu Lima de Souza Cascardo <cascardo@redhat.com>2016-05-06 15:27:01 -0300
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-05-19 12:24:18 +0200
commite114696200ce29439c8ab82aa1279d5ca30644f0 (patch)
treea6da0e7b366166d28a3165962a7333e80102946c /tools
parent5c37334a3d2218180135bfe4716d35e0cfb293ba (diff)
downloaddpdk-e114696200ce29439c8ab82aa1279d5ca30644f0.zip
dpdk-e114696200ce29439c8ab82aa1279d5ca30644f0.tar.gz
dpdk-e114696200ce29439c8ab82aa1279d5ca30644f0.tar.xz
tools: allow binding to other network class devices
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>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/dpdk_nic_bind.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/dpdk_nic_bind.py b/tools/dpdk_nic_bind.py
index 28eace3..b69ca2a 100755
--- a/tools/dpdk_nic_bind.py
+++ b/tools/dpdk_nic_bind.py
@@ -38,8 +38,8 @@ import getopt
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
@@ -248,7 +248,7 @@ def get_nic_details():
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)