get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 85306,
    "url": "https://patches.dpdk.org/api/patches/85306/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20201217113656.28884-1-david.hunt@intel.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20201217113656.28884-1-david.hunt@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201217113656.28884-1-david.hunt@intel.com",
    "date": "2020-12-17T11:36:56",
    "name": "[v1] power: fix make build for power apps",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "1b8cd9a6e58ce9e518d4a1fa2b00f12b78d0b0fe",
    "submitter": {
        "id": 342,
        "url": "https://patches.dpdk.org/api/people/342/?format=api",
        "name": "Hunt, David",
        "email": "david.hunt@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20201217113656.28884-1-david.hunt@intel.com/mbox/",
    "series": [
        {
            "id": 14347,
            "url": "https://patches.dpdk.org/api/series/14347/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=14347",
            "date": "2020-12-17T11:36:56",
            "name": "[v1] power: fix make build for power apps",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/14347/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/85306/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/85306/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 076FCA09F6;\n\tThu, 17 Dec 2020 12:37:16 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id E77E4CA26;\n\tThu, 17 Dec 2020 12:37:05 +0100 (CET)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n by dpdk.org (Postfix) with ESMTP id 4A684CA08;\n Thu, 17 Dec 2020 12:37:03 +0100 (CET)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 17 Dec 2020 03:37:01 -0800",
            "from silpixa00399952.ir.intel.com (HELO\n silpixa00399952.ger.corp.intel.com) ([10.237.222.38])\n by fmsmga006.fm.intel.com with ESMTP; 17 Dec 2020 03:36:59 -0800"
        ],
        "IronPort-SDR": [
            "\n C+Cws8Gq2DqeN9sDEA2X2R7VwMIfqPqyAd8o9LRCY2hoMLz2q1W3YUNVynajYJuK/+bkA3wBg6\n H2sdxDtxZ5iw==",
            "\n DIKJDmRtRyboWXUHIoo/8lDz+NUrI9MBG+r742R2yC0TLyWRTppcHSaS15V1xAeuumGI3kS6Ht\n txjE/yglUnQw=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9837\"; a=\"172666185\"",
            "E=Sophos;i=\"5.78,426,1599548400\"; d=\"scan'208\";a=\"172666185\"",
            "E=Sophos;i=\"5.78,426,1599548400\"; d=\"scan'208\";a=\"557767508\""
        ],
        "X-ExtLoop1": "1",
        "From": "David Hunt <david.hunt@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "david.hunt@intel.com, stable@dpdk.org,\n Bruce Richardson <bruce.richardson@intel.com>",
        "Date": "Thu, 17 Dec 2020 11:36:56 +0000",
        "Message-Id": "<20201217113656.28884-1-david.hunt@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "Subject": "[dpdk-dev] [PATCH v1] power: fix make build for power apps",
        "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 <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": "From: Bruce Richardson <bruce.richardson@intel.com>\n\nThe guest channel message definitions and commands in guest_channel.h file\nare needed by applications and need to be made public.\n\nThis patch is needed because make is broken for the power_mgmt apps, as\nthe channel commands API is private. This previously built within DPDK,\nbut now with all the meson/ninja changes, making these apps externally\nno longer works. To fix, we need to move the header file with the API\ndefinitions for the channel commands public, and rename the functionss\naccordingly.\n\nThe main change is to rename channel_commands.h to\nrte_power_guest_channel.h so that it gets picked up by the installer and\ncopied to /usr/local/include. Other changes include renaming #defines to\nhave RTE_ at the beginning instead of CPU_. Finally we refactor the code\nto work with those changes.\n\nFixes: 210c383e247b (\"power: packet format for vm power management\")\nFixes: cd0d5547e873 (\"power: vm communication channels in guest\")\nCc: stable@dpdk.org\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\nSigned-off-by: David Hunt <david.hunt@intel.com>\n---\n examples/vm_power_manager/channel_manager.c   |   1 -\n examples/vm_power_manager/channel_monitor.c   | 148 ++++++++--------\n examples/vm_power_manager/channel_monitor.h   |  10 +-\n examples/vm_power_manager/guest_cli/main.c    |  31 ++--\n .../guest_cli/vm_power_cli_guest.c            |  70 ++++----\n .../guest_cli/vm_power_cli_guest.h            |   6 +-\n examples/vm_power_manager/main.c              |   2 +-\n examples/vm_power_manager/vm_power_cli.c      |   1 -\n lib/librte_power/channel_commands.h           | 125 --------------\n lib/librte_power/guest_channel.c              |  11 +-\n lib/librte_power/guest_channel.h              |  45 +----\n lib/librte_power/meson.build                  |   3 +-\n lib/librte_power/power_kvm_vm.c               |  17 +-\n lib/librte_power/rte_power.h                  |   1 +\n lib/librte_power/rte_power_guest_channel.h    | 160 ++++++++++++++++++\n 15 files changed, 320 insertions(+), 311 deletions(-)\n delete mode 100644 lib/librte_power/channel_commands.h\n create mode 100644 lib/librte_power/rte_power_guest_channel.h",
    "diff": "diff --git a/examples/vm_power_manager/channel_manager.c b/examples/vm_power_manager/channel_manager.c\nindex a26315051..0a28cb643 100644\n--- a/examples/vm_power_manager/channel_manager.c\n+++ b/examples/vm_power_manager/channel_manager.c\n@@ -27,7 +27,6 @@\n #include <libvirt/libvirt.h>\n \n #include \"channel_manager.h\"\n-#include \"channel_commands.h\"\n #include \"channel_monitor.h\"\n #include \"power_manager.h\"\n \ndiff --git a/examples/vm_power_manager/channel_monitor.c b/examples/vm_power_manager/channel_monitor.c\nindex 228f06803..46c0a8208 100644\n--- a/examples/vm_power_manager/channel_monitor.c\n+++ b/examples/vm_power_manager/channel_monitor.c\n@@ -35,7 +35,6 @@\n \n #include <libvirt/libvirt.h>\n #include \"channel_monitor.h\"\n-#include \"channel_commands.h\"\n #include \"channel_manager.h\"\n #include \"power_manager.h\"\n #include \"oob_monitor.h\"\n@@ -108,7 +107,7 @@ str_to_ether_addr(const char *a, struct rte_ether_addr *ether_addr)\n }\n \n static int\n-set_policy_mac(struct channel_packet *pkt, int idx, char *mac)\n+set_policy_mac(struct rte_power_channel_packet *pkt, int idx, char *mac)\n {\n \tunion PFID pfid;\n \tint ret;\n@@ -165,7 +164,7 @@ get_resource_id_from_vmname(const char *vm_name)\n }\n \n static int\n-parse_json_to_pkt(json_t *element, struct channel_packet *pkt,\n+parse_json_to_pkt(json_t *element, struct rte_power_channel_packet *pkt,\n \t\t\t\t\tconst char *vm_name)\n {\n \tconst char *key;\n@@ -173,14 +172,14 @@ parse_json_to_pkt(json_t *element, struct channel_packet *pkt,\n \tint ret;\n \tint resource_id;\n \n-\tmemset(pkt, 0, sizeof(struct channel_packet));\n+\tmemset(pkt, 0, sizeof(struct rte_power_channel_packet));\n \n \tpkt->nb_mac_to_monitor = 0;\n \tpkt->t_boost_status.tbEnabled = false;\n-\tpkt->workload = LOW;\n-\tpkt->policy_to_use = TIME;\n-\tpkt->command = PKT_POLICY;\n-\tpkt->core_type = CORE_TYPE_PHYSICAL;\n+\tpkt->workload = RTE_POWER_WL_LOW;\n+\tpkt->policy_to_use = RTE_POWER_POLICY_TIME;\n+\tpkt->command = RTE_POWER_PKT_POLICY;\n+\tpkt->core_type = RTE_POWER_CORE_TYPE_PHYSICAL;\n \n \tif (vm_name == NULL) {\n \t\tRTE_LOG(ERR, CHANNEL_MONITOR,\n@@ -203,11 +202,11 @@ parse_json_to_pkt(json_t *element, struct channel_packet *pkt,\n \t\t\tchar command[32];\n \t\t\tstrlcpy(command, json_string_value(value), 32);\n \t\t\tif (!strcmp(command, \"power\")) {\n-\t\t\t\tpkt->command = CPU_POWER;\n+\t\t\t\tpkt->command = RTE_POWER_CPU_POWER;\n \t\t\t} else if (!strcmp(command, \"create\")) {\n-\t\t\t\tpkt->command = PKT_POLICY;\n+\t\t\t\tpkt->command = RTE_POWER_PKT_POLICY;\n \t\t\t} else if (!strcmp(command, \"destroy\")) {\n-\t\t\t\tpkt->command = PKT_POLICY_REMOVE;\n+\t\t\t\tpkt->command = RTE_POWER_PKT_POLICY_REMOVE;\n \t\t\t} else {\n \t\t\t\tRTE_LOG(ERR, CHANNEL_MONITOR,\n \t\t\t\t\t\"Invalid command received in JSON\\n\");\n@@ -217,13 +216,17 @@ parse_json_to_pkt(json_t *element, struct channel_packet *pkt,\n \t\t\tchar command[32];\n \t\t\tstrlcpy(command, json_string_value(value), 32);\n \t\t\tif (!strcmp(command, \"TIME\")) {\n-\t\t\t\tpkt->policy_to_use = TIME;\n+\t\t\t\tpkt->policy_to_use =\n+\t\t\t\t\t\tRTE_POWER_POLICY_TIME;\n \t\t\t} else if (!strcmp(command, \"TRAFFIC\")) {\n-\t\t\t\tpkt->policy_to_use = TRAFFIC;\n+\t\t\t\tpkt->policy_to_use =\n+\t\t\t\t\t\tRTE_POWER_POLICY_TRAFFIC;\n \t\t\t} else if (!strcmp(command, \"WORKLOAD\")) {\n-\t\t\t\tpkt->policy_to_use = WORKLOAD;\n+\t\t\t\tpkt->policy_to_use =\n+\t\t\t\t\t\tRTE_POWER_POLICY_WORKLOAD;\n \t\t\t} else if (!strcmp(command, \"BRANCH_RATIO\")) {\n-\t\t\t\tpkt->policy_to_use = BRANCH_RATIO;\n+\t\t\t\tpkt->policy_to_use =\n+\t\t\t\t\t\tRTE_POWER_POLICY_BRANCH_RATIO;\n \t\t\t} else {\n \t\t\t\tRTE_LOG(ERR, CHANNEL_MONITOR,\n \t\t\t\t\t\"Wrong policy_type received in JSON\\n\");\n@@ -233,11 +236,11 @@ parse_json_to_pkt(json_t *element, struct channel_packet *pkt,\n \t\t\tchar command[32];\n \t\t\tstrlcpy(command, json_string_value(value), 32);\n \t\t\tif (!strcmp(command, \"HIGH\")) {\n-\t\t\t\tpkt->workload = HIGH;\n+\t\t\t\tpkt->workload = RTE_POWER_WL_HIGH;\n \t\t\t} else if (!strcmp(command, \"MEDIUM\")) {\n-\t\t\t\tpkt->workload = MEDIUM;\n+\t\t\t\tpkt->workload = RTE_POWER_WL_MEDIUM;\n \t\t\t} else if (!strcmp(command, \"LOW\")) {\n-\t\t\t\tpkt->workload = LOW;\n+\t\t\t\tpkt->workload = RTE_POWER_WL_LOW;\n \t\t\t} else {\n \t\t\t\tRTE_LOG(ERR, CHANNEL_MONITOR,\n \t\t\t\t\t\"Wrong workload received in JSON\\n\");\n@@ -283,17 +286,17 @@ parse_json_to_pkt(json_t *element, struct channel_packet *pkt,\n \t\t\tchar unit[32];\n \t\t\tstrlcpy(unit, json_string_value(value), 32);\n \t\t\tif (!strcmp(unit, \"SCALE_UP\")) {\n-\t\t\t\tpkt->unit = CPU_POWER_SCALE_UP;\n+\t\t\t\tpkt->unit = RTE_POWER_SCALE_UP;\n \t\t\t} else if (!strcmp(unit, \"SCALE_DOWN\")) {\n-\t\t\t\tpkt->unit = CPU_POWER_SCALE_DOWN;\n+\t\t\t\tpkt->unit = RTE_POWER_SCALE_DOWN;\n \t\t\t} else if (!strcmp(unit, \"SCALE_MAX\")) {\n-\t\t\t\tpkt->unit = CPU_POWER_SCALE_MAX;\n+\t\t\t\tpkt->unit = RTE_POWER_SCALE_MAX;\n \t\t\t} else if (!strcmp(unit, \"SCALE_MIN\")) {\n-\t\t\t\tpkt->unit = CPU_POWER_SCALE_MIN;\n+\t\t\t\tpkt->unit = RTE_POWER_SCALE_MIN;\n \t\t\t} else if (!strcmp(unit, \"ENABLE_TURBO\")) {\n-\t\t\t\tpkt->unit = CPU_POWER_ENABLE_TURBO;\n+\t\t\t\tpkt->unit = RTE_POWER_ENABLE_TURBO;\n \t\t\t} else if (!strcmp(unit, \"DISABLE_TURBO\")) {\n-\t\t\t\tpkt->unit = CPU_POWER_DISABLE_TURBO;\n+\t\t\t\tpkt->unit = RTE_POWER_DISABLE_TURBO;\n \t\t\t} else {\n \t\t\t\tRTE_LOG(ERR, CHANNEL_MONITOR,\n \t\t\t\t\t\"Invalid command received in JSON\\n\");\n@@ -312,7 +315,7 @@ parse_json_to_pkt(json_t *element, struct channel_packet *pkt,\n \t\t\t\tvm_name);\n \t\t\treturn -1;\n \t\t}\n-\t\tstrlcpy(pkt->vm_name, vm_name, VM_MAX_NAME_SZ);\n+\t\tstrlcpy(pkt->vm_name, vm_name, RTE_POWER_VM_MAX_NAME_SZ);\n \t\tpkt->resource_id = resource_id;\n \t}\n \treturn 0;\n@@ -367,7 +370,7 @@ pcpu_monitor(struct policy *pol, struct core_info *ci, int pcpu, int count)\n {\n \tint ret = 0;\n \n-\tif (pol->pkt.policy_to_use == BRANCH_RATIO) {\n+\tif (pol->pkt.policy_to_use == RTE_POWER_POLICY_BRANCH_RATIO) {\n \t\tci->cd[pcpu].oob_enabled = 1;\n \t\tret = add_core_to_monitor(pcpu);\n \t\tif (ret == 0)\n@@ -407,7 +410,7 @@ get_pcpu_to_control(struct policy *pol)\n \t * differenciate between them when adding them to the branch monitor.\n \t * Virtual cores need to be converted to physical cores.\n \t */\n-\tif (pol->pkt.core_type == CORE_TYPE_VIRTUAL) {\n+\tif (pol->pkt.core_type == RTE_POWER_CORE_TYPE_VIRTUAL) {\n \t\t/*\n \t\t * If the cores in the policy are virtual, we need to map them\n \t\t * to physical core. We look up the vm info and use that for\n@@ -463,7 +466,7 @@ get_pfid(struct policy *pol)\n }\n \n static int\n-update_policy(struct channel_packet *pkt)\n+update_policy(struct rte_power_channel_packet *pkt)\n {\n \n \tunsigned int updated = 0;\n@@ -479,7 +482,8 @@ update_policy(struct channel_packet *pkt)\n \t\t\tpolicies[i].pkt = *pkt;\n \t\t\tget_pcpu_to_control(&policies[i]);\n \t\t\t/* Check Eth dev only for Traffic policy */\n-\t\t\tif (policies[i].pkt.policy_to_use == TRAFFIC) {\n+\t\t\tif (policies[i].pkt.policy_to_use ==\n+\t\t\t\t\tRTE_POWER_POLICY_TRAFFIC) {\n \t\t\t\tif (get_pfid(&policies[i]) < 0) {\n \t\t\t\t\tupdated = 1;\n \t\t\t\t\tbreak;\n@@ -496,7 +500,8 @@ update_policy(struct channel_packet *pkt)\n \t\t\t\tpolicies[i].pkt = *pkt;\n \t\t\t\tget_pcpu_to_control(&policies[i]);\n \t\t\t\t/* Check Eth dev only for Traffic policy */\n-\t\t\t\tif (policies[i].pkt.policy_to_use == TRAFFIC) {\n+\t\t\t\tif (policies[i].pkt.policy_to_use ==\n+\t\t\t\t\t\tRTE_POWER_POLICY_TRAFFIC) {\n \t\t\t\t\tif (get_pfid(&policies[i]) < 0) {\n \t\t\t\t\t\tupdated = 1;\n \t\t\t\t\t\tbreak;\n@@ -512,7 +517,7 @@ update_policy(struct channel_packet *pkt)\n }\n \n static int\n-remove_policy(struct channel_packet *pkt __rte_unused)\n+remove_policy(struct rte_power_channel_packet *pkt __rte_unused)\n {\n \tunsigned int i;\n \n@@ -615,7 +620,7 @@ apply_time_profile(struct policy *pol)\n \t/* Format the date and time, down to a single second. */\n \tstrftime(time_string, sizeof(time_string), \"%Y-%m-%d %H:%M:%S\", ptm);\n \n-\tfor (x = 0; x < HOURS; x++) {\n+\tfor (x = 0; x < RTE_POWER_HOURS_PER_DAY; x++) {\n \n \t\tif (ptm->tm_hour == pol->pkt.timer_policy.busy_hours[x]) {\n \t\t\tfor (count = 0; count < pol->pkt.num_vcpu; count++) {\n@@ -648,19 +653,19 @@ apply_workload_profile(struct policy *pol)\n \n \tint count;\n \n-\tif (pol->pkt.workload == HIGH) {\n+\tif (pol->pkt.workload == RTE_POWER_WL_HIGH) {\n \t\tfor (count = 0; count < pol->pkt.num_vcpu; count++) {\n \t\t\tif (pol->core_share[count].status != 1)\n \t\t\t\tpower_manager_scale_core_max(\n \t\t\t\t\t\tpol->core_share[count].pcpu);\n \t\t}\n-\t} else if (pol->pkt.workload == MEDIUM) {\n+\t} else if (pol->pkt.workload == RTE_POWER_WL_MEDIUM) {\n \t\tfor (count = 0; count < pol->pkt.num_vcpu; count++) {\n \t\t\tif (pol->core_share[count].status != 1)\n \t\t\t\tpower_manager_scale_core_med(\n \t\t\t\t\t\tpol->core_share[count].pcpu);\n \t\t}\n-\t} else if (pol->pkt.workload == LOW) {\n+\t} else if (pol->pkt.workload == RTE_POWER_WL_LOW) {\n \t\tfor (count = 0; count < pol->pkt.num_vcpu; count++) {\n \t\t\tif (pol->core_share[count].status != 1)\n \t\t\t\tpower_manager_scale_core_min(\n@@ -673,14 +678,14 @@ static void\n apply_policy(struct policy *pol)\n {\n \n-\tstruct channel_packet *pkt = &pol->pkt;\n+\tstruct rte_power_channel_packet *pkt = &pol->pkt;\n \n \t/*Check policy to use*/\n-\tif (pkt->policy_to_use == TRAFFIC)\n+\tif (pkt->policy_to_use == RTE_POWER_POLICY_TRAFFIC)\n \t\tapply_traffic_profile(pol);\n-\telse if (pkt->policy_to_use == TIME)\n+\telse if (pkt->policy_to_use == RTE_POWER_POLICY_TIME)\n \t\tapply_time_profile(pol);\n-\telse if (pkt->policy_to_use == WORKLOAD)\n+\telse if (pkt->policy_to_use == RTE_POWER_POLICY_WORKLOAD)\n \t\tapply_workload_profile(pol);\n }\n \n@@ -715,24 +720,24 @@ write_binary_packet(void *buffer,\n }\n \n static int\n-send_freq(struct channel_packet *pkt,\n+send_freq(struct rte_power_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 rte_power_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+\tif (!freq_list && vcore_id >= RTE_POWER_MAX_VCPU_PER_VM)\n \t\treturn -1;\n \n \tif (!info.allow_query)\n \t\treturn -1;\n \n-\tchannel_pkt_freq_list.command = CPU_POWER_FREQ_LIST;\n+\tchannel_pkt_freq_list.command = RTE_POWER_FREQ_LIST;\n \tchannel_pkt_freq_list.num_vcpu = info.num_vcpus;\n \n \tif (freq_list) {\n@@ -751,12 +756,12 @@ send_freq(struct channel_packet *pkt,\n }\n \n static int\n-send_capabilities(struct channel_packet *pkt,\n+send_capabilities(struct rte_power_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 rte_power_channel_packet_caps_list channel_pkt_caps_list;\n \tstruct vm_info info;\n \tstruct rte_power_core_capabilities caps;\n \tint ret;\n@@ -764,13 +769,13 @@ send_capabilities(struct channel_packet *pkt,\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+\tif (!list_requested && vcore_id >= RTE_POWER_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.command = RTE_POWER_CAPS_LIST;\n \tchannel_pkt_caps_list.num_vcpu = info.num_vcpus;\n \n \tif (list_requested) {\n@@ -805,18 +810,19 @@ send_capabilities(struct channel_packet *pkt,\n }\n \n static int\n-send_ack_for_received_cmd(struct channel_packet *pkt,\n+send_ack_for_received_cmd(struct rte_power_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,\n-\t\t\tsizeof(struct channel_packet),\n+\t\t\tsizeof(struct rte_power_channel_packet),\n \t\t\tchan_info);\n }\n \n static int\n-process_request(struct channel_packet *pkt, struct channel_info *chan_info)\n+process_request(struct rte_power_channel_packet *pkt,\n+\t\tstruct channel_info *chan_info)\n {\n \tint ret;\n \n@@ -827,10 +833,10 @@ process_request(struct channel_packet *pkt, struct channel_info *chan_info)\n \t\t\tCHANNEL_MGR_CHANNEL_PROCESSING) == 0)\n \t\treturn -1;\n \n-\tif (pkt->command == CPU_POWER) {\n+\tif (pkt->command == RTE_POWER_CPU_POWER) {\n \t\tunsigned int core_num;\n \n-\t\tif (pkt->core_type == CORE_TYPE_VIRTUAL)\n+\t\tif (pkt->core_type == RTE_POWER_CORE_TYPE_VIRTUAL)\n \t\t\tcore_num = get_pcpu(chan_info, pkt->resource_id);\n \t\telse\n \t\t\tcore_num = pkt->resource_id;\n@@ -842,22 +848,22 @@ process_request(struct channel_packet *pkt, struct channel_info *chan_info)\n \t\tbool valid_unit = true;\n \n \t\tswitch (pkt->unit) {\n-\t\tcase(CPU_POWER_SCALE_MIN):\n+\t\tcase(RTE_POWER_SCALE_MIN):\n \t\t\tscale_res = power_manager_scale_core_min(core_num);\n \t\t\tbreak;\n-\t\tcase(CPU_POWER_SCALE_MAX):\n+\t\tcase(RTE_POWER_SCALE_MAX):\n \t\t\tscale_res = power_manager_scale_core_max(core_num);\n \t\t\tbreak;\n-\t\tcase(CPU_POWER_SCALE_DOWN):\n+\t\tcase(RTE_POWER_SCALE_DOWN):\n \t\t\tscale_res = power_manager_scale_core_down(core_num);\n \t\t\tbreak;\n-\t\tcase(CPU_POWER_SCALE_UP):\n+\t\tcase(RTE_POWER_SCALE_UP):\n \t\t\tscale_res = power_manager_scale_core_up(core_num);\n \t\t\tbreak;\n-\t\tcase(CPU_POWER_ENABLE_TURBO):\n+\t\tcase(RTE_POWER_ENABLE_TURBO):\n \t\t\tscale_res = power_manager_enable_turbo_core(core_num);\n \t\t\tbreak;\n-\t\tcase(CPU_POWER_DISABLE_TURBO):\n+\t\tcase(RTE_POWER_DISABLE_TURBO):\n \t\t\tscale_res = power_manager_disable_turbo_core(core_num);\n \t\t\tbreak;\n \t\tdefault:\n@@ -869,8 +875,8 @@ process_request(struct channel_packet *pkt, struct channel_info *chan_info)\n \t\t\tret = send_ack_for_received_cmd(pkt,\n \t\t\t\t\tchan_info,\n \t\t\t\t\tscale_res >= 0 ?\n-\t\t\t\t\t\tCPU_POWER_CMD_ACK :\n-\t\t\t\t\t\tCPU_POWER_CMD_NACK);\n+\t\t\t\t\t\tRTE_POWER_CMD_ACK :\n+\t\t\t\t\t\tRTE_POWER_CMD_NACK);\n \t\t\tif (ret < 0)\n \t\t\t\tRTE_LOG(ERR, CHANNEL_MONITOR, \"Error during sending ack command.\\n\");\n \t\t} else\n@@ -878,19 +884,19 @@ process_request(struct channel_packet *pkt, struct channel_info *chan_info)\n \n \t}\n \n-\tif (pkt->command == PKT_POLICY) {\n+\tif (pkt->command == RTE_POWER_PKT_POLICY) {\n \t\tRTE_LOG(INFO, CHANNEL_MONITOR, \"Processing policy request %s\\n\",\n \t\t\t\tpkt->vm_name);\n \t\tint ret = send_ack_for_received_cmd(pkt,\n \t\t\t\tchan_info,\n-\t\t\t\tCPU_POWER_CMD_ACK);\n+\t\t\t\tRTE_POWER_CMD_ACK);\n \t\tif (ret < 0)\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 \n-\tif (pkt->command == PKT_POLICY_REMOVE) {\n+\tif (pkt->command == RTE_POWER_PKT_POLICY_REMOVE) {\n \t\tret = remove_policy(pkt);\n \t\tif (ret == 0)\n \t\t\tRTE_LOG(INFO, CHANNEL_MONITOR,\n@@ -900,26 +906,26 @@ 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+\tif (pkt->command == RTE_POWER_QUERY_FREQ_LIST ||\n+\t\tpkt->command == RTE_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\t\t\tpkt->command == RTE_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-\tif (pkt->command == CPU_POWER_QUERY_CAPS_LIST ||\n-\t\tpkt->command == CPU_POWER_QUERY_CAPS) {\n+\tif (pkt->command == RTE_POWER_QUERY_CAPS_LIST ||\n+\t\tpkt->command == RTE_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\t\t\tpkt->command == RTE_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@@ -988,7 +994,7 @@ channel_monitor_init(void)\n static void\n read_binary_packet(struct channel_info *chan_info)\n {\n-\tstruct channel_packet pkt;\n+\tstruct rte_power_channel_packet pkt;\n \tvoid *buffer = &pkt;\n \tint buffer_len = sizeof(pkt);\n \tint n_bytes, err = 0;\n@@ -1019,7 +1025,7 @@ read_binary_packet(struct channel_info *chan_info)\n static void\n read_json_packet(struct channel_info *chan_info)\n {\n-\tstruct channel_packet pkt;\n+\tstruct rte_power_channel_packet pkt;\n \tint n_bytes, ret;\n \tjson_t *root;\n \tjson_error_t error;\ndiff --git a/examples/vm_power_manager/channel_monitor.h b/examples/vm_power_manager/channel_monitor.h\nindex 7362a80d2..9184a8327 100644\n--- a/examples/vm_power_manager/channel_monitor.h\n+++ b/examples/vm_power_manager/channel_monitor.h\n@@ -5,8 +5,8 @@\n #ifndef CHANNEL_MONITOR_H_\n #define CHANNEL_MONITOR_H_\n \n+#include <rte_power.h>\n #include \"channel_manager.h\"\n-#include \"channel_commands.h\"\n \n struct core_share {\n \tunsigned int pcpu;\n@@ -18,11 +18,11 @@ struct core_share {\n };\n \n struct policy {\n-\tstruct channel_packet pkt;\n-\tuint32_t pfid[MAX_VFS];\n-\tuint32_t port[MAX_VFS];\n+\tstruct rte_power_channel_packet pkt;\n+\tuint32_t pfid[RTE_POWER_MAX_VFS];\n+\tuint32_t port[RTE_POWER_MAX_VFS];\n \tunsigned int enabled;\n-\tstruct core_share core_share[MAX_VCPU_PER_VM];\n+\tstruct core_share core_share[RTE_POWER_MAX_VCPU_PER_VM];\n };\n \n #ifdef __cplusplus\ndiff --git a/examples/vm_power_manager/guest_cli/main.c b/examples/vm_power_manager/guest_cli/main.c\nindex f63b3c988..4e17f7fb9 100644\n--- a/examples/vm_power_manager/guest_cli/main.c\n+++ b/examples/vm_power_manager/guest_cli/main.c\n@@ -48,10 +48,10 @@ parse_args(int argc, char **argv)\n \t\t{ \"policy\", required_argument, 0, 'o'},\n \t\t{NULL, 0, 0, 0}\n \t};\n-\tstruct channel_packet *policy;\n+\tstruct rte_power_channel_packet *policy;\n \tunsigned short int hours[MAX_HOURS];\n-\tunsigned short int cores[MAX_VCPU_PER_VM];\n-\tunsigned short int ports[MAX_VCPU_PER_VM];\n+\tunsigned short int cores[RTE_POWER_MAX_VCPU_PER_VM];\n+\tunsigned short int ports[RTE_POWER_MAX_VCPU_PER_VM];\n \tint i, cnt, idx;\n \n \tpolicy = get_policy();\n@@ -69,7 +69,8 @@ parse_args(int argc, char **argv)\n \t\tswitch (opt) {\n \t\t/* portmask */\n \t\tcase 'n':\n-\t\t\tstrlcpy(policy->vm_name, optarg, VM_MAX_NAME_SZ);\n+\t\t\tstrlcpy(policy->vm_name, optarg,\n+\t\t\t\t\tRTE_POWER_VM_MAX_NAME_SZ);\n \t\t\tprintf(\"Setting VM Name to [%s]\\n\", policy->vm_name);\n \t\t\tbreak;\n \t\tcase 'b':\n@@ -97,14 +98,15 @@ parse_args(int argc, char **argv)\n \t\t\t}\n \t\t\tbreak;\n \t\tcase 'l':\n-\t\t\tcnt = parse_set(optarg, cores, MAX_VCPU_PER_VM);\n+\t\t\tcnt = parse_set(optarg, cores,\n+\t\t\t\t\tRTE_POWER_MAX_VCPU_PER_VM);\n \t\t\tif (cnt < 0) {\n \t\t\t\tprintf(\"Invalid value passed to vcpu-list - [%s]\\n\",\n \t\t\t\t\t\toptarg);\n \t\t\t\tbreak;\n \t\t\t}\n \t\t\tidx = 0;\n-\t\t\tfor (i = 0; i < MAX_VCPU_PER_VM; i++) {\n+\t\t\tfor (i = 0; i < RTE_POWER_MAX_VCPU_PER_VM; i++) {\n \t\t\t\tif (cores[i]) {\n \t\t\t\t\tprintf(\"***Using core %d\\n\", i);\n \t\t\t\t\tpolicy->vcpu_to_control[idx++] = i;\n@@ -114,14 +116,15 @@ parse_args(int argc, char **argv)\n \t\t\tprintf(\"Total cores: %d\\n\", idx);\n \t\t\tbreak;\n \t\tcase 'p':\n-\t\t\tcnt = parse_set(optarg, ports, MAX_VCPU_PER_VM);\n+\t\t\tcnt = parse_set(optarg, ports,\n+\t\t\t\t\tRTE_POWER_MAX_VCPU_PER_VM);\n \t\t\tif (cnt < 0) {\n \t\t\t\tprintf(\"Invalid value passed to port-list - [%s]\\n\",\n \t\t\t\t\t\toptarg);\n \t\t\t\tbreak;\n \t\t\t}\n \t\t\tidx = 0;\n-\t\t\tfor (i = 0; i < MAX_VCPU_PER_VM; i++) {\n+\t\t\tfor (i = 0; i < RTE_POWER_MAX_VCPU_PER_VM; i++) {\n \t\t\t\tif (ports[i]) {\n \t\t\t\t\tprintf(\"***Using port %d\\n\", i);\n \t\t\t\t\tif (set_policy_mac(i, idx++) != 0) {\n@@ -135,13 +138,17 @@ parse_args(int argc, char **argv)\n \t\t\tbreak;\n \t\tcase 'o':\n \t\t\tif (!strcmp(optarg, \"TRAFFIC\"))\n-\t\t\t\tpolicy->policy_to_use = TRAFFIC;\n+\t\t\t\tpolicy->policy_to_use =\n+\t\t\t\t\t\tRTE_POWER_POLICY_TRAFFIC;\n \t\t\telse if (!strcmp(optarg, \"TIME\"))\n-\t\t\t\tpolicy->policy_to_use = TIME;\n+\t\t\t\tpolicy->policy_to_use =\n+\t\t\t\t\t\tRTE_POWER_POLICY_TIME;\n \t\t\telse if (!strcmp(optarg, \"WORKLOAD\"))\n-\t\t\t\tpolicy->policy_to_use = WORKLOAD;\n+\t\t\t\tpolicy->policy_to_use =\n+\t\t\t\t\t\tRTE_POWER_POLICY_WORKLOAD;\n \t\t\telse if (!strcmp(optarg, \"BRANCH_RATIO\"))\n-\t\t\t\tpolicy->policy_to_use = BRANCH_RATIO;\n+\t\t\t\tpolicy->policy_to_use =\n+\t\t\t\t\t\tRTE_POWER_POLICY_BRANCH_RATIO;\n \t\t\telse {\n \t\t\t\tprintf(\"Invalid policy specified: %s\\n\",\n \t\t\t\t\t\toptarg);\ndiff --git a/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c b/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c\nindex cf1636e78..02b37d877 100644\n--- a/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c\n+++ b/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c\n@@ -19,7 +19,7 @@\n #include <rte_ethdev.h>\n \n #include <rte_power.h>\n-#include <guest_channel.h>\n+#include <rte_power_guest_channel.h>\n \n #include \"vm_power_cli_guest.h\"\n \n@@ -38,9 +38,9 @@ union PFID {\n \tuint64_t pfid;\n };\n \n-static struct channel_packet policy;\n+static struct rte_power_channel_packet policy;\n \n-struct channel_packet *\n+struct rte_power_channel_packet *\n get_policy(void)\n {\n \treturn &policy;\n@@ -49,7 +49,7 @@ get_policy(void)\n int\n set_policy_mac(int port, int idx)\n {\n-\tstruct channel_packet *policy;\n+\tstruct rte_power_channel_packet *policy;\n \tunion PFID pfid;\n \tint ret;\n \n@@ -73,7 +73,7 @@ set_policy_mac(int port, int idx)\n }\n \n int\n-set_policy_defaults(struct channel_packet *pkt)\n+set_policy_defaults(struct rte_power_channel_packet *pkt)\n {\n \tint ret;\n \n@@ -103,10 +103,10 @@ set_policy_defaults(struct channel_packet *pkt)\n \tpkt->timer_policy.hours_to_use_traffic_profile[0] = 8;\n \tpkt->timer_policy.hours_to_use_traffic_profile[1] = 10;\n \n-\tpkt->core_type = CORE_TYPE_VIRTUAL;\n-\tpkt->workload = LOW;\n-\tpkt->policy_to_use = TIME;\n-\tpkt->command = PKT_POLICY;\n+\tpkt->core_type = RTE_POWER_CORE_TYPE_VIRTUAL;\n+\tpkt->workload = RTE_POWER_WL_LOW;\n+\tpkt->policy_to_use = RTE_POWER_POLICY_TIME;\n+\tpkt->command = RTE_POWER_PKT_POLICY;\n \tstrlcpy(pkt->vm_name, \"ubuntu2\", sizeof(pkt->vm_name));\n \n \treturn 0;\n@@ -145,7 +145,7 @@ struct cmd_freq_list_result {\n };\n \n static int\n-query_data(struct channel_packet *pkt, unsigned int lcore_id)\n+query_data(struct rte_power_channel_packet *pkt, unsigned int lcore_id)\n {\n \tint ret;\n \tret = rte_power_guest_channel_send_msg(pkt, lcore_id);\n@@ -157,19 +157,19 @@ query_data(struct channel_packet *pkt, unsigned int lcore_id)\n }\n \n static int\n-receive_freq_list(struct channel_packet_freq_list *pkt_freq_list,\n+receive_freq_list(struct rte_power_channel_packet_freq_list *pkt_freq_list,\n \t\tunsigned int lcore_id)\n {\n \tint ret;\n \n \tret = rte_power_guest_channel_receive_msg(pkt_freq_list,\n-\t\t\tsizeof(struct channel_packet_freq_list),\n+\t\t\tsizeof(struct rte_power_channel_packet_freq_list),\n \t\t\tlcore_id);\n \tif (ret < 0) {\n \t\tRTE_LOG(ERR, GUEST_CLI, \"Error receiving message.\\n\");\n \t\treturn -1;\n \t}\n-\tif (pkt_freq_list->command != CPU_POWER_FREQ_LIST) {\n+\tif (pkt_freq_list->command != RTE_POWER_FREQ_LIST) {\n \t\tRTE_LOG(ERR, GUEST_CLI, \"Unexpected message received.\\n\");\n \t\treturn -1;\n \t}\n@@ -183,14 +183,15 @@ cmd_query_freq_list_parsed(void *parsed_result,\n {\n \tstruct cmd_freq_list_result *res = parsed_result;\n \tunsigned int lcore_id;\n-\tstruct channel_packet_freq_list pkt_freq_list;\n-\tstruct channel_packet pkt;\n+\tstruct rte_power_channel_packet_freq_list pkt_freq_list;\n+\tstruct rte_power_channel_packet pkt;\n \tbool query_list = false;\n \tint ret;\n \tchar *ep;\n \n-\tmemset(&pkt, 0, sizeof(struct channel_packet));\n-\tmemset(&pkt_freq_list, 0, sizeof(struct channel_packet_freq_list));\n+\tmemset(&pkt, 0, sizeof(struct rte_power_channel_packet));\n+\tmemset(&pkt_freq_list, 0,\n+\t\t\tsizeof(struct rte_power_channel_packet_freq_list));\n \n \tif (!strcmp(res->cpu_num, \"all\")) {\n \n@@ -203,18 +204,18 @@ cmd_query_freq_list_parsed(void *parsed_result,\n \t\t\treturn;\n \t\t}\n \n-\t\tpkt.command = CPU_POWER_QUERY_FREQ_LIST;\n+\t\tpkt.command = RTE_POWER_QUERY_FREQ_LIST;\n \t\tstrlcpy(pkt.vm_name, policy.vm_name, sizeof(pkt.vm_name));\n \t\tquery_list = true;\n \t} else {\n \t\terrno = 0;\n \t\tlcore_id = (unsigned int)strtol(res->cpu_num, &ep, 10);\n-\t\tif (errno != 0 || lcore_id >= MAX_VCPU_PER_VM ||\n+\t\tif (errno != 0 || lcore_id >= RTE_POWER_MAX_VCPU_PER_VM ||\n \t\t\tep == res->cpu_num) {\n \t\t\tcmdline_printf(cl, \"Invalid parameter provided.\\n\");\n \t\t\treturn;\n \t\t}\n-\t\tpkt.command = CPU_POWER_QUERY_FREQ;\n+\t\tpkt.command = RTE_POWER_QUERY_FREQ;\n \t\tstrlcpy(pkt.vm_name, policy.vm_name, sizeof(pkt.vm_name));\n \t\tpkt.resource_id = lcore_id;\n \t}\n@@ -267,19 +268,19 @@ struct cmd_query_caps_result {\n };\n \n static int\n-receive_capabilities(struct channel_packet_caps_list *pkt_caps_list,\n+receive_capabilities(struct rte_power_channel_packet_caps_list *pkt_caps_list,\n \t\tunsigned int lcore_id)\n {\n \tint ret;\n \n \tret = rte_power_guest_channel_receive_msg(pkt_caps_list,\n-\t\tsizeof(struct channel_packet_caps_list),\n+\t\tsizeof(struct rte_power_channel_packet_caps_list),\n \t\tlcore_id);\n \tif (ret < 0) {\n \t\tRTE_LOG(ERR, GUEST_CLI, \"Error receiving message.\\n\");\n \t\treturn -1;\n \t}\n-\tif (pkt_caps_list->command != CPU_POWER_CAPS_LIST) {\n+\tif (pkt_caps_list->command != RTE_POWER_CAPS_LIST) {\n \t\tRTE_LOG(ERR, GUEST_CLI, \"Unexpected message received.\\n\");\n \t\treturn -1;\n \t}\n@@ -293,14 +294,15 @@ cmd_query_caps_list_parsed(void *parsed_result,\n {\n \tstruct cmd_query_caps_result *res = parsed_result;\n \tunsigned int lcore_id;\n-\tstruct channel_packet_caps_list pkt_caps_list;\n-\tstruct channel_packet pkt;\n+\tstruct rte_power_channel_packet_caps_list pkt_caps_list;\n+\tstruct rte_power_channel_packet pkt;\n \tbool query_list = false;\n \tint ret;\n \tchar *ep;\n \n-\tmemset(&pkt, 0, sizeof(struct channel_packet));\n-\tmemset(&pkt_caps_list, 0, sizeof(struct channel_packet_caps_list));\n+\tmemset(&pkt, 0, sizeof(struct rte_power_channel_packet));\n+\tmemset(&pkt_caps_list, 0,\n+\t\t\tsizeof(struct rte_power_channel_packet_caps_list));\n \n \tif (!strcmp(res->cpu_num, \"all\")) {\n \n@@ -313,18 +315,18 @@ cmd_query_caps_list_parsed(void *parsed_result,\n \t\t\treturn;\n \t\t}\n \n-\t\tpkt.command = CPU_POWER_QUERY_CAPS_LIST;\n+\t\tpkt.command = RTE_POWER_QUERY_CAPS_LIST;\n \t\tstrlcpy(pkt.vm_name, policy.vm_name, sizeof(pkt.vm_name));\n \t\tquery_list = true;\n \t} else {\n \t\terrno = 0;\n \t\tlcore_id = (unsigned int)strtol(res->cpu_num, &ep, 10);\n-\t\tif (errno != 0 || lcore_id >= MAX_VCPU_PER_VM ||\n+\t\tif (errno != 0 || lcore_id >= RTE_POWER_MAX_VCPU_PER_VM ||\n \t\t\tep == res->cpu_num) {\n \t\t\tcmdline_printf(cl, \"Invalid parameter provided.\\n\");\n \t\t\treturn;\n \t\t}\n-\t\tpkt.command = CPU_POWER_QUERY_CAPS;\n+\t\tpkt.command = RTE_POWER_QUERY_CAPS;\n \t\tstrlcpy(pkt.vm_name, policy.vm_name, sizeof(pkt.vm_name));\n \t\tpkt.resource_id = lcore_id;\n \t}\n@@ -380,7 +382,7 @@ cmdline_parse_inst_t cmd_query_caps_list = {\n static int\n check_response_cmd(unsigned int lcore_id, int *result)\n {\n-\tstruct channel_packet pkt;\n+\tstruct rte_power_channel_packet pkt;\n \tint ret;\n \n \tret = rte_power_guest_channel_receive_msg(&pkt, sizeof pkt, lcore_id);\n@@ -388,10 +390,10 @@ check_response_cmd(unsigned int lcore_id, int *result)\n \t\treturn -1;\n \n \tswitch (pkt.command) {\n-\tcase(CPU_POWER_CMD_ACK):\n+\tcase(RTE_POWER_CMD_ACK):\n \t\t*result = 1;\n \t\tbreak;\n-\tcase(CPU_POWER_CMD_NACK):\n+\tcase(RTE_POWER_CMD_NACK):\n \t\t*result = 0;\n \t\tbreak;\n \tdefault:\n@@ -473,7 +475,7 @@ struct cmd_send_policy_result {\n };\n \n static inline int\n-send_policy(struct channel_packet *pkt, struct cmdline *cl)\n+send_policy(struct rte_power_channel_packet *pkt, struct cmdline *cl)\n {\n \tint ret;\n \ndiff --git a/examples/vm_power_manager/guest_cli/vm_power_cli_guest.h b/examples/vm_power_manager/guest_cli/vm_power_cli_guest.h\nindex 6ad14a3de..b578ec072 100644\n--- a/examples/vm_power_manager/guest_cli/vm_power_cli_guest.h\n+++ b/examples/vm_power_manager/guest_cli/vm_power_cli_guest.h\n@@ -9,13 +9,11 @@\n extern \"C\" {\n #endif\n \n-#include \"channel_commands.h\"\n-\n-struct channel_packet *get_policy(void);\n+struct rte_power_channel_packet *get_policy(void);\n \n int set_policy_mac(int port, int idx);\n \n-int set_policy_defaults(struct channel_packet *pkt);\n+int set_policy_defaults(struct rte_power_channel_packet *pkt);\n \n void run_cli(__rte_unused void *arg);\n \ndiff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c\nindex 75d5b5364..799d7b9bc 100644\n--- a/examples/vm_power_manager/main.c\n+++ b/examples/vm_power_manager/main.c\n@@ -394,7 +394,7 @@ main(int argc, char **argv)\n \t\t\t\t\t\"Cannot init port %\"PRIu8 \"\\n\",\n \t\t\t\t\tportid);\n \n-\t\t\tfor (w = 0; w < MAX_VFS; w++) {\n+\t\t\tfor (w = 0; w < RTE_POWER_MAX_VFS; w++) {\n \t\t\t\teth.addr_bytes[5] = w + 0xf0;\n \n \t\t\t\tret = -ENOTSUP;\ndiff --git a/examples/vm_power_manager/vm_power_cli.c b/examples/vm_power_manager/vm_power_cli.c\nindex ed0623a41..1a55e553b 100644\n--- a/examples/vm_power_manager/vm_power_cli.c\n+++ b/examples/vm_power_manager/vm_power_cli.c\n@@ -21,7 +21,6 @@\n #include \"channel_manager.h\"\n #include \"channel_monitor.h\"\n #include \"power_manager.h\"\n-#include \"channel_commands.h\"\n \n struct cmd_quit_result {\n \tcmdline_fixed_string_t quit;\ndiff --git a/lib/librte_power/channel_commands.h b/lib/librte_power/channel_commands.h\ndeleted file mode 100644\nindex adc8e5ca2..000000000\n--- a/lib/librte_power/channel_commands.h\n+++ /dev/null\n@@ -1,125 +0,0 @@\n-/* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2010-2014 Intel Corporation\n- */\n-\n-#ifndef CHANNEL_COMMANDS_H_\n-#define CHANNEL_COMMANDS_H_\n-\n-#ifdef __cplusplus\n-extern \"C\" {\n-#endif\n-\n-#include <stdint.h>\n-#include <stdbool.h>\n-\n-/* --- Incoming messages --- */\n-\n-/* Valid Commands */\n-#define CPU_POWER               1\n-#define CPU_POWER_CONNECT       2\n-#define PKT_POLICY              3\n-#define PKT_POLICY_REMOVE       4\n-\n-/* CPU Power Command Scaling */\n-#define CPU_POWER_SCALE_UP      1\n-#define CPU_POWER_SCALE_DOWN    2\n-#define CPU_POWER_SCALE_MAX     3\n-#define CPU_POWER_SCALE_MIN     4\n-#define CPU_POWER_ENABLE_TURBO  5\n-#define CPU_POWER_DISABLE_TURBO 6\n-\n-/* CPU Power Queries */\n-#define CPU_POWER_QUERY_FREQ_LIST  7\n-#define CPU_POWER_QUERY_FREQ       8\n-#define CPU_POWER_QUERY_CAPS_LIST  9\n-#define CPU_POWER_QUERY_CAPS       10\n-\n-/* --- Outgoing messages --- */\n-\n-/* Generic Power Command Response */\n-#define CPU_POWER_CMD_ACK       1\n-#define CPU_POWER_CMD_NACK      2\n-\n-/* CPU Power Query Responses */\n-#define CPU_POWER_FREQ_LIST     3\n-#define CPU_POWER_CAPS_LIST     4\n-\n-#define HOURS 24\n-\n-#define MAX_VFS 10\n-#define VM_MAX_NAME_SZ 32\n-\n-#define MAX_VCPU_PER_VM         8\n-\n-struct t_boost_status {\n-\tbool tbEnabled;\n-};\n-\n-struct timer_profile {\n-\tint busy_hours[HOURS];\n-\tint quiet_hours[HOURS];\n-\tint hours_to_use_traffic_profile[HOURS];\n-};\n-\n-enum workload {HIGH, MEDIUM, LOW};\n-enum policy_to_use {\n-\tTRAFFIC,\n-\tTIME,\n-\tWORKLOAD,\n-\tBRANCH_RATIO\n-};\n-\n-struct traffic {\n-\tuint32_t min_packet_thresh;\n-\tuint32_t avg_max_packet_thresh;\n-\tuint32_t max_max_packet_thresh;\n-};\n-\n-#define CORE_TYPE_VIRTUAL 0\n-#define CORE_TYPE_PHYSICAL 1\n-\n-struct channel_packet {\n-\tuint64_t resource_id; /**< core_num, device */\n-\tuint32_t unit;        /**< scale down/up/min/max */\n-\tuint32_t command;     /**< Power, IO, etc */\n-\tchar vm_name[VM_MAX_NAME_SZ];\n-\n-\tuint64_t vfid[MAX_VFS];\n-\tint nb_mac_to_monitor;\n-\tstruct traffic traffic_policy;\n-\tuint8_t vcpu_to_control[MAX_VCPU_PER_VM];\n-\tuint8_t num_vcpu;\n-\tstruct timer_profile timer_policy;\n-\tbool core_type;\n-\tenum workload workload;\n-\tenum policy_to_use policy_to_use;\n-\tstruct t_boost_status t_boost_status;\n-};\n-\n-struct channel_packet_freq_list {\n-\tuint64_t resource_id; /**< core_num, device */\n-\tuint32_t unit;        /**< scale down/up/min/max */\n-\tuint32_t command;     /**< Power, IO, etc */\n-\tchar vm_name[VM_MAX_NAME_SZ];\n-\n-\tuint32_t freq_list[MAX_VCPU_PER_VM];\n-\tuint8_t num_vcpu;\n-};\n-\n-struct channel_packet_caps_list {\n-\tuint64_t resource_id; /**< core_num, device */\n-\tuint32_t unit;        /**< scale down/up/min/max */\n-\tuint32_t command;     /**< Power, IO, etc */\n-\tchar vm_name[VM_MAX_NAME_SZ];\n-\n-\tuint64_t turbo[MAX_VCPU_PER_VM];\n-\tuint64_t priority[MAX_VCPU_PER_VM];\n-\tuint8_t num_vcpu;\n-};\n-\n-\n-#ifdef __cplusplus\n-}\n-#endif\n-\n-#endif /* CHANNEL_COMMANDS_H_ */\ndiff --git a/lib/librte_power/guest_channel.c b/lib/librte_power/guest_channel.c\nindex 7b5926e5c..2f7507a03 100644\n--- a/lib/librte_power/guest_channel.c\n+++ b/lib/librte_power/guest_channel.c\n@@ -15,9 +15,9 @@\n \n \n #include <rte_log.h>\n+#include <rte_power.h>\n \n #include \"guest_channel.h\"\n-#include \"channel_commands.h\"\n \n #define RTE_LOGTYPE_GUEST_CHANNEL RTE_LOGTYPE_USER1\n \n@@ -55,7 +55,7 @@ int\n guest_channel_host_connect(const char *path, unsigned int lcore_id)\n {\n \tint flags, ret;\n-\tstruct channel_packet pkt;\n+\tstruct rte_power_channel_packet pkt;\n \tchar fd_path[PATH_MAX];\n \tint fd = -1;\n \n@@ -100,7 +100,7 @@ guest_channel_host_connect(const char *path, unsigned int lcore_id)\n \t/* Send a test packet, this command is ignored by the host, but a successful\n \t * send indicates that the host endpoint is monitoring.\n \t */\n-\tpkt.command = CPU_POWER_CONNECT;\n+\tpkt.command = RTE_POWER_CPU_POWER_CONNECT;\n \tglobal_fds[lcore_id] = fd;\n \tret = guest_channel_send_msg(&pkt, lcore_id);\n \tif (ret != 0) {\n@@ -119,7 +119,8 @@ guest_channel_host_connect(const char *path, unsigned int lcore_id)\n }\n \n int\n-guest_channel_send_msg(struct channel_packet *pkt, unsigned int lcore_id)\n+guest_channel_send_msg(struct rte_power_channel_packet *pkt,\n+\t\tunsigned int lcore_id)\n {\n \tint ret, buffer_len = sizeof(*pkt);\n \tvoid *buffer = pkt;\n@@ -149,7 +150,7 @@ guest_channel_send_msg(struct channel_packet *pkt, unsigned int lcore_id)\n \treturn 0;\n }\n \n-int rte_power_guest_channel_send_msg(struct channel_packet *pkt,\n+int rte_power_guest_channel_send_msg(struct rte_power_channel_packet *pkt,\n \t\t\tunsigned int lcore_id)\n {\n \treturn guest_channel_send_msg(pkt, lcore_id);\ndiff --git a/lib/librte_power/guest_channel.h b/lib/librte_power/guest_channel.h\nindex e15db46fc..0c01cdffa 100644\n--- a/lib/librte_power/guest_channel.h\n+++ b/lib/librte_power/guest_channel.h\n@@ -8,7 +8,7 @@\n extern \"C\" {\n #endif\n \n-#include <channel_commands.h>\n+struct rte_power_channel_packet;\n \n /**\n  * Check if any Virtio-Serial VM end-points exist in path.\n@@ -63,23 +63,9 @@ void guest_channel_host_disconnect(unsigned int lcore_id);\n  *  - Negative on channel not connected.\n  *  - errno on write to channel error.\n  */\n-int guest_channel_send_msg(struct channel_packet *pkt, unsigned int lcore_id);\n+int guest_channel_send_msg(struct rte_power_channel_packet *pkt,\n+\t\tunsigned int lcore_id);\n \n-/**\n- * Send a message contained in pkt over the Virtio-Serial to the host endpoint.\n- *\n- * @param pkt\n- *  Pointer to a populated struct channel_packet\n- *\n- * @param lcore_id\n- *  lcore_id.\n- *\n- * @return\n- *  - 0 on success.\n- *  - Negative on error.\n- */\n-int rte_power_guest_channel_send_msg(struct channel_packet *pkt,\n-\t\t\tunsigned int lcore_id);\n \n /**\n  * Read a message contained in pkt over the Virtio-Serial\n@@ -103,31 +89,6 @@ int power_guest_channel_read_msg(void *pkt,\n \t\tsize_t pkt_len,\n \t\tunsigned int lcore_id);\n \n-/**\n- * Receive a message contained in pkt over the Virtio-Serial\n- * from the host endpoint.\n- *\n- * @param pkt\n- *  Pointer to channel_packet or\n- *  channel_packet_freq_list struct.\n- *\n- * @param pkt_len\n- *  Size of expected data packet.\n- *\n- * @param lcore_id\n- *  lcore_id.\n- *\n- * @return\n- *  - 0 on success.\n- *  - Negative on error.\n- */\n-__rte_experimental\n-int\n-rte_power_guest_channel_receive_msg(void *pkt,\n-\t\tsize_t pkt_len,\n-\t\tunsigned int lcore_id);\n-\n-\n #ifdef __cplusplus\n }\n #endif\ndiff --git a/lib/librte_power/meson.build b/lib/librte_power/meson.build\nindex 4b4cf1b90..541569528 100644\n--- a/lib/librte_power/meson.build\n+++ b/lib/librte_power/meson.build\n@@ -10,5 +10,6 @@ sources = files('rte_power.c', 'power_acpi_cpufreq.c',\n \t\t'rte_power_empty_poll.c',\n \t\t'power_pstate_cpufreq.c',\n \t\t'power_common.c')\n-headers = files('rte_power.h','rte_power_empty_poll.h')\n+headers = files('rte_power.h','rte_power_empty_poll.h',\n+\t'rte_power_guest_channel.h')\n deps += ['timer']\ndiff --git a/lib/librte_power/power_kvm_vm.c b/lib/librte_power/power_kvm_vm.c\nindex 409c3e03a..c15438a01 100644\n--- a/lib/librte_power/power_kvm_vm.c\n+++ b/lib/librte_power/power_kvm_vm.c\n@@ -7,13 +7,12 @@\n #include <rte_log.h>\n \n #include \"guest_channel.h\"\n-#include \"channel_commands.h\"\n #include \"power_kvm_vm.h\"\n #include \"power_common.h\"\n \n #define FD_PATH \"/dev/virtio-ports/virtio.serial.port.poweragent\"\n \n-static struct channel_packet pkt[RTE_MAX_LCORE];\n+static struct rte_power_channel_packet pkt[RTE_MAX_LCORE];\n \n int\n power_kvm_vm_check_supported(void)\n@@ -29,7 +28,7 @@ power_kvm_vm_init(unsigned int lcore_id)\n \t\t\t\tlcore_id, RTE_MAX_LCORE-1);\n \t\treturn -1;\n \t}\n-\tpkt[lcore_id].command = CPU_POWER;\n+\tpkt[lcore_id].command = RTE_POWER_CPU_POWER;\n \tpkt[lcore_id].resource_id = lcore_id;\n \treturn guest_channel_host_connect(FD_PATH, lcore_id);\n }\n@@ -90,25 +89,25 @@ send_msg(unsigned int lcore_id, uint32_t scale_direction)\n int\n power_kvm_vm_freq_up(unsigned int lcore_id)\n {\n-\treturn send_msg(lcore_id, CPU_POWER_SCALE_UP);\n+\treturn send_msg(lcore_id, RTE_POWER_SCALE_UP);\n }\n \n int\n power_kvm_vm_freq_down(unsigned int lcore_id)\n {\n-\treturn send_msg(lcore_id, CPU_POWER_SCALE_DOWN);\n+\treturn send_msg(lcore_id, RTE_POWER_SCALE_DOWN);\n }\n \n int\n power_kvm_vm_freq_max(unsigned int lcore_id)\n {\n-\treturn send_msg(lcore_id, CPU_POWER_SCALE_MAX);\n+\treturn send_msg(lcore_id, RTE_POWER_SCALE_MAX);\n }\n \n int\n power_kvm_vm_freq_min(unsigned int lcore_id)\n {\n-\treturn send_msg(lcore_id, CPU_POWER_SCALE_MIN);\n+\treturn send_msg(lcore_id, RTE_POWER_SCALE_MIN);\n }\n \n int\n@@ -121,13 +120,13 @@ power_kvm_vm_turbo_status(__rte_unused unsigned int lcore_id)\n int\n power_kvm_vm_enable_turbo(unsigned int lcore_id)\n {\n-\treturn send_msg(lcore_id, CPU_POWER_ENABLE_TURBO);\n+\treturn send_msg(lcore_id, RTE_POWER_ENABLE_TURBO);\n }\n \n int\n power_kvm_vm_disable_turbo(unsigned int lcore_id)\n {\n-\treturn send_msg(lcore_id, CPU_POWER_DISABLE_TURBO);\n+\treturn send_msg(lcore_id, RTE_POWER_DISABLE_TURBO);\n }\n \n struct rte_power_core_capabilities;\ndiff --git a/lib/librte_power/rte_power.h b/lib/librte_power/rte_power.h\nindex bbbde4dfb..c8086bf6b 100644\n--- a/lib/librte_power/rte_power.h\n+++ b/lib/librte_power/rte_power.h\n@@ -14,6 +14,7 @@\n #include <rte_byteorder.h>\n #include <rte_log.h>\n #include <rte_string_fns.h>\n+#include <rte_power_guest_channel.h>\n \n #ifdef __cplusplus\n extern \"C\" {\ndiff --git a/lib/librte_power/rte_power_guest_channel.h b/lib/librte_power/rte_power_guest_channel.h\nnew file mode 100644\nindex 000000000..441c42262\n--- /dev/null\n+++ b/lib/librte_power/rte_power_guest_channel.h\n@@ -0,0 +1,160 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2010-2020 Intel Corporation\n+ */\n+#ifndef RTE_POWER_GUEST_CHANNEL_H\n+#define RTE_POWER_GUEST_CHANNEL_H\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+#define RTE_POWER_MAX_VFS 10\n+#define RTE_POWER_VM_MAX_NAME_SZ 32\n+#define RTE_POWER_MAX_VCPU_PER_VM 8\n+#define RTE_POWER_HOURS_PER_DAY 24\n+\n+/* Valid Commands */\n+#define RTE_POWER_CPU_POWER               1\n+#define RTE_POWER_CPU_POWER_CONNECT       2\n+#define RTE_POWER_PKT_POLICY              3\n+#define RTE_POWER_PKT_POLICY_REMOVE       4\n+\n+#define RTE_POWER_CORE_TYPE_VIRTUAL 0\n+#define RTE_POWER_CORE_TYPE_PHYSICAL 1\n+\n+/* CPU Power Command Scaling */\n+#define RTE_POWER_SCALE_UP      1\n+#define RTE_POWER_SCALE_DOWN    2\n+#define RTE_POWER_SCALE_MAX     3\n+#define RTE_POWER_SCALE_MIN     4\n+#define RTE_POWER_ENABLE_TURBO  5\n+#define RTE_POWER_DISABLE_TURBO 6\n+\n+/* CPU Power Queries */\n+#define RTE_POWER_QUERY_FREQ_LIST  7\n+#define RTE_POWER_QUERY_FREQ       8\n+#define RTE_POWER_QUERY_CAPS_LIST  9\n+#define RTE_POWER_QUERY_CAPS       10\n+\n+/* Generic Power Command Response */\n+#define RTE_POWER_CMD_ACK       1\n+#define RTE_POWER_CMD_NACK      2\n+\n+/* CPU Power Query Responses */\n+#define RTE_POWER_FREQ_LIST     3\n+#define RTE_POWER_CAPS_LIST     4\n+\n+struct rte_power_traffic_policy {\n+\tuint32_t min_packet_thresh;\n+\tuint32_t avg_max_packet_thresh;\n+\tuint32_t max_max_packet_thresh;\n+};\n+\n+struct rte_power_timer_profile {\n+\tint busy_hours[RTE_POWER_HOURS_PER_DAY];\n+\tint quiet_hours[RTE_POWER_HOURS_PER_DAY];\n+\tint hours_to_use_traffic_profile[RTE_POWER_HOURS_PER_DAY];\n+};\n+\n+enum rte_power_workload_level {\n+\tRTE_POWER_WL_HIGH,\n+\tRTE_POWER_WL_MEDIUM,\n+\tRTE_POWER_WL_LOW\n+};\n+\n+enum rte_power_policy {\n+\tRTE_POWER_POLICY_TRAFFIC,\n+\tRTE_POWER_POLICY_TIME,\n+\tRTE_POWER_POLICY_WORKLOAD,\n+\tRTE_POWER_POLICY_BRANCH_RATIO\n+};\n+\n+struct rte_power_turbo_status {\n+\tbool tbEnabled;\n+};\n+\n+struct rte_power_channel_packet {\n+\tuint64_t resource_id; /**< core_num, device */\n+\tuint32_t unit;        /**< scale down/up/min/max */\n+\tuint32_t command;     /**< Power, IO, etc */\n+\tchar vm_name[RTE_POWER_VM_MAX_NAME_SZ];\n+\n+\tuint64_t vfid[RTE_POWER_MAX_VFS];\n+\tint nb_mac_to_monitor;\n+\tstruct rte_power_traffic_policy traffic_policy;\n+\tuint8_t vcpu_to_control[RTE_POWER_MAX_VCPU_PER_VM];\n+\tuint8_t num_vcpu;\n+\tstruct rte_power_timer_profile timer_policy;\n+\tbool core_type;\n+\tenum rte_power_workload_level workload;\n+\tenum rte_power_policy policy_to_use;\n+\tstruct rte_power_turbo_status t_boost_status;\n+};\n+\n+struct rte_power_channel_packet_freq_list {\n+\tuint64_t resource_id; /**< core_num, device */\n+\tuint32_t unit;        /**< scale down/up/min/max */\n+\tuint32_t command;     /**< Power, IO, etc */\n+\tchar vm_name[RTE_POWER_VM_MAX_NAME_SZ];\n+\n+\tuint32_t freq_list[RTE_POWER_MAX_VCPU_PER_VM];\n+\tuint8_t num_vcpu;\n+};\n+\n+struct rte_power_channel_packet_caps_list {\n+\tuint64_t resource_id; /**< core_num, device */\n+\tuint32_t unit;        /**< scale down/up/min/max */\n+\tuint32_t command;     /**< Power, IO, etc */\n+\tchar vm_name[RTE_POWER_VM_MAX_NAME_SZ];\n+\n+\tuint64_t turbo[RTE_POWER_MAX_VCPU_PER_VM];\n+\tuint64_t priority[RTE_POWER_MAX_VCPU_PER_VM];\n+\tuint8_t num_vcpu;\n+};\n+\n+/**\n+ * Send a message contained in pkt over the Virtio-Serial to the host endpoint.\n+ *\n+ * @param pkt\n+ *  Pointer to a populated struct channel_packet\n+ *\n+ * @param lcore_id\n+ *  lcore_id.\n+ *\n+ * @return\n+ *  - 0 on success.\n+ *  - Negative on error.\n+ */\n+int rte_power_guest_channel_send_msg(struct rte_power_channel_packet *pkt,\n+\t\t\tunsigned int lcore_id);\n+\n+/**\n+ * Receive a message contained in pkt over the Virtio-Serial\n+ * from the host endpoint.\n+ *\n+ * @param pkt\n+ *  Pointer to channel_packet or\n+ *  channel_packet_freq_list struct.\n+ *\n+ * @param pkt_len\n+ *  Size of expected data packet.\n+ *\n+ * @param lcore_id\n+ *  lcore_id.\n+ *\n+ * @return\n+ *  - 0 on success.\n+ *  - Negative on error.\n+ */\n+__rte_experimental\n+int\n+rte_power_guest_channel_receive_msg(void *pkt,\n+\t\tsize_t pkt_len,\n+\t\tunsigned int lcore_id);\n+\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+#endif\n",
    "prefixes": [
        "v1"
    ]
}