get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 29612,
    "url": "https://patches.dpdk.org/api/patches/29612/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1507130720-48891-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": "<1507130720-48891-9-git-send-email-david.hunt@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1507130720-48891-9-git-send-email-david.hunt@intel.com",
    "date": "2017-10-04T15:25:19",
    "name": "[dpdk-dev,v5,8/9] examples/guest_cli: add send policy to host",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "98644c03f34f91c1bcee3efbf896db02514ac2aa",
    "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/1507130720-48891-9-git-send-email-david.hunt@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/29612/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/29612/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 C05A91B6BF;\n\tWed,  4 Oct 2017 17:25:48 +0200 (CEST)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id A3C4F1B6B3\n\tfor <dev@dpdk.org>; Wed,  4 Oct 2017 17:25:45 +0200 (CEST)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t04 Oct 2017 08:25:45 -0700",
            "from silpixa00397898.ir.intel.com ([10.237.223.116])\n\tby fmsmga004.fm.intel.com with ESMTP; 04 Oct 2017 08:25:43 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.42,477,1500966000\"; d=\"scan'208\";a=\"319493546\"",
        "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": "Wed,  4 Oct 2017 16:25:19 +0100",
        "Message-Id": "<1507130720-48891-9-git-send-email-david.hunt@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1507130720-48891-1-git-send-email-david.hunt@intel.com>",
        "References": "<1507108515-186477-1-git-send-email-david.hunt@intel.com>\n\t<1507130720-48891-1-git-send-email-david.hunt@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v5 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                 | 97 ++++++++++++++++++++++\n .../guest_cli/vm_power_cli_guest.h                 |  6 --\n 2 files changed, 97 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..dc9efc2 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,103 @@ 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+union PFID {\n+\tstruct ether_addr addr;\n+\tuint64_t pfid;\n+};\n+\n+static inline int\n+send_policy(void)\n+{\n+\tstruct channel_packet pkt;\n+\tint ret;\n+\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+\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+\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+\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+\tpkt.timer_policy.hours_to_use_traffic_profile[0] = 8;\n+\tpkt.timer_policy.hours_to_use_traffic_profile[1] = 10;\n+\n+\tpkt.workload = LOW;\n+\tpkt.policy_to_use = TIME;\n+\tpkt.command = PKT_POLICY;\n+\tstrcpy(pkt.vm_name, \"ubuntu2\");\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",
        "v5",
        "8/9"
    ]
}