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 298734575E; Wed, 7 Aug 2024 16:08:54 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E435C410DC; Wed, 7 Aug 2024 16:08:53 +0200 (CEST) Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) by mails.dpdk.org (Postfix) with ESMTP id 6DC314027B for ; Wed, 7 Aug 2024 16:08:52 +0200 (CEST) Received: by mail-qv1-f51.google.com with SMTP id 6a1803df08f44-6b7a433857aso2677016d6.2 for ; Wed, 07 Aug 2024 07:08:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1723039732; x=1723644532; 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=iU/hgdCodyb8UOZVUlaxo1CEiwX220mAEKUFDEoAfio=; b=M/AQqJg9ybw1KeNiiiulqW6PY3SQ2Ab8r/cgsMFci6wBv0O9rC2WpaAjKRcwrj67pK 8czbA0QLyVqmKNUICm05AE9kYgZyr1DcQltEU4s9fEzO3eCJA+Q8nmwafHIvtA5+VHC1 etKKUem2x8s2oOVXCEsU6FtM6KUDdheKodQ44= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723039732; x=1723644532; 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=iU/hgdCodyb8UOZVUlaxo1CEiwX220mAEKUFDEoAfio=; b=JBYj/0s5fr1VRGJpnQQvwE29VNpxHw91Ihk7+4DwNt5mMyrUvXFkzQukPsvKxpXQfT gqIAYH4mb+cuvKaXDf2u5TyPqeJkIKt2vuYAlSHAV9e67EA9NVv83OuTZtkEojh8vpVf tV6Ye5/mX6zDFs0oceDnsTg5eCK0noOBcLVwGYBckTIyjUEtxK4J3chWbyH7t2fRLtqD tDDokCxzSJjQoi907SjTezy/0R5ic/Sfhe3Z3Isiu+e0dgeWZP2X3IikmmTl/56L+Xz5 xEEMDv2JuqlBXaezkWsvmuJFwcXBmecMiOXl7LqO2RpSwSRwW4z6jGHJ/5DKDbiMHo78 4SCQ== X-Gm-Message-State: AOJu0YxCOq5Je/IXAw564eQ2G46PqWrV46QEGZPSEx45u+GPeQMKHt61 Lqo2sZ3pFa4rK4z1iRjeesyntdTBSqkPrRtn2phVcfYYpQ6wx/hCbwixtUFTmo0= X-Google-Smtp-Source: AGHT+IHkEg1NEx94E0PmAE/GdHmPjxbDh3hubUn5Z+EKWA1srhEEblplxqBEzRSbxLIo2XqbFzPCBw== X-Received: by 2002:ac8:5883:0:b0:44e:d016:ef9 with SMTP id d75a77b69052e-4518928ed83mr131317181cf.9.1723039731633; Wed, 07 Aug 2024 07:08:51 -0700 (PDT) Received: from localhost.unh.edu ([2606:4100:3880:1271:e2f8:4ec3:8bf3:864c]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7a3785d2a03sm64839185a.20.2024.08.07.07.08.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Aug 2024 07:08:51 -0700 (PDT) From: Nicholas Pratte To: paul.szczepanek@arm.com, luca.vizzarro@arm.com, juraj.linkes@pantheon.tech, jspewock@iol.unh.edu, dmarx@iol.unh.edu, yoan.picchi@foss.arm.com, Honnappa.Nagarahalli@arm.com, probb@iol.unh.edu Cc: dev@dpdk.org, Nicholas Pratte Subject: [RFC v1 1/1] dts: split enums from primary json schema Date: Wed, 7 Aug 2024 10:08:32 -0400 Message-ID: <20240807140831.27558-3-npratte@iol.unh.edu> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240807140831.27558-2-npratte@iol.unh.edu> References: <20240807140831.27558-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 Separating enums from the primary json schema might make it easier for incoming DTS developers and users to quickly identify what values are allowed in the config yaml file with relative ease. Moreover, separating values, such as available test suites, may streamline the test suite development process via a quick and simple reference to test suite enums. The other concern is that, as more test suites are developed, then the list of available test suites will become quite cumbersome. A list of possible test suites should be well-documented and easy to find, and separating test suite enums from the primary schema can achieve both of these needs. Signed-off-by: Nicholas Pratte --- dts/framework/config/__init__.py | 4 + dts/framework/config/conf_allowed_values.json | 131 ++++++++++++++++++ dts/framework/config/conf_yaml_schema.json | 111 ++------------- 3 files changed, 143 insertions(+), 103 deletions(-) create mode 100644 dts/framework/config/conf_allowed_values.json diff --git a/dts/framework/config/__init__.py b/dts/framework/config/__init__.py index df60a5030e..8af81f2c29 100644 --- a/dts/framework/config/__init__.py +++ b/dts/framework/config/__init__.py @@ -593,9 +593,13 @@ def load_config(config_file_path: Path) -> Configuration: config_data = yaml.safe_load(f) schema_path = os.path.join(Path(__file__).parent.resolve(), "conf_yaml_schema.json") + allowed_values_path = os.path.join(Path(__file__).parent.resolve(), "conf_allowed_values.json") with open(schema_path, "r") as f: schema = json.load(f) + with open(allowed_values_path, "r") as f: + allowed_values = json.load(f) + schema.update(allowed_values) config = warlock.model_factory(schema, name="_Config")(config_data) config_obj: Configuration = Configuration.from_dict(dict(config)) # type: ignore[arg-type] return config_obj diff --git a/dts/framework/config/conf_allowed_values.json b/dts/framework/config/conf_allowed_values.json new file mode 100644 index 0000000000..243d6daf8d --- /dev/null +++ b/dts/framework/config/conf_allowed_values.json @@ -0,0 +1,131 @@ +{ + "$defs": { + "description": "Allowed/supported values and test suites within the current DTS framework.", + "test_suites": { + "description": "Developed test suites within the current framework. Add additional test suites here.", + "enum": [ + "hello_world", + "os_udp", + "pmd_buffer_scatter" + ] + }, + "traffic_generators": { + "description": "Scapy traffic generator. Used for functional testing.", + "enum": [ + "SCAPY" + ] + }, + "node_architectures": { + "description": "Supported node architectures within DPDK.", + "enum": [ + "x86_64", + "arm64", + "ppc64le" + ] + }, + "build_target_architectures": { + "description": "Supported build-target architectures.", + "enum": [ + "ALL", + "x86_64", + "arm64", + "ppc64le", + "other" + ] + }, + "operating_systems": { + "description": "Supported node operating systems", + "enum": [ + "linux" + ] + }, + "cpus": { + "description": "Supported build-target CPUs", + "enum": [ + "native", + "armv8a", + "dpaa2", + "thunderx", + "xgene1" + ] + }, + "compilers": { + "description": "Supported build-target compilers.", + "enum": [ + "gcc", + "clang", + "icc", + "mscv" + ] + }, + "NICs": { + "description": "Supported NICs", + "enum": [ + "ALL", + "ConnectX3_MT4103", + "ConnectX4_LX_MT4117", + "ConnectX4_MT4115", + "ConnectX5_MT4119", + "ConnectX5_MT4121", + "I40E_10G-10G_BASE_T_BC", + "I40E_10G-10G_BASE_T_X722", + "I40E_10G-SFP_X722", + "I40E_10G-SFP_XL710", + "I40E_10G-X722_A0", + "I40E_1G-1G_BASE_T_X722", + "I40E_25G-25G_SFP28", + "I40E_40G-QSFP_A", + "I40E_40G-QSFP_B", + "IAVF-ADAPTIVE_VF", + "IAVF-VF", + "IAVF_10G-X722_VF", + "ICE_100G-E810C_QSFP", + "ICE_25G-E810C_SFP", + "ICE_25G-E810_XXV_SFP", + "IGB-I350_VF", + "IGB_1G-82540EM", + "IGB_1G-82545EM_COPPER", + "IGB_1G-82571EB_COPPER", + "IGB_1G-82574L", + "IGB_1G-82576", + "IGB_1G-82576_QUAD_COPPER", + "IGB_1G-82576_QUAD_COPPER_ET2", + "IGB_1G-82580_COPPER", + "IGB_1G-I210_COPPER", + "IGB_1G-I350_COPPER", + "IGB_1G-I354_SGMII", + "IGB_1G-PCH_LPTLP_I218_LM", + "IGB_1G-PCH_LPTLP_I218_V", + "IGB_1G-PCH_LPT_I217_LM", + "IGB_1G-PCH_LPT_I217_V", + "IGB_2.5G-I354_BACKPLANE_2_5GBPS", + "IGC-I225_LM", + "IGC-I226_LM", + "IXGBE_10G-82599_SFP", + "IXGBE_10G-82599_SFP_SF_QP", + "IXGBE_10G-82599_T3_LOM", + "IXGBE_10G-82599_VF", + "IXGBE_10G-X540T", + "IXGBE_10G-X540_VF", + "IXGBE_10G-X550EM_A_SFP", + "IXGBE_10G-X550EM_X_10G_T", + "IXGBE_10G-X550EM_X_SFP", + "IXGBE_10G-X550EM_X_VF", + "IXGBE_10G-X550T", + "IXGBE_10G-X550_VF", + "brcm_57414", + "brcm_P2100G", + "cavium_0011", + "cavium_a034", + "cavium_a063", + "cavium_a064", + "fastlinq_ql41000", + "fastlinq_ql41000_vf", + "fastlinq_ql45000", + "fastlinq_ql45000_vf", + "hi1822", + "virtio" + ] + } + } +} \ No newline at end of file diff --git a/dts/framework/config/conf_yaml_schema.json b/dts/framework/config/conf_yaml_schema.json index f02a310bb5..f148943cef 100644 --- a/dts/framework/config/conf_yaml_schema.json +++ b/dts/framework/config/conf_yaml_schema.json @@ -8,107 +8,25 @@ }, "NIC": { "type": "string", - "enum": [ - "ALL", - "ConnectX3_MT4103", - "ConnectX4_LX_MT4117", - "ConnectX4_MT4115", - "ConnectX5_MT4119", - "ConnectX5_MT4121", - "I40E_10G-10G_BASE_T_BC", - "I40E_10G-10G_BASE_T_X722", - "I40E_10G-SFP_X722", - "I40E_10G-SFP_XL710", - "I40E_10G-X722_A0", - "I40E_1G-1G_BASE_T_X722", - "I40E_25G-25G_SFP28", - "I40E_40G-QSFP_A", - "I40E_40G-QSFP_B", - "IAVF-ADAPTIVE_VF", - "IAVF-VF", - "IAVF_10G-X722_VF", - "ICE_100G-E810C_QSFP", - "ICE_25G-E810C_SFP", - "ICE_25G-E810_XXV_SFP", - "IGB-I350_VF", - "IGB_1G-82540EM", - "IGB_1G-82545EM_COPPER", - "IGB_1G-82571EB_COPPER", - "IGB_1G-82574L", - "IGB_1G-82576", - "IGB_1G-82576_QUAD_COPPER", - "IGB_1G-82576_QUAD_COPPER_ET2", - "IGB_1G-82580_COPPER", - "IGB_1G-I210_COPPER", - "IGB_1G-I350_COPPER", - "IGB_1G-I354_SGMII", - "IGB_1G-PCH_LPTLP_I218_LM", - "IGB_1G-PCH_LPTLP_I218_V", - "IGB_1G-PCH_LPT_I217_LM", - "IGB_1G-PCH_LPT_I217_V", - "IGB_2.5G-I354_BACKPLANE_2_5GBPS", - "IGC-I225_LM", - "IGC-I226_LM", - "IXGBE_10G-82599_SFP", - "IXGBE_10G-82599_SFP_SF_QP", - "IXGBE_10G-82599_T3_LOM", - "IXGBE_10G-82599_VF", - "IXGBE_10G-X540T", - "IXGBE_10G-X540_VF", - "IXGBE_10G-X550EM_A_SFP", - "IXGBE_10G-X550EM_X_10G_T", - "IXGBE_10G-X550EM_X_SFP", - "IXGBE_10G-X550EM_X_VF", - "IXGBE_10G-X550T", - "IXGBE_10G-X550_VF", - "brcm_57414", - "brcm_P2100G", - "cavium_0011", - "cavium_a034", - "cavium_a063", - "cavium_a064", - "fastlinq_ql41000", - "fastlinq_ql41000_vf", - "fastlinq_ql45000", - "fastlinq_ql45000_vf", - "hi1822", - "virtio" - ] + "$ref": "#/$defs/NICs" }, "ARCH": { "type": "string", - "enum": [ - "x86_64", - "arm64", - "ppc64le" - ] + "$ref": "#/$defs/node_architectures" }, "OS": { "type": "string", - "enum": [ - "linux" - ] + "$ref": "#/$defs/operating_systems" }, "cpu": { "type": "string", "description": "Native should be the default on x86", - "enum": [ - "native", - "armv8a", - "dpaa2", - "thunderx", - "xgene1" - ] + "$refs": "#/$defs/cpus" }, "compiler": { "type": "string", - "enum": [ - "gcc", - "clang", - "icc", - "mscv" - ] + "$ref": "#/$defs/compilers" }, "build_target": { "type": "object", @@ -116,13 +34,7 @@ "properties": { "arch": { "type": "string", - "enum": [ - "ALL", - "x86_64", - "arm64", - "ppc64le", - "other" - ] + "$ref": "#/$defs/build_target_architectures" }, "os": { "$ref": "#/definitions/OS" @@ -184,11 +96,7 @@ }, "test_suite": { "type": "string", - "enum": [ - "hello_world", - "os_udp", - "pmd_buffer_scatter" - ] + "$ref": "#/$defs/test_suites" }, "test_target": { "type": "object", @@ -298,13 +206,10 @@ "oneOf": [ { "type": "object", - "description": "Scapy traffic generator. Used for functional testing.", "properties": { "type": { "type": "string", - "enum": [ - "SCAPY" - ] + "$ref": "#/$defs/traffic_generators" } } } -- 2.44.0