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 <jspewock@iol.unh.edu>
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 [thread overview]
Message-ID: <20240926194941.17582-2-jspewock@iol.unh.edu> (raw)
In-Reply-To: <20240926194941.17582-1-jspewock@iol.unh.edu>
From: Jeremy Spewock <jspewock@iol.unh.edu>
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 <jspewock@iol.unh.edu>
---
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
next prev parent reply other threads:[~2024-09-26 19:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-06 18:56 [RFC PATCH v1 0/3] dts: pf_smoke port jspewock
2024-08-06 18:56 ` [RFC PATCH v1 1/3] dts: add ability to modify number of queues on a port to testpmd jspewock
2024-08-06 18:56 ` [RFC PATCH v1 2/3] dts: add pf smoke testing suite jspewock
2024-08-06 18:56 ` [RFC PATCH v1 3/3] dts: added pf_smoke_tests to yaml schema jspewock
2024-09-06 16:51 ` [PATCH v2 0/2] dts: pf_smoke port jspewock
2024-09-06 16:51 ` [PATCH v2 1/2] dts: add ability to modify number of queues on a port to testpmd jspewock
2024-09-06 16:51 ` [PATCH v2 2/2] dts: add pf smoke testing suite jspewock
2024-09-26 19:49 ` [PATCH v3 0/2] dts: pf_smoke port jspewock
2024-09-26 19:49 ` jspewock [this message]
2024-09-26 19:49 ` [PATCH v3 2/2] dts: add pf smoke testing suite jspewock
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240926194941.17582-2-jspewock@iol.unh.edu \
--to=jspewock@iol.unh.edu \
--cc=Honnappa.Nagarahalli@arm.com \
--cc=Luca.Vizzarro@arm.com \
--cc=alex.chapman@arm.com \
--cc=dev@dpdk.org \
--cc=juraj.linkes@pantheon.tech \
--cc=npratte@iol.unh.edu \
--cc=paul.szczepanek@arm.com \
--cc=probb@iol.unh.edu \
--cc=thomas@monjalon.net \
--cc=wathsala.vithanage@arm.com \
--cc=yoan.picchi@foss.arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).