From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 4EDB829B6 for ; Fri, 6 May 2016 20:27:13 +0200 (CEST) Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B38FC488 for ; Fri, 6 May 2016 18:27:12 +0000 (UTC) Received: from indiana.gru.redhat.com (ovpn-113-230.phx2.redhat.com [10.3.113.230]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u46IRBtq004364 for ; Fri, 6 May 2016 14:27:11 -0400 From: Thadeu Lima de Souza Cascardo To: dev@dpdk.org Date: Fri, 6 May 2016 15:27:01 -0300 Message-Id: <1462559221-16998-1-git-send-email-cascardo@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Subject: [dpdk-dev] [PATCH] tools: allow binding to other network class devices X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 18:27:13 -0000 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 --- 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