[v3,6/7] dts: add pci addresses to EAL parameters

Message ID 20231113202833.12900-7-jspewock@iol.unh.edu (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series dts: Port scatter suite over |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Jeremy Spewock Nov. 13, 2023, 8:28 p.m. UTC
  From: Jeremy Spewock <jspewock@iol.unh.edu>

Added allow list to the EAL parameters created in DTS to ensure that
only the relevant PCI devices are considered when launching DPDK
applications.

Signed-off-by: Jeremy Spewock <jspewock@iol.unh.edu>
---
 dts/framework/testbed_model/sut_node.py | 9 +++++++++
 1 file changed, 9 insertions(+)
  

Comments

Juraj Linkeš Nov. 16, 2023, 6:10 p.m. UTC | #1
On Mon, Nov 13, 2023 at 9:28 PM <jspewock@iol.unh.edu> wrote:
>
> From: Jeremy Spewock <jspewock@iol.unh.edu>
>
> Added allow list to the EAL parameters created in DTS to ensure that
> only the relevant PCI devices are considered when launching DPDK
> applications.
>
> Signed-off-by: Jeremy Spewock <jspewock@iol.unh.edu>
> ---
>  dts/framework/testbed_model/sut_node.py | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/dts/framework/testbed_model/sut_node.py b/dts/framework/testbed_model/sut_node.py
> index bcac939e72..f9c7bd9bf3 100644
> --- a/dts/framework/testbed_model/sut_node.py
> +++ b/dts/framework/testbed_model/sut_node.py
> @@ -20,6 +20,7 @@
>  from framework.utils import MesonArgs
>
>  from .hw import LogicalCoreCount, LogicalCoreList, VirtualDevice
> +from .hw.port import Port
>  from .node import Node
>
>
> @@ -31,6 +32,7 @@ def __init__(
>          prefix: str,
>          no_pci: bool,
>          vdevs: list[VirtualDevice],
> +        ports: list[Port],

Please add this to the docstring.

This overlaps with the docstrings patch. I guess we'll need to modify
one of the patches when the other one gets merged.

>          other_eal_param: str,
>      ):
>          """
> @@ -56,6 +58,7 @@ def __init__(
>              self._prefix = f"--file-prefix={prefix}"
>          self._no_pci = "--no-pci" if no_pci else ""
>          self._vdevs = " ".join(f"--vdev {vdev}" for vdev in vdevs)
> +        self._ports = " ".join(f"-a {port.pci}" for port in ports)
>          self._other_eal_param = other_eal_param
>
>      def __str__(self) -> str:
> @@ -65,6 +68,7 @@ def __str__(self) -> str:
>              f"{self._prefix} "
>              f"{self._no_pci} "
>              f"{self._vdevs} "
> +            f"{self._ports} "
>              f"{self._other_eal_param}"
>          )
>
> @@ -308,6 +312,7 @@ def create_eal_parameters(
>          append_prefix_timestamp: bool = True,
>          no_pci: bool = False,
>          vdevs: list[VirtualDevice] = None,
> +        ports: list[Port] | None = None,

Same here.

>          other_eal_param: str = "",
>      ) -> "EalParameters":
>          """
> @@ -350,12 +355,16 @@ def create_eal_parameters(
>          if vdevs is None:
>              vdevs = []
>
> +        if ports is None:
> +            ports = self.ports
> +
>          return EalParameters(
>              lcore_list=lcore_list,
>              memory_channels=self.config.memory_channels,
>              prefix=prefix,
>              no_pci=no_pci,
>              vdevs=vdevs,
> +            ports=ports,
>              other_eal_param=other_eal_param,
>          )
>
> --
> 2.42.0
>
  
Jeremy Spewock Nov. 17, 2023, 5:13 p.m. UTC | #2
On Thu, Nov 16, 2023 at 1:10 PM Juraj Linkeš <juraj.linkes@pantheon.tech>
wrote:

> On Mon, Nov 13, 2023 at 9:28 PM <jspewock@iol.unh.edu> wrote:
> >
> > From: Jeremy Spewock <jspewock@iol.unh.edu>
> >
> > Added allow list to the EAL parameters created in DTS to ensure that
> > only the relevant PCI devices are considered when launching DPDK
> > applications.
> >
> > Signed-off-by: Jeremy Spewock <jspewock@iol.unh.edu>
> > ---
> >  dts/framework/testbed_model/sut_node.py | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/dts/framework/testbed_model/sut_node.py
> b/dts/framework/testbed_model/sut_node.py
> > index bcac939e72..f9c7bd9bf3 100644
> > --- a/dts/framework/testbed_model/sut_node.py
> > +++ b/dts/framework/testbed_model/sut_node.py
> > @@ -20,6 +20,7 @@
> >  from framework.utils import MesonArgs
> >
> >  from .hw import LogicalCoreCount, LogicalCoreList, VirtualDevice
> > +from .hw.port import Port
> >  from .node import Node
> >
> >
> > @@ -31,6 +32,7 @@ def __init__(
> >          prefix: str,
> >          no_pci: bool,
> >          vdevs: list[VirtualDevice],
> > +        ports: list[Port],
>
> Please add this to the docstring.
>
> This overlaps with the docstrings patch. I guess we'll need to modify
> one of the patches when the other one gets merged.
>

Right, this would probably get a little weird with the conflict if one gets
merged before the other. Another option could be copying your docstring
over into this patch as well which might clean it up, but it would sort of
be out of place in this patch. I'll add in the current format for now and
we can change one or the other depending on the order to make sure it
applies.


> >          other_eal_param: str,
> >      ):
> >          """
> > @@ -56,6 +58,7 @@ def __init__(
> >              self._prefix = f"--file-prefix={prefix}"
> >          self._no_pci = "--no-pci" if no_pci else ""
> >          self._vdevs = " ".join(f"--vdev {vdev}" for vdev in vdevs)
> > +        self._ports = " ".join(f"-a {port.pci}" for port in ports)
> >          self._other_eal_param = other_eal_param
> >
> >      def __str__(self) -> str:
> > @@ -65,6 +68,7 @@ def __str__(self) -> str:
> >              f"{self._prefix} "
> >              f"{self._no_pci} "
> >              f"{self._vdevs} "
> > +            f"{self._ports} "
> >              f"{self._other_eal_param}"
> >          )
> >
> > @@ -308,6 +312,7 @@ def create_eal_parameters(
> >          append_prefix_timestamp: bool = True,
> >          no_pci: bool = False,
> >          vdevs: list[VirtualDevice] = None,
> > +        ports: list[Port] | None = None,
>
> Same here.
>

Good catch, I will do the same here.


>
> >          other_eal_param: str = "",
> >      ) -> "EalParameters":
> >          """
> > @@ -350,12 +355,16 @@ def create_eal_parameters(
> >          if vdevs is None:
> >              vdevs = []
> >
> > +        if ports is None:
> > +            ports = self.ports
> > +
> >          return EalParameters(
> >              lcore_list=lcore_list,
> >              memory_channels=self.config.memory_channels,
> >              prefix=prefix,
> >              no_pci=no_pci,
> >              vdevs=vdevs,
> > +            ports=ports,
> >              other_eal_param=other_eal_param,
> >          )
> >
> > --
> > 2.42.0
> >
>
  

Patch

diff --git a/dts/framework/testbed_model/sut_node.py b/dts/framework/testbed_model/sut_node.py
index bcac939e72..f9c7bd9bf3 100644
--- a/dts/framework/testbed_model/sut_node.py
+++ b/dts/framework/testbed_model/sut_node.py
@@ -20,6 +20,7 @@ 
 from framework.utils import MesonArgs
 
 from .hw import LogicalCoreCount, LogicalCoreList, VirtualDevice
+from .hw.port import Port
 from .node import Node
 
 
@@ -31,6 +32,7 @@  def __init__(
         prefix: str,
         no_pci: bool,
         vdevs: list[VirtualDevice],
+        ports: list[Port],
         other_eal_param: str,
     ):
         """
@@ -56,6 +58,7 @@  def __init__(
             self._prefix = f"--file-prefix={prefix}"
         self._no_pci = "--no-pci" if no_pci else ""
         self._vdevs = " ".join(f"--vdev {vdev}" for vdev in vdevs)
+        self._ports = " ".join(f"-a {port.pci}" for port in ports)
         self._other_eal_param = other_eal_param
 
     def __str__(self) -> str:
@@ -65,6 +68,7 @@  def __str__(self) -> str:
             f"{self._prefix} "
             f"{self._no_pci} "
             f"{self._vdevs} "
+            f"{self._ports} "
             f"{self._other_eal_param}"
         )
 
@@ -308,6 +312,7 @@  def create_eal_parameters(
         append_prefix_timestamp: bool = True,
         no_pci: bool = False,
         vdevs: list[VirtualDevice] = None,
+        ports: list[Port] | None = None,
         other_eal_param: str = "",
     ) -> "EalParameters":
         """
@@ -350,12 +355,16 @@  def create_eal_parameters(
         if vdevs is None:
             vdevs = []
 
+        if ports is None:
+            ports = self.ports
+
         return EalParameters(
             lcore_list=lcore_list,
             memory_channels=self.config.memory_channels,
             prefix=prefix,
             no_pci=no_pci,
             vdevs=vdevs,
+            ports=ports,
             other_eal_param=other_eal_param,
         )