Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/45416/?format=api
https://patches.dpdk.org/api/patches/45416/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20180926134037.43606-11-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": "<20180926134037.43606-11-david.hunt@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20180926134037.43606-11-david.hunt@intel.com", "date": "2018-09-26T13:40:36", "name": "[v4,10/11] doc/vm_power_manager: add JSON interface API info", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "944dbd83128b662bf780bbcad264d2ab43e57c64", "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/20180926134037.43606-11-david.hunt@intel.com/mbox/", "series": [ { "id": 1519, "url": "https://patches.dpdk.org/api/series/1519/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=1519", "date": "2018-09-26T13:40:26", "name": "add json power policy interface for containers", "version": 4, "mbox": "https://patches.dpdk.org/series/1519/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/45416/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/45416/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 298711B3B3;\n\tWed, 26 Sep 2018 15:41:57 +0200 (CEST)", "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id C56471B111\n\tfor <dev@dpdk.org>; Wed, 26 Sep 2018 15:41:36 +0200 (CEST)", "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t26 Sep 2018 06:41:35 -0700", "from silpixa00399952.ir.intel.com (HELO\n\tsilpixa00399952.ger.corp.intel.com) ([10.237.223.64])\n\tby FMSMGA003.fm.intel.com with ESMTP; 26 Sep 2018 06:41:34 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.54,306,1534834800\"; d=\"scan'208\";a=\"83404421\"", "From": "David Hunt <david.hunt@intel.com>", "To": "dev@dpdk.org", "Cc": "john.mcnamara@intel.com, stephen@networkplumber.org, lei.a.yao@intel.com,\n\tanatoly.burakov@intel.com, David Hunt <david.hunt@intel.com>", "Date": "Wed, 26 Sep 2018 14:40:36 +0100", "Message-Id": "<20180926134037.43606-11-david.hunt@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20180926134037.43606-1-david.hunt@intel.com>", "References": "<20180914135406.52190-1-david.hunt@intel.com>\n\t<20180926134037.43606-1-david.hunt@intel.com>", "Subject": "[dpdk-dev] [PATCH v4 10/11] doc/vm_power_manager: add JSON\n\tinterface API info", "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": "Also added meson/ninja build info\n\nSigned-off-by: David Hunt <david.hunt@intel.com>\n---\n .../sample_app_ug/vm_power_management.rst | 272 +++++++++++++++++-\n 1 file changed, 270 insertions(+), 2 deletions(-)", "diff": "diff --git a/doc/guides/sample_app_ug/vm_power_management.rst b/doc/guides/sample_app_ug/vm_power_management.rst\nindex 855570d6b..931a73f55 100644\n--- a/doc/guides/sample_app_ug/vm_power_management.rst\n+++ b/doc/guides/sample_app_ug/vm_power_management.rst\n@@ -199,7 +199,7 @@ see :doc:`compiling`.\n \n The application is located in the ``vm_power_manager`` sub-directory.\n \n-To build just the ``vm_power_manager`` application:\n+To build just the ``vm_power_manager`` application using ``make``:\n \n .. code-block:: console\n \n@@ -208,6 +208,22 @@ To build just the ``vm_power_manager`` application:\n cd ${RTE_SDK}/examples/vm_power_manager/\n make\n \n+The resulting binary will be ${RTE_SDK}/build/examples/vm_power_manager\n+\n+To build just the ``vm_power_manager`` application using ``meson/ninja``:\n+\n+.. code-block:: console\n+\n+ export RTE_SDK=/path/to/rte_sdk\n+ cd ${RTE_SDK}\n+ meson build\n+ cd build\n+ ninja\n+ meson configure -Dexamples=vm_power_manager\n+ ninja\n+\n+The resulting binary will be ${RTE_SDK}/build/examples/dpdk-vm_power_manager\n+\n Running\n ~~~~~~~\n \n@@ -337,6 +353,242 @@ monitoring of branch ratio on cores doing busy polling via PMDs.\n and will need to be adjusted for different workloads.\n \n \n+\n+JSON API\n+~~~~~~~~\n+\n+In addition to the command line interface for host command and a virtio-serial\n+interface for VM power policies, there is also a JSON interface through which\n+power commands and policies can be sent. This functionality adds a dependency\n+on the Jansson library, and the Jansson development package must be installed\n+on the system before the JSON parsing functionality is included in the app.\n+This is achieved by:\n+\n+ .. code-block:: console\n+\n+ apt-get install libjansson-dev\n+\n+The command and package name may be different depending on your operating\n+system. It's worth noting that the app will successfully build without this\n+package present, but a warning is shown during compilation, and the JSON\n+parsing functionality will not be present in the app.\n+\n+Sending a command or policy to the power manager application is achieved by\n+simply opening a fifo file, writing a JSON string to that fifo, and closing\n+the file.\n+\n+The fifo is at /tmp/powermonitor/fifo\n+\n+The jason string can be a policy or instruction, and takes the following\n+format:\n+\n+ .. code-block:: console\n+\n+ {\"packet_type\": {\n+ \"pair_1\": value,\n+ \"pair_2\": value\n+ }}\n+\n+The 'packet_type' header can contain one of two values, depending on\n+whether a policy or power command is being sent. The two possible values are\n+\"policy\" and \"instruction\", and the expected name-value pairs is different\n+depending on which type is being sent.\n+\n+The pairs are the format of standard JSON name-value pairs. The value type\n+varies between the different name/value pairs, and may be intgers, strings,\n+arrays, etc. Examples of policies follow later in this document. The allowed\n+names and value types are as follows:\n+\n+\n+:Pair Name: \"name\"\n+:Description: Name of the VM or Host. Allows the parser to associate the\n+ policy with the relevant VM or Host OS.\n+:Type: string\n+:Values: any valid string\n+:Required: yes\n+:Example:\n+\n+ .. code-block:: console\n+\n+ \"\"name\", \"ubuntu2\"\n+\n+\n+:Pair Name: \"command\"\n+:Description: The type of packet we're sending to the power manager. We can be\n+ creating or destroying a policy, or sending a direct command to adjust\n+ the frequency of a core, similar to the command line interface.\n+:Type: string\n+:Values:\n+\n+ :\"CREATE\": used when creating a new policy,\n+ :\"DESTROY\": used when removing a policy,\n+ :\"POWER\": used when sending an immediate command, max, min, etc.\n+:Required: yes\n+:Example:\n+\n+ .. code-block:: console\n+\n+ \"command\", \"CREATE\"\n+\n+\n+:Pair Name: \"policy_type\"\n+:Description: Type of policy to apply. Please see vm_power_manager documentation\n+ for more information on the types of policies that may be used.\n+:Type: string\n+:Values:\n+\n+ :\"TIME\": Time-of-day policy. Frequencies of the relevant cores are\n+ scaled up/down depending on busy and quiet hours.\n+ :\"TRAFFIC\": This policy takes statistics from the NIC and scales up\n+ and down accordingly.\n+ :\"WORKLOAD\": This policy looks at how heavily loaded the cores are,\n+ and scales up and down accordingly.\n+ :\"BRANCH_RATIO\": This out-of-band policy can look at the ratio between\n+ branch hits and misses on a core, and is useful for detecting\n+ how much packet processing a core is doing.\n+:Required: only for CREATE/DESTROY command\n+:Example:\n+\n+ .. code-block:: console\n+\n+ \"policy_type\", \"TIME\"\n+\n+:Pair Name: \"busy_hours\"\n+:Description: The hours of the day in which we scale up the cores for busy\n+ times.\n+:Type: array of integers\n+:Values: array with list of hour numbers, (0-23)\n+:Required: only for TIME policy\n+:Example:\n+\n+ .. code-block:: console\n+\n+ \"busy_hours\":[ 17, 18, 19, 20, 21, 22, 23 ]\n+\n+:Pair Name: \"quiet_hours\"\n+:Description: The hours of the day in which we scale down the cores for quiet\n+ times.\n+:Type: array of integers\n+:Values: array with list of hour numbers, (0-23)\n+:Required: only for TIME policy\n+:Example:\n+\n+ .. code-block:: console\n+\n+ \"quiet_hours\":[ 2, 3, 4, 5, 6 ]\n+\n+:Pair Name: \"avg_packet_thresh\"\n+:Description: Threshold below which the frequency will be set to min for\n+ the TRAFFIC policy. If the traffic rate is above this and below max, the\n+ frequency will be set to medium.\n+:Type: integer\n+:Values: The number of packets below which the TRAFFIC policy applies the\n+ minimum frequency, or medium frequency if between avg and max thresholds.\n+:Required: only for TRAFFIC policy\n+:Example:\n+\n+ .. code-block:: console\n+\n+ \"avg_packet_thresh\": 100000\n+\n+:Pair Name: \"max_packet_thresh\"\n+:Description: Threshold above which the frequency will be set to max for\n+ the TRAFFIC policy\n+:Type: integer\n+:Values: The number of packets per interval above which the TRAFFIC policy\n+ applies the maximum frequency\n+:Required: only for TRAFFIC policy\n+:Example:\n+\n+ .. code-block:: console\n+\n+ \"max_packet_thresh\": 500000\n+\n+:Pair Name: \"core_list\"\n+:Description: The cores to which to apply the policy.\n+:Type: array of integers\n+:Values: array with list of virtual CPUs.\n+:Required: only policy CREATE/DESTROY\n+:Example:\n+\n+ .. code-block:: console\n+\n+ \"core_list\":[ 10, 11 ]\n+\n+:Pair Name: \"unit\"\n+:Description: the type of power operation to apply in the command\n+:Type: string\n+:Values:\n+\n+ :\"SCALE_MAX\": Scale frequency of this core to maximum\n+ :\"SCALE_MIN\": Scale frequency of this core to minimum\n+ :\"SCALE_UP\": Scale up frequency of this core\n+ :\"SCALE_DOWN\": Scale down frequency of this core\n+ :\"ENABLE_TURBO\": Enable Turbo Boost for this core\n+ :\"DISABLE_TURBO\": Disable Turbo Boost for this core\n+:Required: only for POWER instruction\n+:Example:\n+\n+ .. code-block:: console\n+\n+ \"unit\", \"SCALE_MAX\"\n+\n+:Pair Name: \"resource_id\"\n+:Description: The core to which to apply the power command.\n+:Type: integer\n+:Values: valid core id for VM or host OS.\n+:Required: only POWER instruction\n+:Example:\n+\n+ .. code-block:: console\n+\n+ \"resource_id\": 10\n+\n+JSON API Examples\n+~~~~~~~~~~~~~~~~~\n+\n+Profile create example:\n+\n+ .. code-block:: console\n+\n+ {\"policy\": {\n+ \"name\": \"ubuntu\",\n+ \"command\": \"create\",\n+ \"policy_type\": \"TIME\",\n+ \"busy_hours\":[ 17, 18, 19, 20, 21, 22, 23 ],\n+ \"quiet_hours\":[ 2, 3, 4, 5, 6 ],\n+ \"core_list\":[ 11 ]\n+ }}\n+\n+Profile destroy example:\n+\n+ .. code-block:: console\n+\n+ {\"profile\": {\n+ \"name\": \"ubuntu\",\n+ \"command\": \"destroy\",\n+ }}\n+\n+Power command example:\n+\n+ .. code-block:: console\n+\n+ {\"command\": {\n+ \"name\": \"ubuntu\",\n+ \"unit\": \"SCALE_MAX\",\n+ \"resource_id\": 10\n+ }}\n+\n+To send a JSON string to the Power Manager application, simply paste the\n+example JSON string into a text file and cat it into the fifo:\n+\n+ .. code-block:: console\n+\n+ cat file.json >/tmp/powermonitor/fifo\n+\n+The console of the Power Manager application should indicate the command that\n+was just received via the fifo.\n+\n Compiling and Running the Guest Applications\n --------------------------------------------\n \n@@ -366,7 +618,7 @@ For compiling and running l3fwd-power, see :doc:`l3_forward_power_man`.\n \n The application is located in the ``guest_cli`` sub-directory under ``vm_power_manager``.\n \n-To build just the ``guest_vm_power_manager`` application:\n+To build just the ``guest_vm_power_manager`` application using ``make``:\n \n .. code-block:: console\n \n@@ -375,6 +627,22 @@ To build just the ``guest_vm_power_manager`` application:\n cd ${RTE_SDK}/examples/vm_power_manager/guest_cli/\n make\n \n+The resulting binary will be ${RTE_SDK}/build/examples/guest_cli\n+\n+To build just the ``vm_power_manager`` application using ``meson/ninja``:\n+\n+.. code-block:: console\n+\n+ export RTE_SDK=/path/to/rte_sdk\n+ cd ${RTE_SDK}\n+ meson build\n+ cd build\n+ ninja\n+ meson configure -Dexamples=vm_power_manager/guest_cli\n+ ninja\n+\n+The resulting binary will be ${RTE_SDK}/build/examples/guest_cli\n+\n Running\n ~~~~~~~\n \n", "prefixes": [ "v4", "10/11" ] }{ "id": 45416, "url": "