get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 29557,
    "url": "https://patches.dpdk.org/api/patches/29557/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1507039737-170942-9-git-send-email-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": "<1507039737-170942-9-git-send-email-david.hunt@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1507039737-170942-9-git-send-email-david.hunt@intel.com",
    "date": "2017-10-03T14:08:56",
    "name": "[dpdk-dev,v3,8/9] examples/guest_cli: add send policy to host",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "0a754708821a8859021a72397aa867cfdc58d413",
    "submitter": {
        "id": 342,
        "url": "https://patches.dpdk.org/api/people/342/?format=api",
        "name": "Hunt, David",
        "email": "david.hunt@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1507039737-170942-9-git-send-email-david.hunt@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/29557/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/29557/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 8FE3E1B3D6;\n\tTue,  3 Oct 2017 16:46:53 +0200 (CEST)",
            "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n\tby dpdk.org (Postfix) with ESMTP id 5A5DF1B3D6\n\tfor <dev@dpdk.org>; Tue,  3 Oct 2017 16:46:51 +0200 (CEST)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby orsmga105.jf.intel.com with ESMTP; 03 Oct 2017 07:46:51 -0700",
            "from silpixa00397898.ir.intel.com (HELO\n\tsilpixa00397898.ger.corp.intel.com) ([10.237.223.116])\n\tby orsmga003.jf.intel.com with ESMTP; 03 Oct 2017 07:46:49 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos; i=\"5.42,474,1500966000\"; d=\"scan'208\";\n\ta=\"1021087192\"",
        "From": "David Hunt <david.hunt@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "konstantin.ananyev@intel.com, jingjing.wu@intel.com,\n\t\"Sexton, Rory\" <rory.sexton@intel.com>,\n\tNemanja Marjanovic <nemanja.marjanovic@intel.com>,\n\tDavid Hunt <david.hunt@intel.com>",
        "Date": "Tue,  3 Oct 2017 15:08:56 +0100",
        "Message-Id": "<1507039737-170942-9-git-send-email-david.hunt@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1507039737-170942-1-git-send-email-david.hunt@intel.com>",
        "References": "<1505299459-24135-2-git-send-email-david.hunt@intel.com>\n\t<1507039737-170942-1-git-send-email-david.hunt@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v3 8/9] examples/guest_cli: add send policy to\n\thost",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/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: \"Sexton, Rory\" <rory.sexton@intel.com>\n\nHere we're adding an example of setting up a policy, and allowing the\nvm_cli_guest app to send it to the host using the cli command\n\"send_policy now\"\n\nSigned-off-by: Nemanja Marjanovic <nemanja.marjanovic@intel.com>\nSigned-off-by: Rory Sexton <rory.sexton@intel.com>\nSigned-off-by: David Hunt <david.hunt@intel.com>\n---\n .../guest_cli/vm_power_cli_guest.c                 | 105 +++++++++++++++++++++\n .../guest_cli/vm_power_cli_guest.h                 |   6 --\n 2 files changed, 105 insertions(+), 6 deletions(-)",
    "diff": "diff --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 4e982bd..fe0d77a 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@@ -45,8 +45,10 @@\n #include <cmdline.h>\n #include <rte_log.h>\n #include <rte_lcore.h>\n+#include <rte_ethdev.h>\n \n #include <rte_power.h>\n+#include <guest_channel.h>\n \n #include \"vm_power_cli_guest.h\"\n \n@@ -139,8 +141,111 @@ cmdline_parse_inst_t cmd_set_cpu_freq_set = {\n \t},\n };\n \n+struct cmd_send_policy_result {\n+\tcmdline_fixed_string_t send_policy;\n+\tcmdline_fixed_string_t cmd;\n+};\n+\n+#ifdef RTE_LIBRTE_I40E_PMD\n+union PFID {\n+\tstruct ether_addr addr;\n+\tuint64_t pfid;\n+};\n+#endif\n+\n+static inline int\n+send_policy(void)\n+{\n+\tstruct channel_packet pkt;\n+\tint ret;\n+\n+#ifdef RTE_LIBRTE_I40E_PMD\n+\tunion PFID pfid;\n+\t/* Use port MAC address as the vfid */\n+\trte_eth_macaddr_get(0, &pfid.addr);\n+\tprintf(\"Port %u MAC: %02\" PRIx8 \":%02\" PRIx8 \":%02\" PRIx8 \":\"\n+\t\t\t\"%02\" PRIx8 \":%02\" PRIx8 \":%02\" PRIx8 \"\\n\",\n+\t\t\t1,\n+\t\t\tpfid.addr.addr_bytes[0], pfid.addr.addr_bytes[1],\n+\t\t\tpfid.addr.addr_bytes[2], pfid.addr.addr_bytes[3],\n+\t\t\tpfid.addr.addr_bytes[4], pfid.addr.addr_bytes[5]);\n+\tpkt.vfid[0] = pfid.pfid;\n+\n+\tpkt.nb_mac_to_monitor = 1;\n+#endif\n+\tpkt.t_boost_status.tbEnabled = false;\n+\n+\tpkt.vcpu_to_control[0] = 0;\n+\tpkt.vcpu_to_control[1] = 1;\n+\tpkt.num_vcpu = 2;\n+\t/* Dummy Population. */\n+#ifdef RTE_LIBRTE_I40E_PMD\n+\tpkt.traffic_policy.min_packet_thresh = 96000;\n+\tpkt.traffic_policy.avg_max_packet_thresh = 1800000;\n+\tpkt.traffic_policy.max_max_packet_thresh = 2000000;\n+#endif\n+\n+\tpkt.timer_policy.busy_hours[0] = 3;\n+\tpkt.timer_policy.busy_hours[1] = 4;\n+\tpkt.timer_policy.busy_hours[2] = 5;\n+\tpkt.timer_policy.quiet_hours[0] = 11;\n+\tpkt.timer_policy.quiet_hours[1] = 12;\n+\tpkt.timer_policy.quiet_hours[2] = 13;\n+\n+#ifdef RTE_LIBRTE_I40E_PMD\n+\tpkt.timer_policy.hours_to_use_traffic_profile[0] = 8;\n+\tpkt.timer_policy.hours_to_use_traffic_profile[1] = 10;\n+#endif\n+\n+\tpkt.workload = LOW;\n+\tpkt.policy_to_use = TIME;\n+\tpkt.command = PKT_POLICY;\n+\tstrcpy(pkt.vm_name, \"ubintu2\");\n+\tret = rte_power_guest_channel_send_msg(&pkt, 1);\n+\tif (ret == 0)\n+\t\treturn 1;\n+\tRTE_LOG(DEBUG, POWER, \"Error sending message: %s\\n\",\n+\t\t\tret > 0 ? strerror(ret) : \"channel not connected\");\n+\treturn -1;\n+}\n+\n+static void\n+cmd_send_policy_parsed(void *parsed_result, struct cmdline *cl,\n+\t\t       __attribute__((unused)) void *data)\n+{\n+\tint ret = -1;\n+\tstruct cmd_send_policy_result *res = parsed_result;\n+\n+\tif (!strcmp(res->cmd, \"now\")) {\n+\t\tprintf(\"Sending Policy down now!\\n\");\n+\t\tret = send_policy();\n+\t}\n+\tif (ret != 1)\n+\t\tcmdline_printf(cl, \"Error sending message: %s\\n\",\n+\t\t\t\tstrerror(ret));\n+}\n+\n+cmdline_parse_token_string_t cmd_send_policy =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_send_policy_result,\n+\t\t\tsend_policy, \"send_policy\");\n+cmdline_parse_token_string_t cmd_send_policy_cmd_cmd =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_send_policy_result,\n+\t\t\tcmd, \"now\");\n+\n+cmdline_parse_inst_t cmd_send_policy_set = {\n+\t.f = cmd_send_policy_parsed,\n+\t.data = NULL,\n+\t.help_str = \"send_policy now\",\n+\t.tokens = {\n+\t\t(void *)&cmd_send_policy,\n+\t\t(void *)&cmd_send_policy_cmd_cmd,\n+\t\tNULL,\n+\t},\n+};\n+\n cmdline_parse_ctx_t main_ctx[] = {\n \t\t(cmdline_parse_inst_t *)&cmd_quit,\n+\t\t(cmdline_parse_inst_t *)&cmd_send_policy_set,\n \t\t(cmdline_parse_inst_t *)&cmd_set_cpu_freq_set,\n \t\tNULL,\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 0c4bdd5..277eab3 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@@ -40,12 +40,6 @@ extern \"C\" {\n \n #include \"channel_commands.h\"\n \n-int guest_channel_host_connect(unsigned lcore_id);\n-\n-int guest_channel_send_msg(struct channel_packet *pkt, unsigned lcore_id);\n-\n-void guest_channel_host_disconnect(unsigned lcore_id);\n-\n void run_cli(__attribute__((unused)) void *arg);\n \n #ifdef __cplusplus\n",
    "prefixes": [
        "dpdk-dev",
        "v3",
        "8/9"
    ]
}