DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nicholas Pratte <npratte@iol.unh.edu>
To: yoan.picchi@foss.arm.com, luca.vizzarro@arm.com,
	probb@iol.unh.edu, paul.szczepanek@arm.com,
	Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech,
	dmarx@iol.unh.edu, jspewock@iol.unh.edu, alex.chapman@arm.com
Cc: dev@dpdk.org, Nicholas Pratte <npratte@iol.unh.edu>
Subject: [PATCH v1 2/3] dts: rework testbed_model Port objects to contain unique identifiers
Date: Wed, 21 Aug 2024 14:43:05 -0400	[thread overview]
Message-ID: <20240821184305.28028-4-npratte@iol.unh.edu> (raw)
In-Reply-To: <20240821184305.28028-2-npratte@iol.unh.edu>

In order to leverage the usability of unique identifiers on ports, the
testbed_model Port object needs some refactoring/trimming of obsolete or
needless attributes.

Bugzilla ID: 1478

Signed-off-by: Nicholas Pratte <npratte@iol.unh.edu>
---
 dts/framework/testbed_model/port.py | 45 +++++++----------------------
 1 file changed, 10 insertions(+), 35 deletions(-)

diff --git a/dts/framework/testbed_model/port.py b/dts/framework/testbed_model/port.py
index 817405bea4..75bc38f16e 100644
--- a/dts/framework/testbed_model/port.py
+++ b/dts/framework/testbed_model/port.py
@@ -14,43 +14,30 @@
 from framework.config import PortConfig
 
 
-@dataclass(slots=True, frozen=True)
-class PortIdentifier:
-    """The port identifier.
-
-    Attributes:
-        node: The node where the port resides.
-        pci: The PCI address of the port on `node`.
-    """
-
-    node: str
-    pci: str
-
-
 @dataclass(slots=True)
 class Port:
     """Physical port on a node.
 
-    The ports are identified by the node they're on and their PCI addresses. The port on the other
-    side of the connection is also captured here.
+    The ports are identified using a unique, user-defined name/identifier.
     Each port is serviced by a driver, which may be different for the operating system (`os_driver`)
     and for DPDK (`os_driver_for_dpdk`). For some devices, they are the same, e.g.: ``mlx5_core``.
 
     Attributes:
-        identifier: The PCI address of the port on a node.
+        node_name: Node the port exists on.
+        name: User-defined unique identifier of the port.
+        pci: The pci address assigned to the port.
         os_driver: The operating system driver name when the operating system controls the port,
             e.g.: ``i40e``.
         os_driver_for_dpdk: The operating system driver name for use with DPDK, e.g.: ``vfio-pci``.
-        peer: The identifier of a port this port is connected with.
-            The `peer` is on a different node.
         mac_address: The MAC address of the port.
         logical_name: The logical name of the port. Must be discovered.
     """
 
-    identifier: PortIdentifier
+    node: str
+    name: str
+    pci: str
     os_driver: str
     os_driver_for_dpdk: str
-    peer: PortIdentifier
     mac_address: str = ""
     logical_name: str = ""
 
@@ -61,23 +48,11 @@ def __init__(self, node_name: str, config: PortConfig):
             node_name: The name of the port's node.
             config: The test run configuration of the port.
         """
-        self.identifier = PortIdentifier(
-            node=node_name,
-            pci=config.pci,
-        )
+        self.node = node_name
+        self.name = config.name
+        self.pci = config.pci
         self.os_driver = config.os_driver
         self.os_driver_for_dpdk = config.os_driver_for_dpdk
-        self.peer = PortIdentifier(node=config.peer_node, pci=config.peer_pci)
-
-    @property
-    def node(self) -> str:
-        """The node where the port resides."""
-        return self.identifier.node
-
-    @property
-    def pci(self) -> str:
-        """The PCI address of the port."""
-        return self.identifier.pci
 
 
 @dataclass(slots=True, frozen=True)
-- 
2.44.0


  parent reply	other threads:[~2024-08-21 18:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-21 18:43 [PATCH v1 0/3] dts: rework topology definition in dts config Nicholas Pratte
2024-08-21 18:43 ` [PATCH v1 1/3] dts: rework port attributes in config module Nicholas Pratte
2024-09-04 18:18   ` Jeremy Spewock
2024-09-10 10:11   ` Juraj Linkeš
2024-08-21 18:43 ` Nicholas Pratte [this message]
2024-09-04 18:18   ` [PATCH v1 2/3] dts: rework testbed_model Port objects to contain unique identifiers Jeremy Spewock
2024-09-10 10:17   ` Juraj Linkeš
2024-08-21 18:43 ` [PATCH v1 3/3] dts: rework test suite and dts runner to include test_run configs Nicholas Pratte
2024-09-04 18:18   ` Jeremy Spewock
2024-09-10 11:05     ` Juraj Linkeš

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240821184305.28028-4-npratte@iol.unh.edu \
    --to=npratte@iol.unh.edu \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=alex.chapman@arm.com \
    --cc=dev@dpdk.org \
    --cc=dmarx@iol.unh.edu \
    --cc=jspewock@iol.unh.edu \
    --cc=juraj.linkes@pantheon.tech \
    --cc=luca.vizzarro@arm.com \
    --cc=paul.szczepanek@arm.com \
    --cc=probb@iol.unh.edu \
    --cc=yoan.picchi@foss.arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).