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 DC58E45752; Tue, 6 Aug 2024 20:56:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BC76040A89; Tue, 6 Aug 2024 20:56:53 +0200 (CEST) Received: from mail-qv1-f98.google.com (mail-qv1-f98.google.com [209.85.219.98]) by mails.dpdk.org (Postfix) with ESMTP id C07C340A89 for ; Tue, 6 Aug 2024 20:56:51 +0200 (CEST) Received: by mail-qv1-f98.google.com with SMTP id 6a1803df08f44-6bb5a4668faso5190456d6.2 for ; Tue, 06 Aug 2024 11:56:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1722970611; x=1723575411; 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=Np16Xr33C0CnvNhk8pGO8TRTNEVWLVXX4vlQbl8oKEc=; b=e9NdIYrD6+nvy1Cz0Kvj5jWcidgO0pAIad9NrZVqNz6Y0h2eEGSsqJ2lOUPZgbfryU FPvhgQ69KAcmZa231YqdhrEJP6M0eSiKfuMQl88BqsXlIb5LoCiDtfMXVq60DEEzu1+a cY+jCg9+z5tuMRxdLwnerkibchG3XlJvf9MtQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722970611; x=1723575411; 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=Np16Xr33C0CnvNhk8pGO8TRTNEVWLVXX4vlQbl8oKEc=; b=DWYIcHmEdvfGgy5qGzQ9dU4myPZtRTjSEx1dZ63y1EXsItUN9qloi7B5p7quvVHOW9 iHO/O0bT1x5wws1/ixl+y+V9R+gKqAUG7QK4JMAEhiaf2fU/cwPSVcyFNgcdNVUcjuhr Pr9xdUX6JiknzbfzFnuwVq4OrXLylRwa/5ohHwBwX4ySZv+vrEw91ucpWEqMt+DQPmvA HnhZm1Y1Z2Zxi/LXZLx3WsP65oCnp6adLjksbfaZ3PyHnjwHNl53gAJsTO9uvHNPDMS8 ZLOJGaqUyK4zVCW8rmwVyVbSc4MI2J9fU1+xCqR8/Nd/LJSpjMyKjKU2+WlCRmGfv2oH 7Dgg== X-Gm-Message-State: AOJu0Yx5vink8lsUhEfgxWouLiqCylesHBV1uZp36G5feJSe3Q5oAzlH 7Leyrxiz/D3aIcgGjtnUhB+Hf7BT4SEWY0N1Ru+bpV+13iNwzK8/GP1tDQXUeVwbQNIsrux/l/m PE4os4WcceN0DDh1L4PJya10UUESnm52j X-Google-Smtp-Source: AGHT+IELv48LS1Wpp+a5wxhKWQ7RMFadWM90X3PrYpumCfI+NLMYZSWW3Gb9+peeVVVByH/h8cHaGxUt8NHN X-Received: by 2002:a05:6214:2d44:b0:6b7:aba1:7f79 with SMTP id 6a1803df08f44-6bb98417b16mr164393396d6.39.1722970611076; Tue, 06 Aug 2024 11:56:51 -0700 (PDT) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id 6a1803df08f44-6bb9c76d119sm8262486d6.16.2024.08.06.11.56.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Aug 2024 11:56:51 -0700 (PDT) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1257::1083]) by postal.iol.unh.edu (Postfix) with ESMTP id 4607C605C351; Tue, 6 Aug 2024 14:56:50 -0400 (EDT) From: jspewock@iol.unh.edu To: alex.chapman@arm.com, Luca.Vizzarro@arm.com, Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, paul.szczepanek@arm.com, npratte@iol.unh.edu, probb@iol.unh.edu, yoan.picchi@foss.arm.com, wathsala.vithanage@arm.com, thomas@monjalon.net Cc: dev@dpdk.org, Jeremy Spewock Subject: [RFC PATCH v1 1/3] dts: add ability to modify number of queues on a port to testpmd Date: Tue, 6 Aug 2024 14:56:29 -0400 Message-ID: <20240806185631.335737-2-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806185631.335737-1-jspewock@iol.unh.edu> References: <20240806185631.335737-1-jspewock@iol.unh.edu> 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 From: Jeremy Spewock The ability to change the configuration of a port at runtime is a crucial aspect of DPDK. This patch adds both the steps required to modify the number of queues on a port at runtime and also the verification steps to ensure that the command behaved as expected. Depends-on: patch-142762 ("dts: add text parser for testpmd verbose output") Depends-on: patch-142696 ("dts: add VLAN methods to testpmd shell") Signed-off-by: Jeremy Spewock --- dts/framework/remote_session/testpmd_shell.py | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py index 6bde7f536f..6eb6360bf7 100644 --- a/dts/framework/remote_session/testpmd_shell.py +++ b/dts/framework/remote_session/testpmd_shell.py @@ -1191,6 +1191,42 @@ def set_verbose(self, level: int, verify: bool = True) -> None: f"Testpmd failed to set verbose level to {level}." ) + def set_num_queues_all(self, num_queues: int, is_rx: bool, verify: bool = True) -> None: + """Modify the number of Rx/Tx queues configured on all ports. + + Args: + num_queues: Number of queues to set on all ports. + is_rx: If :data:`True` then the number of Rx queues will be modified, otherwise the + number of Tx queues will be modified. + verify: If :data:`True` then an additional command will be sent to check the info of + `port_id` and verify that the number of queues is equal to `num_queues`. + + Raises: + InteractiveCommandExecutionError: If `verify` is :data:`True` and testpmd failed to + update the number of queues on the ports. + """ + queue_type = "rxq" if is_rx else "txq" + self.port_stop_all(verify=verify) + port_config_output = self.send_command(f"port config all {queue_type} {num_queues}") + # ports have to be started before the output can be verified. + self.port_start_all(verify=verify) + if verify: + all_ports_modified = all( + queues == num_queues + for queues in map( + lambda info: info.rx_queues_num if is_rx else info.tx_queues_num, + self.show_port_info_all(), + ) + ) + if not all_ports_modified: + self._logger.debug( + f"Failed to set number of queues on all ports to " + f"{num_queues}:\n{port_config_output}" + ) + raise InteractiveCommandExecutionError( + "Testpmd failed to update the number of queues on all ports." + ) + def _close(self) -> None: """Overrides :meth:`~.interactive_shell.close`.""" self.stop() -- 2.45.2