<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Wed, Apr 23, 2025 at 3:40 PM Nicholas Pratte <<a href="mailto:npratte@iol.unh.edu">npratte@iol.unh.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Implement the TREX traffic generator for use in the DTS framework. The<br>
provided implementation leverages TREX's stateless API automation<br>
library, via use of a Python shell. As such, version control of TREX may<br>
be needed. The DTS context has been modified to include a performance<br>
traffic generator in addition to a functional traffic generator.<br></blockquote><div><br></div><div>I think the statement is that only certain versions are confirmed to work off of your implementation? I think usage of the term version control is confusing since we are just talking about using particular versions of TREX, and not using a "version control" tool like git. This is more about listing approved versions of the dependency for the TG.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
         dpdk_build_env = DPDKBuildEnvironment(config.dpdk.build, sut_node)<br>
         dpdk_runtime_env = DPDKRuntimeEnvironment(config.dpdk, sut_node, dpdk_build_env)<br>
-        traffic_generator = create_traffic_generator(config.traffic_generator, tg_node)<br>
+        # There is definitely a better way to do this.<br>
+        tg_dpdk_runtime_env = None<br>
+        if (<br>
+            config.perf_traffic_generator.type == TrafficGeneratorType.TREX<br>
+            or config.func_traffic_generator.type == TrafficGeneratorType.TREX<br>
+        ):<br></blockquote><div><br></div><div>We have this from the testrun config</div><div><br></div><div>perf: false # disable performance testing<br>func: true # enable functional testing</div><div><br></div><div>So, use if testrunconfig.perf == true?</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
+<br>
+@dataclass<br>
+class TrexPerformanceStats(PerformanceTrafficStats):<br>
+    """Data structure to store performance statistics for a given test run.<br>
+<br>
+    Attributes:<br>
+        packet: The packet that was sent in the test run.<br>
+        frame_size: The total length of the frame. (L2 downward)<br>
+        tx_expected_bps: The expected bits per second on a given NIC.<br>
+        tx_expected_cps: ...<br></blockquote><div><br></div><div>"The expected connections per second" ? I think you just missed this one.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
+<br>
+        Attributes:<br>
+            ports: Related ports utilized in TG instance.<br>
+        """<br>
+        super().setup(ports)<br>
+        # Start TREX server process.<br>
+        try:<br>
+            self._<a href="http://logger.info" rel="noreferrer" target="_blank">logger.info</a>("Starting TREX server process: sending 45 second sleep.")<br>
+            privileged_command = self._os_session._get_privileged_command(<br>
+                f"""<br>
+                    cd /opt/v3.03/; {self._tg_config.remote_path}/t-rex-64<br>
+                     --cfg {self._tg_config.config} -i<br>
+                """<br></blockquote><div><br></div><div>I know this was just a work in progress for RFC with some hardcoding, but you already have tg_config.remote_path, right? So, the leading hardcoded cd does not do anything, and even if you had to cd there you could use the tg_config.remote_path?</div><div><br></div><div>Reviewed-by: Patrick Robb <<a href="mailto:probb@iol.unh.edu">probb@iol.unh.edu</a>> </div></div></div>