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 1A06445A3B; Thu, 26 Sep 2024 21:50:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C1AC4402A7; Thu, 26 Sep 2024 21:49:58 +0200 (CEST) Received: from mail-vk1-f227.google.com (mail-vk1-f227.google.com [209.85.221.227]) by mails.dpdk.org (Postfix) with ESMTP id B48E14003C for ; Thu, 26 Sep 2024 21:49:56 +0200 (CEST) Received: by mail-vk1-f227.google.com with SMTP id 71dfb90a1353d-50313dc6d74so399959e0c.2 for ; Thu, 26 Sep 2024 12:49:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1727380196; x=1727984996; 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=7vVC0cgYPhWmTCszvUxPbWUjUciMh2PP6+FTjtQYVH0=; b=jWv7KfCjEybG621eczEundtJXaKUtodn3ouft/sty/z235JigU9HO40dNzcQ3Je//x 9MKf/fsQF/E94AJPo/nBEKHeqiZUKiMu2B5XnFyQNzcF82jyccRlIgdqXMQAgGyawe3r 8xy/sR41IzCb8Dig6Ueek4ukRjl7UTlLJRRKI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727380196; x=1727984996; 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=7vVC0cgYPhWmTCszvUxPbWUjUciMh2PP6+FTjtQYVH0=; b=WaKi9YrcJa76EU0NcJ540XYcgAIzKKaT3GTQnfmsG5OvtUxkoybbj0dVW3nYqLxRE6 j+bhjfUUtpnDt/937xcfjEx9lK/m6GVpI+30faHPzAjPA5thfyqFhkYCaRWN4DWIEad7 b2vOOoKnENTSyGjvHeNwXQ5PoqaOyn7ibV6x9vJ7Ia6SHeE3A5yC9U1JeHdZpUDTejIQ R8K3pKBXqghXzZ4e8InHvpjHgEwdET2X4rQHH+tbYCjglLGelarvcKYKrllUtNA9CnNB jYCNWe944BhPNQm5VG/WkARiWT+AlubpfoQ0QVqkShr5LTy0UCZ2myRX/i02drZxd9ng 6XKw== X-Gm-Message-State: AOJu0Yy9ESsuwLZ0G2mvY+RRPwHX7zCa+EZKK/8VVeEzU+rT9nju5W1i AccMNqaozH6FU1eJPd95e8GkGD+Iki25jlFjH06c/b2qyLSCpl7HoKDiXXTQFE98rDwzuhSl88b fEVkGcb/z/xOkrruNoiIMQ73KKPxiTjfM X-Google-Smtp-Source: AGHT+IEpm6s4Pk1RkOY/gF3cQFsWbGBIoJnLalgRG+ZTfAz5mhny4Hz/+yGIf3nSKyyZ6YkAj5Hu7wrSxeBd X-Received: by 2002:a05:6122:1ad3:b0:4f2:a973:8ae with SMTP id 71dfb90a1353d-507816dea7bmr833672e0c.5.1727380195954; Thu, 26 Sep 2024 12:49:55 -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-6cb3b682e26sm174976d6.49.2024.09.26.12.49.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Sep 2024 12:49:55 -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 1BF39605C352; Thu, 26 Sep 2024 15:49:55 -0400 (EDT) From: jspewock@iol.unh.edu To: alex.chapman@arm.com, paul.szczepanek@arm.com, juraj.linkes@pantheon.tech, thomas@monjalon.net, npratte@iol.unh.edu, probb@iol.unh.edu, Luca.Vizzarro@arm.com, wathsala.vithanage@arm.com, Honnappa.Nagarahalli@arm.com, yoan.picchi@foss.arm.com Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v3 1/2] dts: add ability to modify number of queues on a port to testpmd Date: Thu, 26 Sep 2024 15:49:40 -0400 Message-ID: <20240926194941.17582-2-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240926194941.17582-1-jspewock@iol.unh.edu> References: <20240806185631.335737-1-jspewock@iol.unh.edu> <20240926194941.17582-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. Signed-off-by: Jeremy Spewock --- Depends-on: patch-144270 ("dts: add VLAN methods to testpmd shell") Depends-on: patch-144458 ("dts: add text parser for testpmd verbose output") 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 893cf7255c..4325a7d9c5 100644 --- a/dts/framework/remote_session/testpmd_shell.py +++ b/dts/framework/remote_session/testpmd_shell.py @@ -1713,6 +1713,42 @@ def extract_verbose_output(output: str) -> list[TestPmdVerbosePacket]: out.append(TestPmdVerbosePacket.parse(f"{prev_header}\n{match.group('PACKET')}")) return out + 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.stop_all_ports(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.start_all_ports(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.46.0