<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:arial,sans-serif"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 8, 2024 at 6:52 AM Juraj Linkeš <juraj.linkes@pantheon.tech> 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">On Wed, Jan 3, 2024 at 11:33 PM <<a href="mailto:jspewock@iol.unh.edu" target="_blank">jspewock@iol.unh.edu</a>> wrote:<br>
><br>
> From: Jeremy Spewock <<a href="mailto:jspewock@iol.unh.edu" target="_blank">jspewock@iol.unh.edu</a>><br>
><br>
> Changed the factory method for creating interactive apps in the SUT Node<br>
> so that EAL parameters would only be passed into DPDK apps since<br>
> non-DPDK apps wouldn't be able to process them. Also modified<br>
> interactive apps to allow for the ability to pass parameters into the<br>
> app on startup so that the applications can be started with certain<br>
> configuration steps passed on the command line.<br>
><br>
> Signed-off-by: Jeremy Spewock <<a href="mailto:jspewock@iol.unh.edu" target="_blank">jspewock@iol.unh.edu</a>><br>
> ---<br>
><br>
> I ended up reverting part of this back to making the argument for<br>
> eal_parameters allowed to be a string. This was because it was casuing<br>
> mypy errors where the method signatures of sut_node did not match with<br>
> that of node.<br>
><br>
<br>
This is because the signatures don't actually match :-)<br>
<br>
The eal_parameters parameter is added on not top of what's in the base<br>
methods. I suggest we move eal_parameters to the end and then we don't<br>
need to allow str for eal_parameters.<br>
<br>
> dts/framework/remote_session/testpmd_shell.py | 2 +-<br>
> dts/framework/testbed_model/sut_node.py | 14 +++++++++-----<br>
> 2 files changed, 10 insertions(+), 6 deletions(-)<br>
><br>
> diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py<br>
> index f310705fac..8f40e8f40e 100644<br>
> --- a/dts/framework/remote_session/testpmd_shell.py<br>
> +++ b/dts/framework/remote_session/testpmd_shell.py<br>
> @@ -118,7 +118,7 @@ def _start_application(self, get_privileged_command: Callable[[str], str] | None<br>
> Also find the number of pci addresses which were allowed on the command line when the app<br>
> was started.<br>
> """<br>
> - self._app_args += " -- -i --mask-event intr_lsc"<br>
> + self._app_args += " -i --mask-event intr_lsc"<br>
> self.number_of_ports = self._app_args.count("-a ")<br>
> super()._start_application(get_privileged_command)<br>
><br>
> diff --git a/dts/framework/testbed_model/sut_node.py b/dts/framework/testbed_model/sut_node.py<br>
> index c4acea38d1..4df18bc183 100644<br>
> --- a/dts/framework/testbed_model/sut_node.py<br>
> +++ b/dts/framework/testbed_model/sut_node.py<br>
> @@ -431,6 +431,7 @@ def create_interactive_shell(<br>
> timeout: float = SETTINGS.timeout,<br>
> privileged: bool = False,<br>
> eal_parameters: EalParameters | str | None = None,<br>
> + app_parameters: str = "",<br>
<br>
What I meant above is we should move app_parameters before<br>
eal_parameters and then we can remove the str type of eal_parameters.<br></blockquote><div><br></div><div><div style="font-family:arial,sans-serif" class="gmail_default">Sounds good to me, I'll move these around in the next version.<br></div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> ) -> InteractiveShellType:<br>
> """Extend the factory for interactive session handlers.<br>
><br>
> @@ -449,20 +450,23 @@ def create_interactive_shell(<br>
> eal_parameters: List of EAL parameters to use to launch the app. If this<br>
> isn't provided or an empty string is passed, it will default to calling<br>
> :meth:`create_eal_parameters`.<br>
> + app_parameters: Additional arguments to pass into the application on the<br>
> + command-line.<br>
><br>
> Returns:<br>
> An instance of the desired interactive application shell.<br>
> """<br>
> - if not eal_parameters:<br>
> - eal_parameters = self.create_eal_parameters()<br>
> -<br>
> - # We need to append the build directory for DPDK apps<br>
> + # We need to append the build directory and add EAL parameters for DPDK apps<br>
> if shell_cls.dpdk_app:<br>
> + if not eal_parameters:<br>
> + eal_parameters = self.create_eal_parameters()<br>
> + app_parameters = f"{eal_parameters} -- {app_parameters}"<br>
> +<br>
> shell_cls.path = self.main_session.join_remote_path(<br>
> self.remote_dpdk_build_dir, shell_cls.path<br>
> )<br>
><br>
> - return super().create_interactive_shell(shell_cls, timeout, privileged, str(eal_parameters))<br>
> + return super().create_interactive_shell(shell_cls, timeout, privileged, app_parameters)<br>
><br>
> def bind_ports_to_driver(self, for_dpdk: bool = True) -> None:<br>
> """Bind all ports on the SUT to a driver.<br>
> --<br>
> 2.43.0<br>
><br>
</blockquote></div></div>