2n-zn2 Epyc backport
[csit.git] / resources / libraries / python / TrafficGenerator.py
index adc95bf..23337b2 100644 (file)
@@ -247,7 +247,6 @@ class TrafficGenerator(AbstractMeasurer):
         )
 
     # TODO: pylint says disable=too-many-locals.
-    # A fix is developed in https://gerrit.fd.io/r/c/csit/+/22221
     def initialize_traffic_generator(
             self, tg_node, tg_if1, tg_if2, tg_if1_adj_node, tg_if1_adj_if,
             tg_if2_adj_node, tg_if2_adj_if, osi_layer, tg_if1_dst_mac=None,
@@ -372,7 +371,8 @@ class TrafficGenerator(AbstractMeasurer):
                 # Configure TRex.
                 ports = ''
                 for port in tg_node[u"interfaces"].values():
-                    ports += f" {port.get(u'pci_address')}"
+                    if u'Mellanox' not in port.get(u'model'):
+                        ports += f" {port.get(u'pci_address')}"
 
                 cmd = f"sh -c \"cd {Constants.TREX_INSTALL_DIR}/scripts/ && " \
                     f"./dpdk_nic_bind.py -u {ports} || true\""
@@ -1091,8 +1091,10 @@ class TrafficGenerator(AbstractMeasurer):
             partial_attempt_count = ctca
             # We do not care whether TG is slow, it should have attempted all.
             expected_attempt_count = self.transaction_scale
-            # TODO: Is there a better packet-based counter?
-            pass_count = self._l7_data[u"server"][u"tcp"][u"connects"]
+            # From TCP point of view, server/connects counts full connections,
+            # but we are testing NAT session so client/connects counts that
+            # (half connections from TCP point of view).
+            pass_count = self._l7_data[u"client"][u"tcp"][u"connects"]
             fail_count = expected_attempt_count - pass_count
         elif self.transaction_type == u"udp_pps":
             if not self.transaction_scale: