DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dean Marx <dmarx@iol.unh.edu>
To: probb@iol.unh.edu, luca.vizzarro@arm.com,
	yoan.picchi@foss.arm.com, Honnappa.Nagarahalli@arm.com,
	paul.szczepanek@arm.com
Cc: dev@dpdk.org, Dean Marx <dmarx@iol.unh.edu>
Subject: [PATCH v5 3/4] dts: add set portlist command to testpmd shell
Date: Fri,  7 Nov 2025 16:50:17 -0500	[thread overview]
Message-ID: <20251107215020.255182-3-dmarx@iol.unh.edu> (raw)
In-Reply-To: <20251107215020.255182-1-dmarx@iol.unh.edu>

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@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


  parent reply	other threads:[~2025-11-07 21:50 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-16 20:04 [PATCH v1 1/2] dts: add start Tx first method " Dean Marx
2025-09-16 20:04 ` [PATCH v1 2/2] dts: add virtio forwarding test suite Dean Marx
2025-09-23 11:38   ` Luca Vizzarro
2025-10-03 18:14     ` Dean Marx
2025-10-09 13:04   ` Patrick Robb
2025-09-23 11:27 ` [PATCH v1 1/2] dts: add start Tx first method to testpmd shell Luca Vizzarro
2025-10-03 19:27 ` [PATCH v2 " Dean Marx
2025-10-03 19:27   ` [PATCH v2 2/2] dts: add virtio forwarding test suite Dean Marx
2025-10-21 15:13     ` Luca Vizzarro
2025-10-21 17:35       ` Dean Marx
2025-10-23 12:59     ` Patrick Robb
2025-10-24 18:38       ` Dean Marx
2025-10-24 17:46   ` [PATCH v3 1/3] dts: add start Tx first method to testpmd shell Dean Marx
2025-10-24 17:46     ` [PATCH v3 2/3] dts: add method for bringing link of interface up Dean Marx
2025-10-24 17:47     ` [PATCH v3 3/3] dts: add virtio forwarding test suite Dean Marx
2025-10-24 18:50     ` [PATCH v4 1/3] dts: add start Tx first method to testpmd shell Dean Marx
2025-10-24 18:50       ` [PATCH v4 2/3] dts: add method for bringing link of interface up Dean Marx
2025-10-24 18:50       ` [PATCH v4 3/3] dts: add virtio forwarding test suite Dean Marx
2025-11-07 20:48         ` Patrick Robb
2025-11-07 21:53           ` Dean Marx
2025-11-07 21:50         ` [PATCH v5 1/4] dts: add start Tx first method to testpmd shell Dean Marx
2025-11-07 21:50           ` [PATCH v5 2/4] dts: add methods for runtime interface config Dean Marx
2025-11-07 21:50           ` Dean Marx [this message]
2025-11-07 21:50           ` [PATCH v5 4/4] dts: add virtio forwarding test suite Dean Marx

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=20251107215020.255182-3-dmarx@iol.unh.edu \
    --to=dmarx@iol.unh.edu \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=dev@dpdk.org \
    --cc=luca.vizzarro@arm.com \
    --cc=paul.szczepanek@arm.com \
    --cc=probb@iol.unh.edu \
    --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).