[dpdk-dev,1/2] usertools: fix adding devices of same class

Message ID 20170504104850.7404-1-jerin.jacob@caviumnetworks.com (mailing list archive)
State Accepted, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Jerin Jacob May 4, 2017, 10:48 a.m. UTC
  From: Guduri Prathyusha <gprathyusha@caviumnetworks.com>

If multiple devices of same class are added to a device type,
only devices that match first device listed in device type list are
processed.

Fixing it in device_type_match() by returning false after iterating
through all the devices listed in a device type list.

Fixes: 8ad08a287918 ("usertools: define DPDK PCI functional device")

Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
---
 usertools/dpdk-devbind.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
  

Comments

Thomas Monjalon May 7, 2017, 12:32 p.m. UTC | #1
04/05/2017 12:48, Jerin Jacob:
> From: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
> 
> If multiple devices of same class are added to a device type,
> only devices that match first device listed in device type list are
> processed.
> 
> Fixing it in device_type_match() by returning false after iterating
> through all the devices listed in a device type list.
> 
> Fixes: 8ad08a287918 ("usertools: define DPDK PCI functional device")
> 
> Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>

Series applied, thanks
  

Patch

diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py
index 2d99e9d82..79e7e8938 100755
--- a/usertools/dpdk-devbind.py
+++ b/usertools/dpdk-devbind.py
@@ -354,8 +354,7 @@  def device_type_match(dev, devices_type):
             # count must be the number of non None parameters to match
             if match_count == param_count:
                 return True
-            else:
-                return False
+    return False
 
 def dev_id_from_dev_name(dev_name):
     '''Take a device "name" - a string passed in by user to identify a NIC