From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C4968454EF; Tue, 25 Jun 2024 14:38:39 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 57347427CA; Tue, 25 Jun 2024 14:38:36 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id 703CF402D0 for ; Tue, 25 Jun 2024 14:36:47 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A4286DA7; Tue, 25 Jun 2024 05:37:11 -0700 (PDT) Received: from localhost.localdomain (unknown [10.57.74.179]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 20B263F766; Tue, 25 Jun 2024 05:36:45 -0700 (PDT) From: Luca Vizzarro To: dev@dpdk.org Cc: Luca Vizzarro , Paul Szczepanek Subject: [PATCH 1/2] dts: add blocked ports to EalParams Date: Tue, 25 Jun 2024 13:36:10 +0100 Message-Id: <20240625123611.1474204-2-luca.vizzarro@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240625123611.1474204-1-luca.vizzarro@arm.com> References: <20240625123611.1474204-1-luca.vizzarro@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Make the "ports" attribute of EalParams as it actually is to "allowed_ports", and add "blocked_ports". Signed-off-by: Luca Vizzarro Reviewed-by: Paul Szczepanek --- dts/framework/params/eal.py | 6 +++++- dts/framework/params/types.py | 3 ++- dts/framework/remote_session/dpdk_shell.py | 4 ++-- dts/framework/remote_session/testpmd_shell.py | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/dts/framework/params/eal.py b/dts/framework/params/eal.py index 8d7766fefc..b893d874a7 100644 --- a/dts/framework/params/eal.py +++ b/dts/framework/params/eal.py @@ -42,9 +42,13 @@ class EalParams(Params): vdevs: list[VirtualDevice] | None = field( default=None, metadata=Params.multiple() | Params.long("vdev") ) - ports: list[Port] | None = field( + allowed_ports: list[Port] | None = field( default=None, metadata=Params.convert_value(_port_to_pci) | Params.multiple() | Params.short("a"), ) + blocked_ports: list[Port] | None = field( + default=None, + metadata=Params.convert_value(_port_to_pci) | Params.multiple() | Params.short("b"), + ) other_eal_param: Params | None = None _separator: Literal[True] = field(default=True, init=False, metadata=Params.short("-")) diff --git a/dts/framework/params/types.py b/dts/framework/params/types.py index e668f658d8..0a4179fdd0 100644 --- a/dts/framework/params/types.py +++ b/dts/framework/params/types.py @@ -49,7 +49,8 @@ class EalParamsDict(TypedDict, total=False): prefix: str no_pci: Switch vdevs: list[VirtualDevice] | None - ports: list[Port] | None + allowed_ports: list[Port] | None + blocked_ports: list[Port] | None other_eal_param: Params | None diff --git a/dts/framework/remote_session/dpdk_shell.py b/dts/framework/remote_session/dpdk_shell.py index 296639f37d..6b4cec2466 100644 --- a/dts/framework/remote_session/dpdk_shell.py +++ b/dts/framework/remote_session/dpdk_shell.py @@ -54,8 +54,8 @@ def compute_eal_params( sut_node.dpdk_prefix_list.append(prefix) params.prefix = prefix - if params.ports is None: - params.ports = sut_node.ports + if params.allowed_ports is None: + params.allowed_ports = sut_node.ports return params diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py index ec22f72221..baa773ed70 100644 --- a/dts/framework/remote_session/testpmd_shell.py +++ b/dts/framework/remote_session/testpmd_shell.py @@ -638,7 +638,7 @@ def start(self, verify: bool = True) -> None: self._logger.debug(f"Failed to start packet forwarding: \n{start_cmd_output}") raise InteractiveCommandExecutionError("Testpmd failed to start packet forwarding.") - number_of_ports = len(self._app_params.ports or []) + number_of_ports = len(self._app_params.allowed_ports or []) for port_id in range(number_of_ports): if not self.wait_link_status_up(port_id): raise InteractiveCommandExecutionError( -- 2.34.1