[1/2] dts: add blocked ports to EalParams

Message ID 20240625123611.1474204-2-luca.vizzarro@arm.com (mailing list archive)
State Superseded, archived
Delegated to: Paul Szczepanek
Headers
Series dts: add blocklist test suite |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Luca Vizzarro June 25, 2024, 12:36 p.m. UTC
Make the "ports" attribute of EalParams as it actually is to
"allowed_ports", and add "blocked_ports".

Signed-off-by: Luca Vizzarro <luca.vizzarro@arm.com>
Reviewed-by: Paul Szczepanek <paul.szczepanek@arm.com>
---
 dts/framework/params/eal.py                   | 6 +++++-
 dts/framework/params/types.py                 | 3 ++-
 dts/framework/remote_session/dpdk_shell.py    | 4 ++--
 dts/framework/remote_session/testpmd_shell.py | 2 +-
 4 files changed, 10 insertions(+), 5 deletions(-)
  

Comments

Dean Marx Sept. 9, 2024, 7:17 p.m. UTC | #1
On Tue, Jun 25, 2024 at 8:38 AM Luca Vizzarro <luca.vizzarro@arm.com> wrote:

> Make the "ports" attribute of EalParams as it actually is to
> "allowed_ports", and add "blocked_ports".
>
> Signed-off-by: Luca Vizzarro <luca.vizzarro@arm.com>
> Reviewed-by: Paul Szczepanek <paul.szczepanek@arm.com>
>

Reviewed-by: Dean Marx <dmarx@iol.unh.edu>
  
Patrick Robb Sept. 11, 2024, 12:13 a.m. UTC | #2
Reviewed-by: Patrick Robb <probb@iol.unh.edu>
  

Patch

diff --git a/dts/framework/params/eal.py b/dts/framework/params/eal.py
index 8d7766fefc..b893d874a7 100644
--- a/dts/framework/params/eal.py
+++ b/dts/framework/params/eal.py
@@ -42,9 +42,13 @@  class EalParams(Params):
     vdevs: list[VirtualDevice] | None = field(
         default=None, metadata=Params.multiple() | Params.long("vdev")
     )
-    ports: list[Port] | None = field(
+    allowed_ports: list[Port] | None = field(
         default=None,
         metadata=Params.convert_value(_port_to_pci) | Params.multiple() | Params.short("a"),
     )
+    blocked_ports: list[Port] | None = field(
+        default=None,
+        metadata=Params.convert_value(_port_to_pci) | Params.multiple() | Params.short("b"),
+    )
     other_eal_param: Params | None = None
     _separator: Literal[True] = field(default=True, init=False, metadata=Params.short("-"))
diff --git a/dts/framework/params/types.py b/dts/framework/params/types.py
index e668f658d8..0a4179fdd0 100644
--- a/dts/framework/params/types.py
+++ b/dts/framework/params/types.py
@@ -49,7 +49,8 @@  class EalParamsDict(TypedDict, total=False):
     prefix: str
     no_pci: Switch
     vdevs: list[VirtualDevice] | None
-    ports: list[Port] | None
+    allowed_ports: list[Port] | None
+    blocked_ports: list[Port] | None
     other_eal_param: Params | None
 
 
diff --git a/dts/framework/remote_session/dpdk_shell.py b/dts/framework/remote_session/dpdk_shell.py
index 296639f37d..6b4cec2466 100644
--- a/dts/framework/remote_session/dpdk_shell.py
+++ b/dts/framework/remote_session/dpdk_shell.py
@@ -54,8 +54,8 @@  def compute_eal_params(
         sut_node.dpdk_prefix_list.append(prefix)
     params.prefix = prefix
 
-    if params.ports is None:
-        params.ports = sut_node.ports
+    if params.allowed_ports is None:
+        params.allowed_ports = sut_node.ports
 
     return params
 
diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py
index ec22f72221..baa773ed70 100644
--- a/dts/framework/remote_session/testpmd_shell.py
+++ b/dts/framework/remote_session/testpmd_shell.py
@@ -638,7 +638,7 @@  def start(self, verify: bool = True) -> None:
                 self._logger.debug(f"Failed to start packet forwarding: \n{start_cmd_output}")
                 raise InteractiveCommandExecutionError("Testpmd failed to start packet forwarding.")
 
-            number_of_ports = len(self._app_params.ports or [])
+            number_of_ports = len(self._app_params.allowed_ports or [])
             for port_id in range(number_of_ports):
                 if not self.wait_link_status_up(port_id):
                     raise InteractiveCommandExecutionError(