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 2B90A4600E; Tue, 7 Jan 2025 15:13:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 13C6740BA4; Tue, 7 Jan 2025 15:13:38 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id 8D89040676 for ; Tue, 7 Jan 2025 15:13:36 +0100 (CET) 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 2D6DD1424; Tue, 7 Jan 2025 06:14:04 -0800 (PST) Received: from localhost.localdomain (JR4XG4HTQC.cambridge.arm.com [10.1.38.81]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1BB0A3F59E; Tue, 7 Jan 2025 06:13:34 -0800 (PST) From: Luca Vizzarro To: dev@dpdk.org Cc: Patrick Robb , Luca Vizzarro , Paul Szczepanek Subject: [PATCH] dts: fix MTU set command Date: Tue, 7 Jan 2025 14:11:25 +0000 Message-ID: <20250107141125.2611481-1-luca.vizzarro@arm.com> X-Mailer: git-send-email 2.43.0 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 There are some PMDs that in order to set a scatter-offload-compatible MTU size, they need to have started at least once since the startup of testpmd. This fixes the behaviour of the command to start and stop the ports before changing the MTU to ensure this happened Fixes: 9910db35962b ("dts: add MTU config methods to testpmd shell") Signed-off-by: Luca Vizzarro Reviewed-by: Paul Szczepanek --- Hi there, sending a fix discovered after running pmd_buffer_scatter on Mellanox. Which should just skip, but the capability checks fail. Best, Luca --- dts/framework/remote_session/testpmd_shell.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py index d187eaea94..c01ee74b21 100644 --- a/dts/framework/remote_session/testpmd_shell.py +++ b/dts/framework/remote_session/testpmd_shell.py @@ -1836,13 +1836,16 @@ def csum_set_hw( {port_id}:\n{csum_output}""" ) + @requires_started_ports @requires_stopped_ports def set_port_mtu(self, port_id: int, mtu: int, verify: bool = True) -> None: """Change the MTU of a port using testpmd. Some PMDs require that the port be stopped before changing the MTU, and it does no harm to stop the port before configuring in cases where it isn't required, so ports are stopped - prior to changing their MTU. + prior to changing their MTU. On the other hand, some PMDs require that the port had already + been started once since testpmd startup. Therefore, ports are also started before stopping + them to ensure this has happened. Args: port_id: ID of the port to adjust the MTU on. -- 2.43.0