[PATCH 2/5] framework/dut: only map ports not already matched

Niklas Söderlund niklas.soderlund at corigine.com
Wed Feb 8 17:46:21 CET 2023


From: Qin Ke <qin.ke at corigine.com>

When NIC has two ports but single PCI address, the function of
map_available_ports_uncached will match both the two dut ports
with the first tester port beacause the two tester ports have the
same PCI address as the only matching condition.

Add support for it by only mapping ports not already matched. It
ignores the tester port which has been matched and added to dut
ports map, then the second tester port can be matched correctly.

Signed-off-by: Qin Ke <qin.ke at corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund at corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he at corigine.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund at corigine.com>
---
 framework/dut.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/framework/dut.py b/framework/dut.py
index eb988ac3e265..df6986ed450c 100644
--- a/framework/dut.py
+++ b/framework/dut.py
@@ -1249,7 +1249,7 @@ class Dut(Crb):
                             break
                     elif (
                         self.tester.ports_info[remotePort]["pci"].lower()
-                        == peer.lower()
+                        == peer.lower() and hits[remotePort] == False
                     ):
                         hits[remotePort] = True
                         self.ports_map[dutPort] = remotePort
-- 
2.39.1



More information about the dts mailing list