On 6. 8. 2024 14:46, Luca Vizzarro wrote:
Add a facility to update the number of TX/RX queues during the runtime
of testpmd.

Signed-off-by: Luca Vizzarro <luca.vizza...@arm.com>
Reviewed-by: Paul Szczepanek <paul.szczepa...@arm.com>
---
  dts/framework/remote_session/testpmd_shell.py | 16 ++++++++++++++++
  1 file changed, 16 insertions(+)

diff --git a/dts/framework/remote_session/testpmd_shell.py 
b/dts/framework/remote_session/testpmd_shell.py
index ca24b28070..85fbc42696 100644
--- a/dts/framework/remote_session/testpmd_shell.py
+++ b/dts/framework/remote_session/testpmd_shell.py
@@ -805,6 +805,22 @@ def start_all_ports(self, verify: bool = True) -> None:
self.ports_started = True + @requires_stopped_ports
+    def set_ports_queues(self, number_of: int) -> None:
+        """Sets the number of queues per port.
+
+        Args:
+            number_of: The number of RX/TX queues to create per port.
+
+        Raises:
+            InternalError: If `number_of` is invalid.
+        """
+        if number_of < 1:
+            raise InternalError("The number of queues must be positive and 
non-zero")

I don't think we have talked about the message formatting policy, so here's a suggestion: Let's end all exception messages with a dot. This could probably extend to log messages as well. Thomas mentioned in the past that it reads better and I concur - it is an actual sentence.

Also, this being an InternalError, do you think the invalid input could only happen because of something going wrong in DTS? This seems reasonable from the possible usecases.

+
+        self.send_command(f"port config all rxq {number_of}")
+        self.send_command(f"port config all txq {number_of}")
+
      def show_port_info_all(self) -> list[TestPmdPort]:
          """Returns the information of all the ports.

Reply via email to