[dts] [PATCH] dut.py: sort port list to ensure RRC nics will be configured correctly

Ding Heng hengx.ding at intel.com
Tue Apr 12 03:38:01 CEST 2016


Signed-off-by: Ding Heng <hengx.ding at intel.com>

diff --git a/framework/dut.py b/framework/dut.py
index bd437cb..291fef0 100644
--- a/framework/dut.py
+++ b/framework/dut.py
@@ -627,6 +627,20 @@ class Dut(Crb):
         """
         Scan ports information or just read it from cache file.
         """
+        #sort ports and ensure that first port of RRC nics will be
+        #initialized first
+        sorted_ports = []
+        ports_cfg = self.conf.get_ports_config()
+        for port_cfg_all in ports_cfg.keys():
+            if 'tp_path' in ports_cfg[port_cfg_all].keys():
+                for port in self.pci_devices_info:
+                    sorted_port = [port]
+                    if port_cfg_all in port:
+                        self.pci_devices_info.remove(port)
+                        for i in self.pci_devices_info:
+                            sorted_port.append(i)
+        self.pci_devices_info = sorted_port
+
         if self.read_cache:
             self.load_serializer_ports()
             self.scan_ports_cached()
-- 
1.9.3



More information about the dts mailing list