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 1EDAC45920; Fri, 6 Sep 2024 18:52:28 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 101C142FB1; Fri, 6 Sep 2024 18:52:28 +0200 (CEST) Received: from mail-oa1-f98.google.com (mail-oa1-f98.google.com [209.85.160.98]) by mails.dpdk.org (Postfix) with ESMTP id 6A03242FAF for ; Fri, 6 Sep 2024 18:52:26 +0200 (CEST) Received: by mail-oa1-f98.google.com with SMTP id 586e51a60fabf-277e6be2ef6so1206898fac.0 for ; Fri, 06 Sep 2024 09:52:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1725641545; x=1726246345; 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=WJgBWFYqULY2wPTy4FRvmXGhThb1svCGE0QdilBbRUo=; b=GOxgPWoZ941mA/vIGvXLb9pQwQS5698W8IGBrcoxy+JiAm8DxNz1GkA/TXfvzOSPw3 92dN6uNUwEVbvKsJm+LRF5u3DrXPnONuPcATXh3iM+VvGtXLFqV3T3wXJbw+lfkmPZjc lGJgmR6Puy1Wu7t+io8OhVoS5dyM1K4fTxAbQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725641545; x=1726246345; 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=WJgBWFYqULY2wPTy4FRvmXGhThb1svCGE0QdilBbRUo=; b=S/W8e6fSw5pI0SBOucpNvEMgs/N34N/uURqq+Q9tMow494Z3etPuiNWPendxusEyTu DM/W7pVb1YpHqh+e0etQjLdZkSVrBme7ZKex7tryYaQVwhxYf+AWgCclp1G06MxRszxu em8MebNozIX9KOHRSnTSCyCNmvU8U68xebphUPP3BVHR7KsAJzgc6ik8odh+RvmcDrR/ 8t9Gg6NytLhwRzBiewZQGms5XpmNy683zfz1xk3sn7LacRXxSVJHmqAhjcfg+ncf0Vh4 3/dMC6VhhWO5DjnrZF6Q4gx9w20ONMAU90/m5NDW7DgAZ9df25+ofwnysMZCkOZdUacK goMw== X-Gm-Message-State: AOJu0YyyOp/cmkcRQEUuw+eeKN1MJAmElb6kHBTP+rMJTX7jLjD0Hlo9 ebcqeY6dmRa95xWWHrANaR3is+pL7ivC4NIoYyV2vY0iLTpRvkRr4Q7im4nTNaq0I7gQmCJe2v4 mbCe/tMJbOrZUvlXSAR/nRKR3W3tJIi/WljEFc3kr45wTtt35 X-Google-Smtp-Source: AGHT+IGj7HvbvxXdtlKkwlbU+FmujbYt4PdBDrttW+b6z8NlphqQxy7NCYd1XjUVhPtMYj8Ncte/gwdf/v2W X-Received: by 2002:a05:6870:5254:b0:277:fdce:675c with SMTP id 586e51a60fabf-27b82df8b31mr3685801fac.15.1725641545242; Fri, 06 Sep 2024 09:52:25 -0700 (PDT) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [2606:4100:3880:1234::84]) by smtp-relay.gmail.com with ESMTPS id 586e51a60fabf-2781f4b6e6dsm344003fac.19.2024.09.06.09.52.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Sep 2024 09:52:25 -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 1922D6050A6D; Fri, 6 Sep 2024 12:52:24 -0400 (EDT) From: jspewock@iol.unh.edu To: npratte@iol.unh.edu, juraj.linkes@pantheon.tech, Honnappa.Nagarahalli@arm.com, wathsala.vithanage@arm.com, alex.chapman@arm.com, probb@iol.unh.edu, paul.szczepanek@arm.com, yoan.picchi@foss.arm.com, Luca.Vizzarro@arm.com, thomas@monjalon.net Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v2 1/2] dts: add ability to modify number of queues on a port to testpmd Date: Fri, 6 Sep 2024 12:51:50 -0400 Message-ID: <20240906165151.14668-2-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240906165151.14668-1-jspewock@iol.unh.edu> References: <20240806185631.335737-1-jspewock@iol.unh.edu> <20240906165151.14668-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-143033 ("dts: add text parser for testpmd verbose output") Depends-on: patch-143385 ("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 bac5791a00..586a48fe87 100644 --- a/dts/framework/remote_session/testpmd_shell.py +++ b/dts/framework/remote_session/testpmd_shell.py @@ -1450,6 +1450,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.46.0