get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/117398/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 117398,
    "url": "http://patches.dpdk.org/api/patches/117398/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20221005162023.1923558-4-tadhg.kearney@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patches.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": "<20221005162023.1923558-4-tadhg.kearney@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20221005162023.1923558-4-tadhg.kearney@intel.com",
    "date": "2022-10-05T16:20:23",
    "name": "[v8,3/3] test/power: add unit tests for uncore API",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "0cb58361294e0119666dcc5a76ced0716ba73bab",
    "submitter": {
        "id": 2533,
        "url": "http://patches.dpdk.org/api/people/2533/?format=api",
        "name": "Tadhg Kearney",
        "email": "tadhg.kearney@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20221005162023.1923558-4-tadhg.kearney@intel.com/mbox/",
    "series": [
        {
            "id": 24993,
            "url": "http://patches.dpdk.org/api/series/24993/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=24993",
            "date": "2022-10-05T16:20:20",
            "name": "add Intel uncore api to be called through l3fwd-power",
            "version": 8,
            "mbox": "http://patches.dpdk.org/series/24993/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/117398/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/117398/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 6F8E9A0542;\n\tWed,  5 Oct 2022 18:21:00 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 18EF742685;\n\tWed,  5 Oct 2022 18:20:48 +0200 (CEST)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n by mails.dpdk.org (Postfix) with ESMTP id 5CAF14281C\n for <dev@dpdk.org>; Wed,  5 Oct 2022 18:20:46 +0200 (CEST)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 05 Oct 2022 09:20:45 -0700",
            "from silpixa00401183.ir.intel.com ([10.55.129.143])\n by fmsmga004.fm.intel.com with ESMTP; 05 Oct 2022 09:20:44 -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=1664986846; x=1696522846;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=Y06se9xgSTyDaXoe6vIlkSoi6huTDAGLnWWXD5aCU5E=;\n b=njIJxK3eaNqALkSvrMeDcz7dQn3PuklBuxwvNQKHdAwT0Z73so0SWF9K\n etHwOE8Wt2CpPiv+DtzYCIpP8Rh39yZ/NlgAPnYqKgC4dQ71f3oqwziFE\n mRkQYcSg9tB49SDGX3cv3eIYVg2eNqSwmuR4ux5ua7l/5qD9KVfa+a19+\n ibUZ1Kkc0SPmqI2ewBZUiKVVmcUhXa/sXfPspWy8tm0deHGsvNMCumUKg\n kwnadpR5gw5BJ+oz4Z3Rn54yyFeG6sOZA7qOEsNNf2r6EAHKLin6C7cwh\n gfckmfhBfNjX690woh34bTgb0BmAjLlES092wyC5bGCItfFbdjUikKT+G A==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6500,9779,10491\"; a=\"290445964\"",
            "E=Sophos;i=\"5.95,161,1661842800\"; d=\"scan'208\";a=\"290445964\"",
            "E=McAfee;i=\"6500,9779,10491\"; a=\"692944783\"",
            "E=Sophos;i=\"5.95,161,1661842800\"; d=\"scan'208\";a=\"692944783\""
        ],
        "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 v8 3/3] test/power: add unit tests for uncore API",
        "Date": "Wed,  5 Oct 2022 16:20:23 +0000",
        "Message-Id": "<20221005162023.1923558-4-tadhg.kearney@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20221005162023.1923558-1-tadhg.kearney@intel.com>",
        "References": "<20220928133018.1583280-1-tadhg.kearney@intel.com>\n <20221005162023.1923558-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..2ce923a6b3 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_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..4615ce5d19\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_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_uncore_autotest, test_power_intel_uncore);\n",
    "prefixes": [
        "v8",
        "3/3"
    ]
}