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

Nicholas Pratte npratte at iol.unh.edu
Thu Nov 7 20:04:54 CET 2024


Hi Luca, this looks good to me! The only thing that needs to be fixed
is the attributes component of the docstring for EalParams in eal.py.
Aside from that:

Reviewed-by: Nicholas Pratte <npratte at iol.unh.edu>

On Thu, Nov 7, 2024 at 9:00 AM Luca Vizzarro <luca.vizzarro at 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 at arm.com>
> Reviewed-by: Paul Szczepanek <paul.szczepanek at 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(-)
>
> diff --git a/dts/framework/params/eal.py b/dts/framework/params/eal.py
> index cf1594353a..71bc781eab 100644
> --- a/dts/framework/params/eal.py
> +++ b/dts/framework/params/eal.py
> @@ -45,9 +45,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 d77c4625fb..87d11502e8 100644
> --- a/dts/framework/params/types.py
> +++ b/dts/framework/params/types.py
> @@ -50,7 +50,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 b39132cc42..82fa4755f0 100644
> --- a/dts/framework/remote_session/dpdk_shell.py
> +++ b/dts/framework/remote_session/dpdk_shell.py
> @@ -56,8 +56,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 8a45a5231b..221465f6fb 100644
> --- a/dts/framework/remote_session/testpmd_shell.py
> +++ b/dts/framework/remote_session/testpmd_shell.py
> @@ -1465,7 +1465,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(
> --
> 2.43.0
>


More information about the dev mailing list