Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/89207/?format=api
http://patches.dpdk.org/api/patches/89207/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210316093811.32651-1-david.hunt@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": "<20210316093811.32651-1-david.hunt@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20210316093811.32651-1-david.hunt@intel.com", "date": "2021-03-16T09:38:11", "name": "[v1] lib/power: add check for sysfs base frequency", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "3a611db4c61505fd46079011ae5dc01adf7b35f5", "submitter": { "id": 342, "url": "http://patches.dpdk.org/api/people/342/?format=api", "name": "Hunt, David", "email": "david.hunt@intel.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20210316093811.32651-1-david.hunt@intel.com/mbox/", "series": [ { "id": 15688, "url": "http://patches.dpdk.org/api/series/15688/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=15688", "date": "2021-03-16T09:38:11", "name": "[v1] lib/power: add check for sysfs base frequency", "version": 1, "mbox": "http://patches.dpdk.org/series/15688/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/89207/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/89207/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 2B9F1A054F;\n\tTue, 16 Mar 2021 10:38:31 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 11E762428EE;\n\tTue, 16 Mar 2021 10:38:31 +0100 (CET)", "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n by mails.dpdk.org (Postfix) with ESMTP id 051F22428CA\n for <dev@dpdk.org>; Tue, 16 Mar 2021 10:38:28 +0100 (CET)", "from orsmga005.jf.intel.com ([10.7.209.41])\n by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 16 Mar 2021 02:38:27 -0700", "from silpixa00399952.ir.intel.com (HELO\n silpixa00399952.ger.corp.intel.com) ([10.237.222.38])\n by orsmga005.jf.intel.com with ESMTP; 16 Mar 2021 02:38:26 -0700" ], "IronPort-SDR": [ "\n mSWS3d1IlT+NgtCDdUlLjXD2oe2bYxpDbh+kxqbZlKJB9KFRD9oC0/8ACtLAlnLfhhR+FPLT9v\n JMNLBjjaFzvg==", "\n qAZNYzvD5oeEmaaaiUDOOrWrvPUJObf+Au68jrOo5GHuGdxDU/rFIny5iTayf5Re/PRYo1E4Lp\n i6xXM3HX+jqQ==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9924\"; a=\"253246294\"", "E=Sophos;i=\"5.81,251,1610438400\"; d=\"scan'208\";a=\"253246294\"", "E=Sophos;i=\"5.81,251,1610438400\"; d=\"scan'208\";a=\"590601620\"" ], "X-ExtLoop1": "1", "From": "David Hunt <david.hunt@intel.com>", "To": "dev@dpdk.org", "Cc": "david.hunt@intel.com,\n\tanatoly.burakov@intel.com", "Date": "Tue, 16 Mar 2021 09:38:11 +0000", "Message-Id": "<20210316093811.32651-1-david.hunt@intel.com>", "X-Mailer": "git-send-email 2.17.1", "Subject": "[dpdk-dev] [PATCH v1] lib/power: add check for sysfs base frequency", "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", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Some kernels may show in incorrect value for base frequency in\nsysfs (e.g. 15 GHz). This throws off the SST-BF algorithm for\nhigh and low priority cores. So if base_frequency is greater\nthan max turbo frequency, ignore, and handle it as a normal\ncore.\n\nKnown Kernel version with issue: Linux 5.8.7\n\nSigned-off-by: David Hunt <david.hunt@intel.com>\n---\n lib/librte_power/power_pstate_cpufreq.c | 40 ++++++++++++++++++++++---\n 1 file changed, 36 insertions(+), 4 deletions(-)", "diff": "diff --git a/lib/librte_power/power_pstate_cpufreq.c b/lib/librte_power/power_pstate_cpufreq.c\nindex edf6328e5..8a1fffaed 100644\n--- a/lib/librte_power/power_pstate_cpufreq.c\n+++ b/lib/librte_power/power_pstate_cpufreq.c\n@@ -154,29 +154,49 @@ out:\tclose(fd);\n static int\n power_init_for_setting_freq(struct pstate_power_info *pi)\n {\n-\tFILE *f_min, *f_max, *f_base;\n+\tFILE *f_min, *f_max, *f_base = NULL, *f_base_max;\n \tchar fullpath_min[PATH_MAX];\n \tchar fullpath_max[PATH_MAX];\n \tchar fullpath_base[PATH_MAX];\n+\tchar fullpath_base_max[PATH_MAX];\n \tchar buf_base[BUFSIZ];\n \tchar *s_base;\n+\tchar *s_base_max;\n \tuint32_t base_ratio = 0;\n+\tuint32_t base_max_ratio = 0;\n \tuint64_t max_non_turbo = 0;\n \tint ret_val = 0;\n \n-\tsnprintf(fullpath_min, sizeof(fullpath_min), POWER_SYSFILE_MIN_FREQ,\n+\tsnprintf(fullpath_base_max,\n+\t\t\tsizeof(fullpath_base_max),\n+\t\t\tPOWER_SYSFILE_BASE_MAX_FREQ,\n \t\t\tpi->lcore_id);\n+\tf_base_max = fopen(fullpath_base_max, \"r\");\n+\tFOPEN_OR_ERR_RET(f_base_max, -1);\n+\tif (f_base_max != NULL) {\n+\t\ts_base_max = fgets(buf_base, sizeof(buf_base), f_base_max);\n+\t\tFOPS_OR_NULL_GOTO(s_base_max, out);\n \n+\t\tbuf_base[BUFSIZ-1] = '\\0';\n+\t\tif (strlen(buf_base))\n+\t\t\t/* Strip off terminating '\\n' */\n+\t\t\tstrtok(buf_base, \"\\n\");\n+\n+\t\tbase_max_ratio =\n+\t\t\tstrtoul(buf_base, NULL, POWER_CONVERT_TO_DECIMAL)\n+\t\t\t\t/ BUS_FREQ;\n+\t}\n+\n+\tsnprintf(fullpath_min, sizeof(fullpath_min), POWER_SYSFILE_MIN_FREQ,\n+\t\t\tpi->lcore_id);\n \tf_min = fopen(fullpath_min, \"rw+\");\n \tFOPEN_OR_ERR_RET(f_min, -1);\n \n \tsnprintf(fullpath_max, sizeof(fullpath_max), POWER_SYSFILE_MAX_FREQ,\n \t\t\tpi->lcore_id);\n-\n \tf_max = fopen(fullpath_max, \"rw+\");\n \tif (f_max == NULL)\n \t\tfclose(f_min);\n-\n \tFOPEN_OR_ERR_RET(f_max, -1);\n \n \tpi->f_cur_min = f_min;\n@@ -186,6 +206,7 @@ power_init_for_setting_freq(struct pstate_power_info *pi)\n \t\t\tpi->lcore_id);\n \n \tf_base = fopen(fullpath_base, \"r\");\n+\tFOPEN_OR_ERR_RET(f_base, -1);\n \tif (f_base == NULL) {\n \t\t/* No sysfs base_frequency, that's OK, continue without */\n \t\tbase_ratio = 0;\n@@ -215,6 +236,17 @@ power_init_for_setting_freq(struct pstate_power_info *pi)\n \n \tpi->non_turbo_max_ratio = max_non_turbo;\n \n+\t/*\n+\t * If base_frequency is reported as greater than the maximum\n+\t * turbo frequency, that's a known issue with some kernels.\n+\t * Set base_frequency to max_non_turbo as a workaround.\n+\t */\n+\tif (base_ratio > base_max_ratio) {\n+\t\t/* base_ratio is greater than max turbo. Kernel bug. */\n+\t\tpi->priority_core = 0;\n+\t\tgoto out;\n+\t}\n+\n \t/*\n \t * If base_frequency is reported as greater than the maximum\n \t * non-turbo frequency, then mark it as a high priority core.\n", "prefixes": [ "v1" ] }{ "id": 89207, "url": "