[3/5] nics/net_device: add support for dual-port nfp NIC with single PCI address

Message ID 20230208164624.2997614-4-niklas.soderlund@corigine.com (mailing list archive)
State Superseded
Headers
Series Add initial support for NFP PMD |

Commit Message

Niklas Söderlund Feb. 8, 2023, 4:46 p.m. UTC
  From: Qin Ke <qin.ke@corigine.com>

Corigine and Netronome physical dual-port adapter which use driver of nfp
share single PCI adress. This limits the dts framework to use both the two
physical ports of nfp for testing

Add support for it by utilizing both the fields of intf_name and intf2_name

Signed-off-by: Qin Ke <qin.ke@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 framework/tester.py | 2 +-
 nics/net_device.py  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
  

Patch

diff --git a/framework/tester.py b/framework/tester.py
index 89f654d4019c..a8342a2f36c9 100644
--- a/framework/tester.py
+++ b/framework/tester.py
@@ -518,7 +518,7 @@  class Tester(Crb):
                 }
             )
 
-            # return if port is not connect x3
+            # return if port does not have two interface
             if not port.get_interface2_name():
                 continue
 
diff --git a/nics/net_device.py b/nics/net_device.py
index 85245d2917db..3eec5c7f2f3d 100644
--- a/nics/net_device.py
+++ b/nics/net_device.py
@@ -194,8 +194,8 @@  class NetDevice(object):
         else:
             self.intf_name = out
 
-        # not a complete fix for CX3.
-        if len(out.split()) > 1 and self.default_driver == "mlx4_core":
+        # Incomplete fix for dual-ports adapters (CX3, NFP) which present both interfaces on a single PCI location
+        if len(out.split()) > 1 and self.default_driver in ['mlx4_core', 'nfp']:
             self.intf_name = out.split()[0]
             self.intf2_name = out.split()[1]