Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/116420/?format=api
http://patches.dpdk.org/api/patches/116420/?format=api", "web_url": "http://patches.dpdk.org/project/dts/patch/20220919085649.827636-4-tadhg.kearney@intel.com/", "project": { "id": 3, "url": "http://patches.dpdk.org/api/projects/3/?format=api", "name": "DTS", "link_name": "dts", "list_id": "dts.dpdk.org", "list_email": "dts@dpdk.org", "web_url": "", "scm_url": "git://dpdk.org/tools/dts", "webscm_url": "http://git.dpdk.org/tools/dts/", "list_archive_url": "https://inbox.dpdk.org/dts", "list_archive_url_format": "https://inbox.dpdk.org/dts/{}", "commit_url_format": "" }, "msgid": "<20220919085649.827636-4-tadhg.kearney@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dts/20220919085649.827636-4-tadhg.kearney@intel.com", "date": "2022-09-19T08:56:49", "name": "[v3,3/3] test/power: add unit tests for uncore API", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": false, "hash": "08ee38e2a9dd38542c41dadf7e292701d637d50f", "submitter": { "id": 2533, "url": "http://patches.dpdk.org/api/people/2533/?format=api", "name": "Tadhg Kearney", "email": "tadhg.kearney@intel.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dts/patch/20220919085649.827636-4-tadhg.kearney@intel.com/mbox/", "series": [ { "id": 24706, "url": "http://patches.dpdk.org/api/series/24706/?format=api", "web_url": "http://patches.dpdk.org/project/dts/list/?series=24706", "date": "2022-09-19T08:56:46", "name": "add uncore api to be called through l3fwd-power", "version": 3, "mbox": "http://patches.dpdk.org/series/24706/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/116420/comments/", "check": "pending", "checks": "http://patches.dpdk.org/api/patches/116420/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dts-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 62943A00C5;\n\tMon, 19 Sep 2022 10:57:00 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 58A0541148;\n\tMon, 19 Sep 2022 10:57:00 +0200 (CEST)", "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n by mails.dpdk.org (Postfix) with ESMTP id 6F72F40141\n for <dts@dpdk.org>; Mon, 19 Sep 2022 10:56:58 +0200 (CEST)", "from fmsmga008.fm.intel.com ([10.253.24.58])\n by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 19 Sep 2022 01:56:58 -0700", "from silpixa00401183.ir.intel.com ([10.55.129.143])\n by fmsmga008.fm.intel.com with ESMTP; 19 Sep 2022 01:56:56 -0700" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1663577818; x=1695113818;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=9Rb1iCVfAFtP6IRVDwiA/eOKKrpy4TU5rbj9SIGqk28=;\n b=e7sdD71RtkE/9f94eOn6EKAJ/qcVFNDmsCPCnWj5zlL0DxQC+fPhV3zL\n AUGq1RtlPa1PjJoWsdH89huz883QRceW9iDTPWvWo+uCDxTsAGnz2AeKs\n k6tPaLrj2G8oNOoN9P/nfDVMvZOBRToSqdyMjsOQFpUI/757i+ifTsaim\n r92ueoPORt+nUwHuN0dfVv43h5376Q8yg3zFFJTGL1aS0F6mHQOVGlryw\n UPR6p3uJcdrNm0C+T58vzH7VPGt+ZMpdcPK4HZMLOjZOqAofQxNzNSusb\n IfeB3GNCFeFff3IEhL9FocZmPamTMcc+E+9uepTcC1+GmbR2Hmv7DbNwo A==;", "X-IronPort-AV": [ "E=McAfee;i=\"6500,9779,10474\"; a=\"363303672\"", "E=Sophos;i=\"5.93,327,1654585200\"; d=\"scan'208\";a=\"363303672\"", "E=Sophos;i=\"5.93,327,1654585200\"; d=\"scan'208\";a=\"680762664\"" ], "X-ExtLoop1": "1", "From": "Tadhg Kearney <tadhg.kearney@intel.com>", "To": "dts@dpdk.org", "Cc": "reshma.pattan@intel.com, david.hunt@intel.com, anatoly.burakov@intel.com,\n Tadhg Kearney <tadhg.kearney@intel.com>", "Subject": "[PATCH v3 3/3] test/power: add unit tests for uncore API", "Date": "Mon, 19 Sep 2022 08:56:49 +0000", "Message-Id": "<20220919085649.827636-4-tadhg.kearney@intel.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20220919085649.827636-1-tadhg.kearney@intel.com>", "References": "<20220713140706.4143705-1-tadhg.kearney@intel.com>\n <20220919085649.827636-1-tadhg.kearney@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "dts@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "test suite reviews and discussions <dts.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dts>,\n <mailto:dts-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dts/>", "List-Post": "<mailto:dts@dpdk.org>", "List-Help": "<mailto:dts-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dts>,\n <mailto:dts-request@dpdk.org?subject=subscribe>", "Errors-To": "dts-bounces@dpdk.org" }, "content": "Add basic unit tests covering all nine uncore API's.\n\nSigned-off-by: Tadhg Kearney <tadhg.kearney@intel.com>\n---\n app/test/meson.build | 2 +\n app/test/test_power_uncore.c | 293 +++++++++++++++++++++++++++++++++++\n 2 files changed, 295 insertions(+)\n create mode 100644 app/test/test_power_uncore.c", "diff": "diff --git a/app/test/meson.build b/app/test/meson.build\nindex bf1d81f84a..170401ccdc 100644\n--- a/app/test/meson.build\n+++ b/app/test/meson.build\n@@ -100,6 +100,7 @@ test_sources = files(\n 'test_power.c',\n 'test_power_cpufreq.c',\n 'test_power_kvm_vm.c',\n+ 'test_power_uncore.c',\n 'test_prefetch.c',\n 'test_rand_perf.c',\n 'test_rawdev.c',\n@@ -240,6 +241,7 @@ fast_tests = [\n ['power_cpufreq_autotest', false, true],\n ['power_autotest', true, true],\n ['power_kvm_vm_autotest', false, true],\n+ ['power_uncore_autotest', true, true],\n ['reorder_autotest', true, true],\n ['service_autotest', true, true],\n ['thash_autotest', true, true],\ndiff --git a/app/test/test_power_uncore.c b/app/test/test_power_uncore.c\nnew file mode 100644\nindex 0000000000..77e7dbc7ca\n--- /dev/null\n+++ b/app/test/test_power_uncore.c\n@@ -0,0 +1,293 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2010-2022 Intel Corporation\n+ */\n+\n+#include \"test.h\"\n+\n+#ifndef RTE_LIB_POWER\n+\n+static int\n+test_power_uncore(void)\n+{\n+\tprintf(\"Power management library not supported, skipping test\\n\");\n+\treturn TEST_SKIPPED;\n+}\n+\n+#else\n+#include <rte_power_uncore.h>\n+#include <power_common.h>\n+\n+#define MAX_UNCORE_FREQS 32\n+\n+#define VALID_PKG 0\n+#define VALID_DIE 0\n+#define INVALID_PKG (rte_power_uncore_get_num_pkgs() + 1)\n+#define INVALID_DIE (rte_power_uncore_get_num_dies(VALID_PKG) + 1)\n+#define VALID_INDEX 1\n+#define INVALID_INDEX (MAX_UNCORE_FREQS + 1)\n+\n+static int check_power_uncore_init(void)\n+{\n+\tint ret;\n+\n+\t/* Test initialisation of uncore configuration*/\n+\tret = rte_power_uncore_init(VALID_PKG, VALID_DIE);\n+\tif (ret < 0) {\n+\t\tprintf(\"Cannot initialise uncore power management for pkg %u die %u, this \"\n+\t\t\t\"may occur if environment is not configured \"\n+\t\t\t\"correctly(APCI cpufreq) or operating in another valid \"\n+\t\t\t\"Power management environment\\n\", VALID_PKG, VALID_DIE);\n+\t\treturn -1;\n+\t}\n+\n+\t/* Unsuccessful Test */\n+\tret = rte_power_uncore_init(INVALID_PKG, INVALID_DIE);\n+\tif (ret == 0) {\n+\t\tprintf(\"Unexpectedly was able to initialise uncore power management \"\n+\t\t\t\"for pkg %u die %u\\n\", INVALID_PKG, INVALID_DIE);\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int\n+check_power_get_uncore_freq(void)\n+{\n+\tint ret;\n+\n+\t/* Successfully get uncore freq */\n+\tret = rte_power_get_uncore_freq(VALID_PKG, VALID_DIE);\n+\tif (ret < 0) {\n+\t\tprintf(\"Failed to get uncore frequency for pkg %u die %u\\n\",\n+\t\t\t\t\t\t\tVALID_PKG, VALID_DIE);\n+\t\treturn -1;\n+\t}\n+\n+\t/* Unsuccessful Test */\n+\tret = rte_power_get_uncore_freq(INVALID_PKG, INVALID_DIE);\n+\tif (ret >= 0) {\n+\t\tprintf(\"Unexpectedly got invalid uncore frequency for pkg %u die %u\\n\",\n+\t\t\t\t\t\t\tINVALID_PKG, INVALID_DIE);\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int\n+check_power_set_uncore_freq(void)\n+{\n+\tint ret;\n+\n+\t/* Successfully set uncore freq */\n+\tret = rte_power_set_uncore_freq(VALID_PKG, VALID_DIE, VALID_INDEX);\n+\tif (ret < 0) {\n+\t\tprintf(\"Failed to set uncore frequency for pkg %u die %u index %u\\n\",\n+\t\t\t\t\t\t\tVALID_PKG, VALID_DIE, VALID_INDEX);\n+\t\treturn -1;\n+\t}\n+\n+\t/* Try to unsuccesfully set invlaid uncore freq index */\n+\tret = rte_power_set_uncore_freq(VALID_PKG, VALID_DIE, INVALID_INDEX);\n+\tif (ret == 0) {\n+\t\tprintf(\"Unexpectedly set invalid uncore index for pkg %u die %u index %u\\n\",\n+\t\t\t\t\t\t\tVALID_PKG, VALID_DIE, INVALID_INDEX);\n+\t\treturn -1;\n+\t}\n+\n+\t/* Unsuccessful Test */\n+\tret = rte_power_set_uncore_freq(INVALID_PKG, INVALID_DIE, VALID_INDEX);\n+\tif (ret == 0) {\n+\t\tprintf(\"Unexpectedly set invalid uncore frequency for pkg %u die %u index %u\\n\",\n+\t\t\t\t\t\t\tINVALID_PKG, INVALID_DIE, VALID_INDEX);\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int\n+check_power_uncore_freq_max(void)\n+{\n+\tint ret;\n+\n+\t/* Successfully get max uncore freq */\n+\tret = rte_power_uncore_freq_max(VALID_PKG, VALID_DIE);\n+\tif (ret < 0) {\n+\t\tprintf(\"Failed to set max uncore frequency for pkg %u die %u\\n\",\n+\t\t\t\t\t\t\tVALID_PKG, VALID_DIE);\n+\t\treturn -1;\n+\t}\n+\n+\t/* Unsuccessful Test */\n+\tret = rte_power_uncore_freq_max(INVALID_PKG, INVALID_DIE);\n+\tif (ret == 0) {\n+\t\tprintf(\"Unexpectedly set invalid max uncore frequency for pkg %u die %u\\n\",\n+\t\t\t\t\t\t\tINVALID_PKG, INVALID_DIE);\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int\n+check_power_uncore_freq_min(void)\n+{\n+\tint ret;\n+\n+\t/* Successfully get min uncore freq */\n+\tret = rte_power_uncore_freq_min(VALID_PKG, VALID_DIE);\n+\tif (ret < 0) {\n+\t\tprintf(\"Failed to set min uncore frequency for pkg %u die %u\\n\",\n+\t\t\t\t\t\t\tVALID_PKG, VALID_DIE);\n+\t\treturn -1;\n+\t}\n+\n+\t/* Unsuccessful Test */\n+\tret = rte_power_uncore_freq_min(INVALID_PKG, INVALID_DIE);\n+\tif (ret == 0) {\n+\t\tprintf(\"Unexpectedly set invalid min uncore frequency for pkg %u die %u\\n\",\n+\t\t\t\t\t\t\tINVALID_PKG, INVALID_DIE);\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int\n+check_power_uncore_get_num_freqs(void)\n+{\n+\tint ret;\n+\n+\t/* Successfully get number of uncore freq */\n+\tret = rte_power_uncore_get_num_freqs(VALID_PKG, VALID_DIE);\n+\tif (ret < 0) {\n+\t\tprintf(\"Failed to get number of uncore frequencies for pkg %u die %u\\n\",\n+\t\t\t\t\t\t\tVALID_PKG, VALID_DIE);\n+\t\treturn -1;\n+\t}\n+\n+\t/* Unsuccessful Test */\n+\tret = rte_power_uncore_get_num_freqs(INVALID_PKG, INVALID_DIE);\n+\tif (ret >= 0) {\n+\t\tprintf(\"Unexpectedly got number of invalid frequencies for pkg %u die %u\\n\",\n+\t\t\t\t\t\t\tINVALID_PKG, INVALID_DIE);\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int\n+check_power_uncore_get_num_pkgs(void)\n+{\n+\tint ret;\n+\n+\t/* Successfully get number of uncore pkgs */\n+\tret = rte_power_uncore_get_num_pkgs();\n+\tif (ret == 0) {\n+\t\tprintf(\"Failed to get number of uncore pkgs\\n\");\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int\n+check_power_uncore_get_num_dies(void)\n+{\n+\tint ret;\n+\n+\t/* Successfully get number of uncore dies */\n+\tret = rte_power_uncore_get_num_dies(VALID_PKG);\n+\tif (ret == 0) {\n+\t\tprintf(\"Failed to get number of uncore dies for pkg %u\\n\",\n+\t\t\t\t\t\t\tVALID_PKG);\n+\t\treturn -1;\n+\t}\n+\n+\t/* Unsuccessful test */\n+\tret = rte_power_uncore_get_num_dies(INVALID_PKG);\n+\tif (ret > 0) {\n+\t\tprintf(\"Unexpectedly got number of invalid dies for pkg %u\\n\",\n+\t\t\t\t\t\t\tINVALID_PKG);\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int\n+check_power_uncore_exit(void)\n+{\n+\tint ret;\n+\n+\t/* Successfully exit uncore power management */\n+\tret = rte_power_uncore_exit(VALID_PKG, VALID_DIE);\n+\tif (ret < 0) {\n+\t\tprintf(\"Failed to exit uncore power management for pkg %u die %u\\n\",\n+\t\t\t\t\t\t\tVALID_PKG, VALID_DIE);\n+\t}\n+\n+\t/* Unsuccessful Test */\n+\tret = rte_power_uncore_exit(INVALID_PKG, INVALID_DIE);\n+\tif (ret == 0) {\n+\t\tprintf(\"Unexpectedly was able to exit uncore power management for pkg %u die %u\\n\",\n+\t\t\t\t\t\t\tINVALID_PKG, INVALID_DIE);\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int\n+test_power_uncore(void)\n+{\n+\tint ret;\n+\n+\tret = check_power_uncore_init();\n+\tif (ret < 0)\n+\t\tgoto fail_all;\n+\n+\tret = check_power_get_uncore_freq();\n+\tif (ret < 0)\n+\t\tgoto fail_all;\n+\n+\tret = check_power_set_uncore_freq();\n+\tif (ret < 0)\n+\t\tgoto fail_all;\n+\n+\tret = check_power_uncore_freq_max();\n+\tif (ret < 0)\n+\t\tgoto fail_all;\n+\n+\tret = check_power_uncore_freq_min();\n+\tif (ret < 0)\n+\t\tgoto fail_all;\n+\n+\tret = check_power_uncore_get_num_freqs();\n+\tif (ret < 0)\n+\t\tgoto fail_all;\n+\n+\tret = check_power_uncore_get_num_pkgs();\n+\tif (ret < 0)\n+\t\tgoto fail_all;\n+\n+\tret = check_power_uncore_get_num_dies();\n+\tif (ret < 0)\n+\t\tgoto fail_all;\n+\n+\tret = check_power_uncore_exit();\n+\tif (ret < 0)\n+\t\treturn -1;\n+\n+\treturn 0;\n+\n+fail_all:\n+\trte_power_uncore_exit(VALID_PKG, VALID_DIE);\n+\treturn -1;\n+}\n+#endif\n+\n+REGISTER_TEST_COMMAND(power_uncore_autotest, test_power_uncore);\n", "prefixes": [ "v3", "3/3" ] }{ "id": 116420, "url": "