get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 49330,
    "url": "http://patchwork.dpdk.org/api/patches/49330/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1545996779-4098-1-git-send-email-liang.j.ma@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": "<1545996779-4098-1-git-send-email-liang.j.ma@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1545996779-4098-1-git-send-email-liang.j.ma@intel.com",
    "date": "2018-12-28T11:32:59",
    "name": "libs/power: fix the resource leaking issue",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "82983638300ba7444290110f8bb1f5ed276ef74a",
    "submitter": {
        "id": 904,
        "url": "http://patchwork.dpdk.org/api/people/904/?format=api",
        "name": "Liang, Ma",
        "email": "liang.j.ma@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/1545996779-4098-1-git-send-email-liang.j.ma@intel.com/mbox/",
    "series": [
        {
            "id": 2968,
            "url": "http://patchwork.dpdk.org/api/series/2968/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=2968",
            "date": "2018-12-28T11:32:59",
            "name": "libs/power: fix the resource leaking issue",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/2968/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/49330/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/49330/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id D25EB5F51;\n\tFri, 28 Dec 2018 12:33:07 +0100 (CET)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id 8B7885F21\n\tfor <dev@dpdk.org>; Fri, 28 Dec 2018 12:33:05 +0100 (CET)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t28 Dec 2018 03:33:04 -0800",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga001.jf.intel.com with ESMTP; 28 Dec 2018 03:33:03 -0800",
            "from sivswdev09.ir.intel.com (sivswdev09.ir.intel.com\n\t[10.237.217.48])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\twBSBX2ct012466; Fri, 28 Dec 2018 11:33:02 GMT",
            "from sivswdev09.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev09.ir.intel.com with ESMTP id wBSBX2hn004174;\n\tFri, 28 Dec 2018 11:33:02 GMT",
            "(from lma25@localhost)\n\tby sivswdev09.ir.intel.com with LOCAL id wBSBX20x004170;\n\tFri, 28 Dec 2018 11:33:02 GMT"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.56,409,1539673200\"; d=\"scan'208\";a=\"122292237\"",
        "From": "Liang Ma <liang.j.ma@intel.com>",
        "To": "david.hunt@intel.com",
        "Cc": "dev@dpdk.org, anatoly.burakov@intel.com, lei.a.yao@intel.com,\n\tLiang Ma <liang.j.ma@intel.com>",
        "Date": "Fri, 28 Dec 2018 11:32:59 +0000",
        "Message-Id": "<1545996779-4098-1-git-send-email-liang.j.ma@intel.com>",
        "X-Mailer": "git-send-email 1.7.7.4",
        "Subject": "[dpdk-dev] [PATCH] libs/power: fix the resource leaking issue",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Fixes: e6c6dc0f96c8 (\"power: add p-state driver compatibility\")\nCoverity issue: 328528\n\nAlso add the missing functionality of enable/disable turbo\n\nSigned-off-by: Liang Ma <liang.j.ma@intel.com>\n---\n lib/librte_power/power_pstate_cpufreq.c | 34 ++++++++++++++++++++++++++++++++-\n 1 file changed, 33 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/lib/librte_power/power_pstate_cpufreq.c b/lib/librte_power/power_pstate_cpufreq.c\nindex 411d0eb..cb226a5 100644\n--- a/lib/librte_power/power_pstate_cpufreq.c\n+++ b/lib/librte_power/power_pstate_cpufreq.c\n@@ -160,6 +160,10 @@ power_init_for_setting_freq(struct pstate_power_info *pi)\n \t\t\tpi->lcore_id);\n \n \tf_max = fopen(fullpath_max, \"rw+\");\n+\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@@ -214,7 +218,13 @@ set_freq_internal(struct pstate_power_info *pi, uint32_t idx)\n \t/* Turbo is available and enabled, first freq bucket is sys max freq */\n \tif (pi->turbo_available && pi->turbo_enable && (idx == 0))\n \t\ttarget_freq = pi->sys_max_freq;\n-\telse\n+\telse if (pi->turbo_available && (!pi->turbo_enable) && (idx == 0)) {\n+\n+\t\tRTE_LOG(ERR, POWER, \"Turbo is off, frequency can't be scaled up more %u\\n\",\n+\t\t\t\tpi->lcore_id);\n+\t\treturn -1;\n+\n+\t} else\n \t\ttarget_freq = pi->freqs[idx];\n \n \t/* Decrease freq, the min freq should be updated first */\n@@ -394,6 +404,10 @@ power_get_available_freqs(struct pstate_power_info *pi)\n \tFOPEN_OR_ERR_RET(f_min, ret);\n \n \tf_max = fopen(fullpath_max, \"r\");\n+\n+\tif (f_max == NULL)\n+\t\tfclose(f_min);\n+\n \tFOPEN_OR_ERR_RET(f_max, ret);\n \n \ts_min = fgets(buf_min, sizeof(buf_min), f_min);\n@@ -726,6 +740,14 @@ power_pstate_enable_turbo(unsigned int lcore_id)\n \t\t\treturn -1;\n \t}\n \n+\t/* Max may have changed, so call to max function */\n+\tif (power_pstate_cpufreq_freq_max(lcore_id) < 0) {\n+\t\tRTE_LOG(ERR, POWER,\n+\t\t\t\"Failed to set frequency of lcore %u to max\\n\",\n+\t\t\tlcore_id);\n+\t\t\treturn -1;\n+\t}\n+\n \treturn 0;\n }\n \n@@ -744,6 +766,16 @@ power_pstate_disable_turbo(unsigned int lcore_id)\n \n \tpi->turbo_enable = 0;\n \n+\tif ((pi->turbo_available) && (pi->curr_idx <= 1)) {\n+\t\t/* Try to set freq to max by default coming out of turbo */\n+\t\tif (power_pstate_cpufreq_freq_max(lcore_id) < 0) {\n+\t\t\tRTE_LOG(ERR, POWER,\n+\t\t\t\t\"Failed to set frequency of lcore %u to max\\n\",\n+\t\t\t\tlcore_id);\n+\t\t\treturn -1;\n+\t\t}\n+\t}\n+\n \n \treturn 0;\n }\n",
    "prefixes": []
}