DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] tools: allow binding to other network class devices
Date: Fri,  6 May 2016 15:27:01 -0300	[thread overview]
Message-ID: <1462559221-16998-1-git-send-email-cascardo@redhat.com> (raw)

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>
---
 tools/dpdk_nic_bind.py | 6 +++---
 1 file 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)
-- 
2.5.5

             reply	other threads:[~2016-05-06 18:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-06 18:27 Thadeu Lima de Souza Cascardo [this message]
2016-05-19 10:21 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1462559221-16998-1-git-send-email-cascardo@redhat.com \
    --to=cascardo@redhat.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).