From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 994BA45837; Wed, 21 Aug 2024 20:43:39 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 56E63427E3; Wed, 21 Aug 2024 20:43:33 +0200 (CEST) Received: from mail-qv1-f44.google.com (mail-qv1-f44.google.com [209.85.219.44]) by mails.dpdk.org (Postfix) with ESMTP id BB564427E1 for ; Wed, 21 Aug 2024 20:43:31 +0200 (CEST) Received: by mail-qv1-f44.google.com with SMTP id 6a1803df08f44-6bf80db6c8eso3236166d6.3 for ; Wed, 21 Aug 2024 11:43:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1724265811; x=1724870611; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LUFHsBi3NjmHuxAkCHygfbOBf57SZCcHasZLeMupphw=; b=QyEE7GD1zb/oRIb0asELztd7k2JaGNDWkZnzy2owGnx6H/JCdmdBPsUs6EEIQQ4W8H V/Myp+EsCGB0DpeNSvlBvA3P/WNqY0fyQnxfWOsZbLImX8G5wMc2lIWSmGFR1URP9haR ZcQYkjJQ0fV6kp9MXXoJNOjhoww8rTl/wPd0g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724265811; x=1724870611; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LUFHsBi3NjmHuxAkCHygfbOBf57SZCcHasZLeMupphw=; b=Ar3KrXjjE+zP+09T3VCjfNrey0yBmEOTNCWoQ556r2llbnLUn7lIl+m8b1+T0Bmdha kjQG2SNiPI/9ytny0i57R0KhdPLaccaNE8Vt9Xok5NF3I2GX44pETPByxr7vhu/TQYbD kQc+Pcih2LcOqys5s2aa/f6e5wnZaHL4/nU4f21dppWFfutZOW/xSaQQVFDowoE0gFlP xjwibDCjxnufqgR5twQ+aV2MV5ZlcMVLwSyqEjq7ak6FormkZ7IyO3gTUytdL1b3aIBd H/STjzEZZkt/3KfEG3Rew4QKVaYOjiXVPmBraN5bKKE8zFWDuTxndTnm4vsBu92tifNh FpUQ== X-Gm-Message-State: AOJu0YxpEjiyUhkUDzcFN0Co25GLwFZ+bQe6n6dBfS5GfOkZ8+2V7YI6 ziBFY11ftspVWRaswRwjzkH4FULn9JPIa00sE9VJDVLo+9GVlbtLDU+jBjYNcHZWMgjGSGW58qj a X-Google-Smtp-Source: AGHT+IEjVPwrUcSR5tR5SNPO2NaaB+zCFlsR9Pv5ahTHr6WdTcVoVDdPZBLMLUQBHy2f5Qq0WtDLtQ== X-Received: by 2002:a05:6214:2527:b0:6bf:6692:b75e with SMTP id 6a1803df08f44-6c155e84ea6mr22978036d6.6.1724265810997; Wed, 21 Aug 2024 11:43:30 -0700 (PDT) Received: from localhost.unh.edu ([2606:4100:3880:1271:e2f8:4ec3:8bf3:864c]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6bf6fef7079sm64251216d6.126.2024.08.21.11.43.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2024 11:43:30 -0700 (PDT) From: Nicholas Pratte 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 Subject: [PATCH v1 2/3] dts: rework testbed_model Port objects to contain unique identifiers Date: Wed, 21 Aug 2024 14:43:05 -0400 Message-ID: <20240821184305.28028-4-npratte@iol.unh.edu> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240821184305.28028-2-npratte@iol.unh.edu> References: <20240821184305.28028-2-npratte@iol.unh.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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