get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 53912,
    "url": "http://patches.dpdk.org/api/patches/53912/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190530161517.11916-3-marcinx.hajkowski@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": "<20190530161517.11916-3-marcinx.hajkowski@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190530161517.11916-3-marcinx.hajkowski@intel.com",
    "date": "2019-05-30T16:15:16",
    "name": "[2/3] examples/power_manager: send cpu capabilities on vm request",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "79f730f9a2212f97364a115bf25703e0b4b062f9",
    "submitter": {
        "id": 1246,
        "url": "http://patches.dpdk.org/api/people/1246/?format=api",
        "name": "Marcin Hajkowski",
        "email": "marcinx.hajkowski@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/20190530161517.11916-3-marcinx.hajkowski@intel.com/mbox/",
    "series": [
        {
            "id": 4828,
            "url": "http://patches.dpdk.org/api/series/4828/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4828",
            "date": "2019-05-30T16:15:14",
            "name": "Core capabilities query",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/4828/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/53912/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/53912/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 3D6CC1B94C;\n\tThu, 30 May 2019 18:16:18 +0200 (CEST)",
            "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby dpdk.org (Postfix) with ESMTP id 0EE60493D\n\tfor <dev@dpdk.org>; Thu, 30 May 2019 18:16:13 +0200 (CEST)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t30 May 2019 09:16:12 -0700",
            "from mhajkowx-mobl.ger.corp.intel.com ([10.104.14.177])\n\tby orsmga001.jf.intel.com with ESMTP; 30 May 2019 09:16:11 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Hajkowski <marcinx.hajkowski@intel.com>",
        "To": "david.hunt@intel.com",
        "Cc": "dev@dpdk.org,\n\tMarcin Hajkowski <marcinx.hajkowski@intel.com>",
        "Date": "Thu, 30 May 2019 18:15:16 +0200",
        "Message-Id": "<20190530161517.11916-3-marcinx.hajkowski@intel.com>",
        "X-Mailer": "git-send-email 2.20.1.windows.1",
        "In-Reply-To": "<20190530161517.11916-1-marcinx.hajkowski@intel.com>",
        "References": "<20190530161517.11916-1-marcinx.hajkowski@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 2/3] examples/power_manager: send cpu\n\tcapabilities on vm request",
        "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": "From: Marcin Hajkowski <marcinx.hajkowski@intel.com>\n\nSend capabilities for requested cores.\n\nSigned-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>\n---\n examples/vm_power_manager/channel_monitor.c | 67 +++++++++++++++++++++\n 1 file changed, 67 insertions(+)",
    "diff": "diff --git a/examples/vm_power_manager/channel_monitor.c b/examples/vm_power_manager/channel_monitor.c\nindex bfd9cc38d..731b3b480 100644\n--- a/examples/vm_power_manager/channel_monitor.c\n+++ b/examples/vm_power_manager/channel_monitor.c\n@@ -29,6 +29,7 @@\n #include <rte_cycles.h>\n #include <rte_ethdev.h>\n #include <rte_pmd_i40e.h>\n+#include <rte_power.h>\n \n #include <libvirt/libvirt.h>\n #include \"channel_monitor.h\"\n@@ -704,6 +705,60 @@ send_freq(struct channel_packet *pkt,\n \t\t\tchan_info);\n }\n \n+static int\n+send_capabilities(struct channel_packet *pkt,\n+\t\tstruct channel_info *chan_info,\n+\t\tbool list_requested)\n+{\n+\tunsigned int vcore_id = pkt->resource_id;\n+\tstruct channel_packet_caps_list channel_pkt_caps_list;\n+\tstruct vm_info info;\n+\tstruct rte_power_core_capabilities caps;\n+\tint ret;\n+\n+\tif (get_info_vm(pkt->vm_name, &info) != 0)\n+\t\treturn -1;\n+\n+\tif (!list_requested && vcore_id >= MAX_VCPU_PER_VM)\n+\t\treturn -1;\n+\n+\tif (!info.allow_query)\n+\t\treturn -1;\n+\n+\tchannel_pkt_caps_list.command = CPU_POWER_CAPS_LIST;\n+\tchannel_pkt_caps_list.num_vcpu = info.num_vcpus;\n+\n+\tif (list_requested) {\n+\t\tunsigned int i;\n+\t\tfor (i = 0; i < info.num_vcpus; i++) {\n+\t\t\tret = rte_power_get_capabilities(info.pcpu_map[i],\n+\t\t\t\t\t&caps);\n+\t\t\tif (ret == 0) {\n+\t\t\t\tchannel_pkt_caps_list.turbo[i] =\n+\t\t\t\t\t\tcaps.turbo;\n+\t\t\t\tchannel_pkt_caps_list.priority[i] =\n+\t\t\t\t\t\tcaps.priority;\n+\t\t\t} else\n+\t\t\t\treturn -1;\n+\n+\t\t}\n+\t} else {\n+\t\tret = rte_power_get_capabilities(info.pcpu_map[vcore_id],\n+\t\t\t\t&caps);\n+\t\tif (ret == 0) {\n+\t\t\tchannel_pkt_caps_list.turbo[vcore_id] =\n+\t\t\t\t\tcaps.turbo;\n+\t\t\tchannel_pkt_caps_list.priority[vcore_id] =\n+\t\t\t\t\tcaps.priority;\n+\t\t} else\n+\t\t\treturn -1;\n+\t}\n+\n+\treturn write_binary_packet(&channel_pkt_caps_list,\n+\t\t\tsizeof(channel_pkt_caps_list),\n+\t\t\tchan_info);\n+}\n+\n static int\n send_ack_for_received_cmd(struct channel_packet *pkt,\n \t\tstruct channel_info *chan_info,\n@@ -812,6 +867,18 @@ process_request(struct channel_packet *pkt, struct channel_info *chan_info)\n \t\t\tRTE_LOG(ERR, CHANNEL_MONITOR, \"Error during frequency sending.\\n\");\n \t}\n \n+\tif (pkt->command == CPU_POWER_QUERY_CAPS_LIST ||\n+\t\tpkt->command == CPU_POWER_QUERY_CAPS) {\n+\n+\t\tRTE_LOG(INFO, CHANNEL_MONITOR,\n+\t\t\t\"Capabilities for %s requested.\\n\", pkt->vm_name);\n+\t\tint ret = send_capabilities(pkt,\n+\t\t\t\tchan_info,\n+\t\t\t\tpkt->command == CPU_POWER_QUERY_CAPS_LIST);\n+\t\tif (ret < 0)\n+\t\t\tRTE_LOG(ERR, CHANNEL_MONITOR, \"Error during sending capabilities.\\n\");\n+\t}\n+\n \t/*\n \t * Return is not checked as channel status may have been set to DISABLED\n \t * from management thread\n",
    "prefixes": [
        "2/3"
    ]
}