[PATCH v5 3/4] dts: add set portlist command to testpmd shell
Dean Marx
dmarx at iol.unh.edu
Fri Nov 7 22:50:17 CET 2025
Add a command to the testpmd shell for setting the portlist
(list of forwarding ports) within a testpmd session. This
allows for changing the forwarding order between ports.
Signed-off-by: Dean Marx <dmarx at iol.unh.edu>
---
dts/api/testpmd/__init__.py | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/dts/api/testpmd/__init__.py b/dts/api/testpmd/__init__.py
index 6d70927660..e990c582e3 100644
--- a/dts/api/testpmd/__init__.py
+++ b/dts/api/testpmd/__init__.py
@@ -1429,6 +1429,23 @@ def set_queue_mbuf_fast_free(
f"Failed to get offload config on port {port_id}, queue {queue_id}:\n{output}"
)
+ def set_portlist(self, order: list[int], verify: bool = True) -> None:
+ """Sets the order of forwarding ports.
+
+ Args:
+ order: List of integers representing the desired port ordering.
+ verify: If :data:`True` the output of the command will be scanned in an attempt to
+ verify that the portlist was successfully set.
+
+ Raises:
+ InteractiveCommandExecutionError: If the portlist could not be set.
+ """
+ order_list = ",".join(map(str, order))
+ portlist_output = self.send_command(f"set portlist {order_list}")
+ if verify:
+ if "Invalid port" in portlist_output:
+ raise InteractiveCommandExecutionError(f"Invalid port in order {order_list}")
+
@_requires_started_ports
def get_offload_config(
self,
--
2.51.0
More information about the dev
mailing list