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 5A86045837; Wed, 21 Aug 2024 20:43:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0F58F427D1; Wed, 21 Aug 2024 20:43:31 +0200 (CEST) Received: from mail-qv1-f53.google.com (mail-qv1-f53.google.com [209.85.219.53]) by mails.dpdk.org (Postfix) with ESMTP id 0ACDC427D0 for ; Wed, 21 Aug 2024 20:43:30 +0200 (CEST) Received: by mail-qv1-f53.google.com with SMTP id 6a1803df08f44-6bf78e96946so2900196d6.1 for ; Wed, 21 Aug 2024 11:43:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1724265809; x=1724870609; 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=FhYT8daxT3C/qFMMnQv2B3dG+Ogfc8whs5CbUTwh0Fc=; b=CPR6zI6wT97OUQfb7DOINdyEhG0dkO12XdnZa0/qnXPrCZtmiC3HQ7Nh7RCsNVb6cG R26Gq0n6O8eRYMiKobX1sHrpAkIzvTTKqoNDgxYMIoB4Y8YTIoXfO1/aqoMbq242dKUH XzHpJ2y0apnyPAIiJRaHiZMq2OiHyL9M8tbQU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724265809; x=1724870609; 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=FhYT8daxT3C/qFMMnQv2B3dG+Ogfc8whs5CbUTwh0Fc=; b=p96rXD6SXRhR1yl3u8LM9yMTezls4ySjhX1e0GTcoUyovGxyC83GJKwkbREwurVUZw iznoT1Tn7Qml52Yz7z9DlNYnGiqNnMsSrMMBVLxHmIurcbkphVX2MR/MFECoMB4erOsi ta8orEPmTsqyMU5FAeIkwRbQOq5GR8osxF61i4rzVM7HHULuRci1+2Li5GzpBy2e/K/e +x/mUiVTvRRKmQt7AnqHa8LTQG4i76OXDUNXQ2TtFd7bW6KIhwPqfQrJKmCsWqTaMhg5 jHXyGkHbx+4xnRqjIy0jRjYFUkcdTVnaeTDxvo0k2ZRR4ppe3ozflw2ChI5k4hXrRlWp d3zA== X-Gm-Message-State: AOJu0YwVMH8jZfg92Hkp9qSVajCwS6B14Z4XVEIDzALqKOWsUryIXnC8 mdkaaq2J1dBvxbVmHbjMQm8oPM6e/bbRxa95GVYXPvyA1SNWdwRki4/LUAxtHP8= X-Google-Smtp-Source: AGHT+IHZkH06LkpqcJNqLanya9C1qdb0NC9oJEi9WXZmroB1lJWY33krGN/QIHZ/JpCzBQwsPHDkGA== X-Received: by 2002:a05:6214:cc7:b0:6bf:6722:aab3 with SMTP id 6a1803df08f44-6c155e1ceccmr23117486d6.5.1724265808993; Wed, 21 Aug 2024 11:43:28 -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.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2024 11:43:28 -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 1/3] dts: rework port attributes in config module Date: Wed, 21 Aug 2024 14:43:04 -0400 Message-ID: <20240821184305.28028-3-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 The current design requires that a peer pci port is identified so that test suites can create the correct port links. While this can work, it also creates a lot of room for user error. Instead, devices should be given a unique identifier which is referenced in defined test runs. Both defined testbeds for the SUT and TG must have an equal number of specified ports. In each given array or ports, SUT port 0 is connected to TG port 0, SUT port 1 is connected to TG port 1, etc. Bugzilla ID: 1478 Signed-off-by: Nicholas Pratte --- dts/conf.yaml | 32 ++++++------- dts/framework/config/__init__.py | 12 +++-- dts/framework/config/conf_yaml_schema.json | 52 +++++++++++++--------- dts/framework/config/types.py | 19 +++++--- 4 files changed, 69 insertions(+), 46 deletions(-) diff --git a/dts/conf.yaml b/dts/conf.yaml index 7d95016e68..16214ee267 100644 --- a/dts/conf.yaml +++ b/dts/conf.yaml @@ -20,10 +20,17 @@ test_runs: # The machine running the DPDK test executable system_under_test_node: node_name: "SUT 1" + test_bed: + - "Intel SUT Port 1" + - "Intel SUT Port 2" vdevs: # optional; if removed, vdevs won't be used in the test run - "crypto_openssl" # Traffic generator node to use for this test run - traffic_generator_node: "TG 1" + traffic_generator_node: + node_name: "TG 1" + test_bed: + - "Mellanox TG Port 1" + - "Broadcom TG Port 1" nodes: # Define a system under test node, having two network ports physically # connected to the corresponding ports in TG 1 (the peer node) @@ -40,17 +47,14 @@ nodes: force_first_numa: false ports: # sets up the physical link between "SUT 1"@000:00:08.0 and "TG 1"@0000:00:08.0 - - pci: "0000:00:08.0" + - name: "Intel SUT Port 1" + pci: "0000:00:08.0" os_driver_for_dpdk: vfio-pci # OS driver that DPDK will use os_driver: i40e # OS driver to bind when the tests are not running - peer_node: "TG 1" - peer_pci: "0000:00:08.0" - # sets up the physical link between "SUT 1"@000:00:08.1 and "TG 1"@0000:00:08.1 - - pci: "0000:00:08.1" + - name: "Intel SUT Port 2" + pci: "0000:00:08.1" os_driver_for_dpdk: vfio-pci os_driver: i40e - peer_node: "TG 1" - peer_pci: "0000:00:08.1" # Define a Scapy traffic generator node, having two network ports # physically connected to the corresponding ports in SUT 1 (the peer node). - name: "TG 1" @@ -59,18 +63,14 @@ nodes: arch: x86_64 os: linux ports: - # sets up the physical link between "TG 1"@000:00:08.0 and "SUT 1"@0000:00:08.0 - - pci: "0000:00:08.0" + - name: "Mellanox TG Port 1" + pci: "0000:00:08.0" os_driver_for_dpdk: rdma os_driver: rdma - peer_node: "SUT 1" - peer_pci: "0000:00:08.0" - # sets up the physical link between "SUT 1"@000:00:08.0 and "TG 1"@0000:00:08.0 - - pci: "0000:00:08.1" + - name: "Broadcom TG Port 1" + pci: "0000:00:08.1" os_driver_for_dpdk: rdma os_driver: rdma - peer_node: "SUT 1" - peer_pci: "0000:00:08.1" hugepages_2mb: # optional; if removed, will use system hugepage configuration number_of: 256 force_first_numa: false diff --git a/dts/framework/config/__init__.py b/dts/framework/config/__init__.py index df60a5030e..534821ed22 100644 --- a/dts/framework/config/__init__.py +++ b/dts/framework/config/__init__.py @@ -151,11 +151,10 @@ class PortConfig: """ node: str + name: str pci: str os_driver_for_dpdk: str os_driver: str - peer_node: str - peer_pci: str @classmethod def from_dict(cls, node: str, d: PortConfigDict) -> Self: @@ -487,12 +486,19 @@ def from_dict( system_under_test_node, SutNodeConfiguration ), f"Invalid SUT configuration {system_under_test_node}" - tg_name = d["traffic_generator_node"] + tg_name = d["traffic_generator_node"]["node_name"] assert tg_name in node_map, f"Unknown TG {tg_name} in test run {d}" traffic_generator_node = node_map[tg_name] assert isinstance( traffic_generator_node, TGNodeConfiguration ), f"Invalid TG configuration {traffic_generator_node}" + assert len(traffic_generator_node.ports) == len( + system_under_test_node.ports + ), "Insufficient ports defined on nodes." + for port_name in d["system_under_test_node"]["test_bed"]: + assert port_name in {port.name: port for port in system_under_test_node.ports} + for port_name in d["traffic_generator_node"]["test_bed"]: + assert port_name in {port.name: port for port in traffic_generator_node.ports} vdevs = ( d["system_under_test_node"]["vdevs"] if "vdevs" in d["system_under_test_node"] else [] diff --git a/dts/framework/config/conf_yaml_schema.json b/dts/framework/config/conf_yaml_schema.json index f02a310bb5..91667b01cc 100644 --- a/dts/framework/config/conf_yaml_schema.json +++ b/dts/framework/config/conf_yaml_schema.json @@ -6,6 +6,10 @@ "type": "string", "description": "A unique identifier for a node" }, + "port_name": { + "type": "string", + "description": "A unique identifier for a node's NIC port." + }, "NIC": { "type": "string", "enum": [ @@ -190,6 +194,24 @@ "pmd_buffer_scatter" ] }, + "test_run_node": { + "type": "object", + "properties": { + "node_name": { + "$ref": "#/definitions/node_name" + }, + "test_bed": { + "type": "array", + "items": { + "$ref": "#/definitions/port_name" + } + } + }, + "required": [ + "node_name", + "test_bed" + ] + }, "test_target": { "type": "object", "properties": { @@ -260,8 +282,11 @@ "type": "array", "items": { "type": "object", - "description": "Each port should be described on both sides of the connection. This makes configuration slightly more verbose but greatly simplifies implementation. If there are inconsistencies, then DTS will not run until that issue is fixed. An example inconsistency would be port 1, node 1 says it is connected to port 1, node 2, but port 1, node 2 says it is connected to port 2, node 1.", + "description": "A list of relevant ports on a node and its corresponding driver, dpdk driver, and pci address.", "properties": { + "name": { + "$ref": "#/definitions/port_name" + }, "pci": { "$ref": "#/definitions/pci_address", "description": "The local PCI address of the port" @@ -273,23 +298,14 @@ "os_driver": { "type": "string", "description": "The driver normally used by this port (ex: i40e)" - }, - "peer_node": { - "type": "string", - "description": "The name of the node the peer port is on" - }, - "peer_pci": { - "$ref": "#/definitions/pci_address", - "description": "The PCI address of the peer port" } }, "additionalProperties": false, "required": [ + "name", "pci", "os_driver_for_dpdk", - "os_driver", - "peer_node", - "peer_pci" + "os_driver" ] }, "minimum": 1 @@ -360,11 +376,7 @@ "type": "boolean" }, "system_under_test_node": { - "type":"object", - "properties": { - "node_name": { - "$ref": "#/definitions/node_name" - }, + "$ref": "#/definitions/test_run_node", "vdevs": { "description": "Optional list of names of vdevs to be used in the test run", "type": "array", @@ -372,13 +384,9 @@ "type": "string" } } - }, - "required": [ - "node_name" - ] }, "traffic_generator_node": { - "$ref": "#/definitions/node_name" + "$ref": "#/definitions/test_run_node" } }, "additionalProperties": false, diff --git a/dts/framework/config/types.py b/dts/framework/config/types.py index cf16556403..c91f3b9009 100644 --- a/dts/framework/config/types.py +++ b/dts/framework/config/types.py @@ -14,16 +14,14 @@ class PortConfigDict(TypedDict): """Allowed keys and values.""" + #: + name: str #: pci: str #: os_driver_for_dpdk: str #: os_driver: str - #: - peer_node: str - #: - peer_pci: str class TrafficGeneratorConfigDict(TypedDict): @@ -101,9 +99,20 @@ class TestRunSUTConfigDict(TypedDict): #: node_name: str #: + test_bed: list[str] + #: vdevs: list[str] +class TestRunTGConfigDict(TypedDict): + """Allowed keys and values.""" + + #: + node_name: str + #: + test_bed: list[str] + + class TestRunConfigDict(TypedDict): """Allowed keys and values.""" @@ -120,7 +129,7 @@ class TestRunConfigDict(TypedDict): #: system_under_test_node: TestRunSUTConfigDict #: - traffic_generator_node: str + traffic_generator_node: TestRunTGConfigDict class ConfigurationDict(TypedDict): -- 2.44.0