Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/117446/?format=api
http://patchwork.dpdk.org/api/patches/117446/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20221006093803.2076768-4-tadhg.kearney@intel.com/", "project": { "id": 1, "url": "http://patchwork.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20221006093803.2076768-4-tadhg.kearney@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20221006093803.2076768-4-tadhg.kearney@intel.com", "date": "2022-10-06T09:38:03", "name": "[v9,3/3] test/power: add unit tests for uncore API", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "7535f7c45fd5d64fa576434e9910da120cde6ead", "submitter": { "id": 2533, "url": "http://patchwork.dpdk.org/api/people/2533/?format=api", "name": "Tadhg Kearney", "email": "tadhg.kearney@intel.com" }, "delegate": { "id": 1, "url": "http://patchwork.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20221006093803.2076768-4-tadhg.kearney@intel.com/mbox/", "series": [ { "id": 25007, "url": "http://patchwork.dpdk.org/api/series/25007/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=25007", "date": "2022-10-06T09:38:00", "name": "add Intel uncore api to be called through l3fwd-power", "version": 9, "mbox": "http://patchwork.dpdk.org/series/25007/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/117446/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/117446/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-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 DAFDFA00C2;\n\tThu, 6 Oct 2022 11:39:03 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 6065642BED;\n\tThu, 6 Oct 2022 11:38:52 +0200 (CEST)", "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n by mails.dpdk.org (Postfix) with ESMTP id A597C42BDC\n for <dev@dpdk.org>; Thu, 6 Oct 2022 11:38:49 +0200 (CEST)", "from fmsmga002.fm.intel.com ([10.253.24.26])\n by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 06 Oct 2022 02:38:49 -0700", "from silpixa00401183.ir.intel.com ([10.55.129.143])\n by fmsmga002.fm.intel.com with ESMTP; 06 Oct 2022 02:38:47 -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=1665049129; x=1696585129;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=ptT72pqqBMrLVEDxn0kJCYbSXizRw+bM6W/MxZoQb0g=;\n b=CCQDyFK6YSDLY+R0DBksmHq1ZO3fkYP5nFeybD79ZIp0JuIQiLfdeo36\n RF5r7fTCk4JAKskQoAbSklnZHg2xt6HSfRKi6pHyyn0eXi0AjjHhl31Oa\n 2/u0rM3HHFcIlsQ+es1WAwMJcZ+T3gh4C15xG9dh+bqtcQLyUGumDuOk8\n Ub1GXus0B3BlJvlNxgLy7186u8TxNTWB9Zzn10f894cBDjqsvez0qDUrY\n +9HFMeafwssRG63+jwDowciTyp5roiCWYfw579Blk59bPHdmIKxnlm24R\n piUfLt4Mdnl+0Q6K5TUHz2/cpPbzC1nJRFgEMayVcWaU1Y86Ah1U1W70F Q==;", "X-IronPort-AV": [ "E=McAfee;i=\"6500,9779,10491\"; a=\"329821572\"", "E=Sophos;i=\"5.95,163,1661842800\"; d=\"scan'208\";a=\"329821572\"", "E=McAfee;i=\"6500,9779,10491\"; a=\"729072528\"", "E=Sophos;i=\"5.95,163,1661842800\"; d=\"scan'208\";a=\"729072528\"" ], "X-ExtLoop1": "1", "From": "Tadhg Kearney <tadhg.kearney@intel.com>", "To": "dev@dpdk.org", "Cc": "david.hunt@intel.com, anatoly.burakov@intel.com, reshma.pattan@intel.com,\n thomas@monjalon.net, Tadhg Kearney <tadhg.kearney@intel.com>", "Subject": "[PATCH v9 3/3] test/power: add unit tests for uncore API", "Date": "Thu, 6 Oct 2022 09:38:03 +0000", "Message-Id": "<20221006093803.2076768-4-tadhg.kearney@intel.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20221006093803.2076768-1-tadhg.kearney@intel.com>", "References": "<20221005162023.1923558-1-tadhg.kearney@intel.com>\n <20221006093803.2076768-1-tadhg.kearney@intel.com>", "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 <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "Add basic unit tests covering all nine uncore API's.\n\nSigned-off-by: Tadhg Kearney <tadhg.kearney@intel.com>\nReviewed-by: David Hunt <david.hunt@intel.com>\nAcked-by: David Hunt <david.hunt@intel.com>\n---\n app/test/meson.build | 2 +\n app/test/test_power_intel_uncore.c | 301 +++++++++++++++++++++++++++++\n 2 files changed, 303 insertions(+)\n create mode 100644 app/test/test_power_intel_uncore.c", "diff": "diff --git a/app/test/meson.build b/app/test/meson.build\nindex d5cad72116..396b133959 100644\n--- a/app/test/meson.build\n+++ b/app/test/meson.build\n@@ -101,6 +101,7 @@ test_sources = files(\n 'test_power.c',\n 'test_power_cpufreq.c',\n 'test_power_kvm_vm.c',\n+ 'test_power_intel_uncore.c',\n 'test_prefetch.c',\n 'test_rand_perf.c',\n 'test_rawdev.c',\n@@ -241,6 +242,7 @@ fast_tests = [\n ['power_cpufreq_autotest', false, true],\n ['power_autotest', true, true],\n ['power_kvm_vm_autotest', false, true],\n+ ['power_intel_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_intel_uncore.c b/app/test/test_power_intel_uncore.c\nnew file mode 100644\nindex 0000000000..31163af84e\n--- /dev/null\n+++ b/app/test/test_power_intel_uncore.c\n@@ -0,0 +1,301 @@\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_intel_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_intel_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 unsuccessfully set invalid 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_intel_uncore(void)\n+{\n+\tint ret;\n+\n+\tret = rte_power_uncore_get_num_pkgs();\n+\tif (ret == 0) {\n+\t\tprintf(\"Uncore frequency management not supported/enabled on this kernel. \"\n+\t\t\"Please enable CONFIG_INTEL_UNCORE_FREQ_CONTROL if on x86 with linux kernel\"\n+\t\t\" >= 5.6\\n\");\n+\t\treturn TEST_SKIPPED;\n+\t}\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_intel_uncore_autotest, test_power_intel_uncore);\n", "prefixes": [ "v9", "3/3" ] }{ "id": 117446, "url": "