[5/5] dts: add testpmd set ports queues

Message ID 20240806121417.2567708-7-Luca.Vizzarro@arm.com (mailing list archive)
State Superseded, archived
Delegated to: Juraj Linkeš
Headers
Series dts: add pktgen and testpmd changes |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation warning apply issues

Commit Message

Luca Vizzarro Aug. 6, 2024, 12:14 p.m. UTC
From: Luca Vizzarro <luca.vizzarro@arm.com>

Add a facility to update the number of TX/RX queues during the runtime
of testpmd.

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

Patch

diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py
index 293c7b9dff..40e850502c 100644
--- a/dts/framework/remote_session/testpmd_shell.py
+++ b/dts/framework/remote_session/testpmd_shell.py
@@ -803,6 +803,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")
+
+        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.