From patchwork Mon Nov 13 20:28:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 134181 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4D81C4331E; Mon, 13 Nov 2023 21:29:14 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3E54040693; Mon, 13 Nov 2023 21:28:56 +0100 (CET) Received: from mail-lf1-f99.google.com (mail-lf1-f99.google.com [209.85.167.99]) by mails.dpdk.org (Postfix) with ESMTP id A39E6402DA for ; Mon, 13 Nov 2023 21:28:52 +0100 (CET) Received: by mail-lf1-f99.google.com with SMTP id 2adb3069b0e04-50a80241f39so2300312e87.3 for ; Mon, 13 Nov 2023 12:28:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1699907332; x=1700512132; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rxomyntegdrXYkBv8b690HuDHshTcpLqZU8Wlt/jce4=; b=L7WkDm/AWsdB4mA1uAY60OO5RsTlSQaWMff0jDmPCKy3vY/FW6cDexcmB4gQma/Yuo XepsDm+9LiHy9hqDwnB9UvYiUBq356Jxb/5mYZUIqIj0Av02IpDqM4glRlcfQ/tL+8W0 TTCatC+tiuY4SUPXifxx2yjwPlgvS9WTMb0R4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699907332; x=1700512132; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rxomyntegdrXYkBv8b690HuDHshTcpLqZU8Wlt/jce4=; b=KcoZkApbAUwxPak/mfI6tCUCfgGKTLrHkweULac3IDu9s4E+OJ7pdujVLuPg1lCZ1K a97KCkKCRVIP43jWQzgum25SnmtpXOat6BhCXTk4WvTh6Vt5k3l8AsYIasPQItw/pvg6 OX0qHtexDezhLMOdjTrgZg++5bCZg/iutMo2S1e2kCHEEsCUYOWQunOhG8ITuyG9EuJN VA69MGEM6cosXXrvkY4UsxpYXftSECRkT6JdGRQZcFL3aTW0Lfbdv4+PBp/n4DNMRyHR QM67vJP8iORfV9PKqAdxZ2RLE3w1fgksPpIqpXo2ZDiqbv7NseYdhVzQB7lzTXIwalVw /QGw== X-Gm-Message-State: AOJu0YxQ1NkSMbTrEmveah9+pz0Lvl4N2dWwhqfs/d2PK+xStPxo7SDm 0QkNczDLkp55QqHj1P+wY4BUolx/jfyXxT05IyC8fzlnBtwD72kFXjCR73b5klzHvQ== X-Google-Smtp-Source: AGHT+IG1nlg+5IT2cNBZS/2pOpoWa8p6HLBb4vbsnGVYbAYZKKKBcEuqWe9Ywp9Ifx5snBENqT8UlOE2FOU0 X-Received: by 2002:ac2:4198:0:b0:509:2b82:385c with SMTP id z24-20020ac24198000000b005092b82385cmr5220716lfh.61.1699907332037; Mon, 13 Nov 2023 12:28:52 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [2606:4100:3880:1234::84]) by smtp-relay.gmail.com with ESMTPS id l9-20020a170906414900b0099da0f859f4sm1788409ejk.28.2023.11.13.12.28.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Nov 2023 12:28:52 -0800 (PST) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1271:90f9:1b64:f6e6:867f]) by postal.iol.unh.edu (Postfix) with ESMTP id 04CF7605C344; Mon, 13 Nov 2023 15:28:51 -0500 (EST) From: jspewock@iol.unh.edu To: Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, thomas@monjalon.net, wathsala.vithanage@arm.com, probb@iol.unh.edu, paul.szczepanek@arm.com, yoan.picchi@foss.arm.com, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v3 4/7] dts: allow passing parameters into interactive apps Date: Mon, 13 Nov 2023 15:28:09 -0500 Message-ID: <20231113202833.12900-5-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231113202833.12900-1-jspewock@iol.unh.edu> References: <20231113202833.12900-1-jspewock@iol.unh.edu> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Jeremy Spewock Modified interactive applications to allow for the ability to pass parameters into the app on start up. Also modified the way EAL parameters are handled so that the trailing "--" separator is added be default after all EAL parameters. Signed-off-by: Jeremy Spewock --- dts/framework/remote_session/remote/testpmd_shell.py | 2 +- dts/framework/testbed_model/sut_node.py | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/dts/framework/remote_session/remote/testpmd_shell.py b/dts/framework/remote_session/remote/testpmd_shell.py index 3ea16c7ab3..3f6a86aa35 100644 --- a/dts/framework/remote_session/remote/testpmd_shell.py +++ b/dts/framework/remote_session/remote/testpmd_shell.py @@ -32,7 +32,7 @@ def _start_application( self, get_privileged_command: Callable[[str], str] | None ) -> None: """See "_start_application" in InteractiveShell.""" - self._app_args += " -- -i" + self._app_args += " -i" super()._start_application(get_privileged_command) def get_devices(self) -> list[TestPmdDevice]: diff --git a/dts/framework/testbed_model/sut_node.py b/dts/framework/testbed_model/sut_node.py index 4161d3a4d5..bcac939e72 100644 --- a/dts/framework/testbed_model/sut_node.py +++ b/dts/framework/testbed_model/sut_node.py @@ -377,7 +377,8 @@ def create_interactive_shell( shell_cls: Type[InteractiveShellType], timeout: float = SETTINGS.timeout, privileged: bool = False, - eal_parameters: EalParameters | str | None = None, + eal_parameters: EalParameters | str = "", + app_parameters: str = "", ) -> InteractiveShellType: """Factory method for creating a handler for an interactive session. @@ -392,12 +393,14 @@ def create_interactive_shell( eal_parameters: List of EAL parameters to use to launch the app. If this isn't provided or an empty string is passed, it will default to calling create_eal_parameters(). + app_parameters: Additional arguments to pass into the application on the + command-line. Returns: Instance of the desired interactive application. """ - if not eal_parameters: + if not eal_parameters and shell_cls.dpdk_app: eal_parameters = self.create_eal_parameters() - + eal_parameters = f"{eal_parameters} --" # We need to append the build directory for DPDK apps if shell_cls.dpdk_app: shell_cls.path = self.main_session.join_remote_path( @@ -405,7 +408,7 @@ def create_interactive_shell( ) return super().create_interactive_shell( - shell_cls, timeout, privileged, str(eal_parameters) + shell_cls, timeout, privileged, f"{eal_parameters} {app_parameters}" ) def bind_ports_to_driver(self, for_dpdk: bool = True) -> None: