Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/52217/?format=api
http://patches.dpdk.org/api/patches/52217/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190403171601.9788-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": "<20190403171601.9788-3-marcinx.hajkowski@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20190403171601.9788-3-marcinx.hajkowski@intel.com", "date": "2019-04-03T17:15:58", "name": "[2/4] power: process cpu freq. query", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "c89dc4c2d85a6d6708f27ec1ad073ab67649c42a", "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/20190403171601.9788-3-marcinx.hajkowski@intel.com/mbox/", "series": [ { "id": 4096, "url": "http://patches.dpdk.org/api/series/4096/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4096", "date": "2019-04-03T17:15:56", "name": "Frequency list query", "version": 1, "mbox": "http://patches.dpdk.org/series/4096/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/52217/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/52217/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 CB9221B54D;\n\tWed, 3 Apr 2019 19:16:41 +0200 (CEST)", "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n\tby dpdk.org (Postfix) with ESMTP id 2D5C61B4ED\n\tfor <dev@dpdk.org>; Wed, 3 Apr 2019 19:16:22 +0200 (CEST)", "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t03 Apr 2019 10:16:21 -0700", "from mhajkowx-mobl.ger.corp.intel.com ([10.104.116.180])\n\tby fmsmga001.fm.intel.com with ESMTP; 03 Apr 2019 10:16:20 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.60,305,1549958400\"; d=\"scan'208\";a=\"161086727\"", "From": "Hajkowski <marcinx.hajkowski@intel.com>", "To": "david.hunt@intel.com", "Cc": "dev@dpdk.org,\n\tMarcin Hajkowski <marcinx.hajkowski@intel.com>", "Date": "Wed, 3 Apr 2019 19:15:58 +0200", "Message-Id": "<20190403171601.9788-3-marcinx.hajkowski@intel.com>", "X-Mailer": "git-send-email 2.20.1.windows.1", "In-Reply-To": "<20190403171601.9788-1-marcinx.hajkowski@intel.com>", "References": "<20190403171601.9788-1-marcinx.hajkowski@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH 2/4] power: process cpu freq. query", "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\nOn query received from VM guest send CPUs frequencies.\n\nSigned-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>\n---\n examples/vm_power_manager/channel_monitor.c | 67 ++++++++++++++++++---\n 1 file changed, 59 insertions(+), 8 deletions(-)", "diff": "diff --git a/examples/vm_power_manager/channel_monitor.c b/examples/vm_power_manager/channel_monitor.c\nindex ed580b36a..69934d4e6 100644\n--- a/examples/vm_power_manager/channel_monitor.c\n+++ b/examples/vm_power_manager/channel_monitor.c\n@@ -628,10 +628,14 @@ apply_policy(struct policy *pol)\n }\n \n static int\n-write_binary_packet(struct channel_packet *pkt, struct channel_info *chan_info)\n+write_binary_packet(void *buffer,\n+\t\tsize_t buffer_len,\n+\t\tstruct channel_info *chan_info)\n {\n-\tint ret, buffer_len = sizeof(*pkt);\n-\tvoid *buffer = pkt;\n+\tint ret;\n+\n+\tif (buffer_len == 0 || buffer == NULL)\n+\t\treturn -1;\n \n \tif (chan_info->fd < 0) {\n \t\tRTE_LOG(ERR, CHANNEL_MONITOR, \"Channel is not connected\\n\");\n@@ -653,13 +657,48 @@ write_binary_packet(struct channel_packet *pkt, struct channel_info *chan_info)\n \treturn 0;\n }\n \n+static int\n+send_freq(struct channel_packet *pkt,\n+\t\tstruct channel_info *chan_info,\n+\t\tbool freq_list)\n+{\n+\tunsigned int vcore_id = pkt->resource_id;\n+\tstruct channel_packet_freq_list channel_pkt_freq_list;\n+\tstruct vm_info info;\n+\n+\tif (get_info_vm(pkt->vm_name, &info) != 0)\n+\t\treturn -1;\n+\n+\tif (!freq_list && vcore_id >= MAX_VCPU_PER_VM)\n+\t\treturn -1;\n+\n+\tchannel_pkt_freq_list.command = CPU_POWER_FREQ_LIST;\n+\tchannel_pkt_freq_list.num_vcpu = info.num_vcpus;\n+\n+\tif (freq_list) {\n+\t\tunsigned int i;\n+\t\tfor (i = 0; i < info.num_vcpus; i++)\n+\t\t\tchannel_pkt_freq_list.freq_list[i] =\n+\t\t\t power_manager_get_current_frequency(info.pcpu_map[i]);\n+\t} else {\n+\t\tchannel_pkt_freq_list.freq_list[vcore_id] =\n+\t\t power_manager_get_current_frequency(info.pcpu_map[vcore_id]);\n+\t}\n+\n+\treturn write_binary_packet(&channel_pkt_freq_list,\n+\t\t\tsizeof(channel_pkt_freq_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 \t\tuint32_t command)\n {\n \tpkt->command = command;\n-\treturn write_binary_packet(pkt, chan_info);\n+\treturn write_binary_packet(pkt,\n+\t\t\tsizeof(struct channel_packet),\n+\t\t\tchan_info);\n }\n \n static int\n@@ -685,8 +724,8 @@ process_request(struct channel_packet *pkt, struct channel_info *chan_info)\n \t\tRTE_LOG(DEBUG, CHANNEL_MONITOR, \"Processing requested cmd for cpu:%d\\n\",\n \t\t\tcore_num);\n \n-\t\tbool valid_unit = true;\n \t\tint scale_res;\n+\t\tbool valid_unit = true;\n \n \t\tswitch (pkt->unit) {\n \t\tcase(CPU_POWER_SCALE_MIN):\n@@ -719,9 +758,9 @@ process_request(struct channel_packet *pkt, struct channel_info *chan_info)\n \t\t\t\t\t\tCPU_POWER_CMD_ACK :\n \t\t\t\t\t\tCPU_POWER_CMD_NACK);\n \t\t\tif (ret < 0)\n-\t\t\t\tRTE_LOG(DEBUG, CHANNEL_MONITOR, \"Error during sending ack command.\\n\");\n+\t\t\t\tRTE_LOG(ERR, CHANNEL_MONITOR, \"Error during sending ack command.\\n\");\n \t\t} else\n-\t\t\tRTE_LOG(DEBUG, CHANNEL_MONITOR, \"Unexpected unit type.\\n\");\n+\t\t\tRTE_LOG(ERR, CHANNEL_MONITOR, \"Unexpected unit type.\\n\");\n \n \t}\n \n@@ -732,7 +771,7 @@ process_request(struct channel_packet *pkt, struct channel_info *chan_info)\n \t\t\t\tchan_info,\n \t\t\t\tCPU_POWER_CMD_ACK);\n \t\tif (ret < 0)\n-\t\t\tRTE_LOG(DEBUG, CHANNEL_MONITOR, \"Error during sending ack command.\\n\");\n+\t\t\tRTE_LOG(ERR, CHANNEL_MONITOR, \"Error during sending ack command.\\n\");\n \t\tupdate_policy(pkt);\n \t\tpolicy_is_set = 1;\n \t}\n@@ -747,6 +786,18 @@ process_request(struct channel_packet *pkt, struct channel_info *chan_info)\n \t\t\t\t \"Policy %s does not exist\\n\", pkt->vm_name);\n \t}\n \n+\tif (pkt->command == CPU_POWER_QUERY_FREQ_LIST ||\n+\t\tpkt->command == CPU_POWER_QUERY_FREQ) {\n+\n+\t\tRTE_LOG(INFO, CHANNEL_MONITOR,\n+\t\t\t\"Frequency for %s requested.\\n\", pkt->vm_name);\n+\t\tint ret = send_freq(pkt,\n+\t\t\t\tchan_info,\n+\t\t\t\tpkt->command == CPU_POWER_QUERY_FREQ_LIST);\n+\t\tif (ret < 0)\n+\t\t\tRTE_LOG(ERR, CHANNEL_MONITOR, \"Error during frequency sending.\\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/4" ] }{ "id": 52217, "url": "