Show a patch.

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

{
    "id": 44728,
    "url": "http://patches.dpdk.org/api/patches/44728/",
    "web_url": "http://patches.dpdk.org/patch/44728/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<20180914135406.52190-8-david.hunt@intel.com>",
    "date": "2018-09-14T13:54:05",
    "name": "[v3,7/8] doc/vm_power_manager: add JSON interface API info",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "349684e751fc7114823bc6c962fc96c396497658",
    "submitter": {
        "id": 342,
        "url": "http://patches.dpdk.org/api/people/342/",
        "name": "David Hunt",
        "email": "david.hunt@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/patch/44728/mbox/",
    "series": [
        {
            "id": 1322,
            "url": "http://patches.dpdk.org/api/series/1322/",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1322",
            "date": "2018-09-14T13:53:58",
            "name": "add json power policy interface for containers",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/1322/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/44728/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/44728/checks/",
    "tags": {},
    "headers": {
        "X-Mailman-Version": "2.1.15",
        "X-ExtLoop1": "1",
        "Errors-To": "dev-bounces@dpdk.org",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Mailer": "git-send-email 2.17.1",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id ED9E65F57;\n\tFri, 14 Sep 2018 15:54:28 +0200 (CEST)",
            "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby dpdk.org (Postfix) with ESMTP id DA9A75B20\n\tfor <dev@dpdk.org>; Fri, 14 Sep 2018 15:54:22 +0200 (CEST)",
            "from orsmga005.jf.intel.com ([10.7.209.41])\n\tby orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t14 Sep 2018 06:54:22 -0700",
            "from silpixa00399952.ir.intel.com (HELO\n\tsilpixa00399952.ger.corp.intel.com) ([10.237.223.64])\n\tby orsmga005.jf.intel.com with ESMTP; 14 Sep 2018 06:54:21 -0700"
        ],
        "References": "<20180912144930.50578-1-david.hunt@intel.com>\n\t<20180914135406.52190-1-david.hunt@intel.com>",
        "X-Amp-File-Uploaded": "False",
        "X-BeenThere": "dev@dpdk.org",
        "Message-Id": "<20180914135406.52190-8-david.hunt@intel.com>",
        "X-IronPort-AV": "E=Sophos;i=\"5.53,373,1531810800\"; d=\"scan'208\";a=\"257257232\"",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "Precedence": "list",
        "From": "David Hunt <david.hunt@intel.com>",
        "X-Original-To": "patchwork@dpdk.org",
        "List-Post": "<mailto:dev@dpdk.org>",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "In-Reply-To": "<20180914135406.52190-1-david.hunt@intel.com>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "To": "dev@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "Date": "Fri, 14 Sep 2018 14:54:05 +0100",
        "Cc": "john.mcnamara@intel.com, stephen@networkplumber.org, lei.a.yao@intel.com,\n\tbruce.richardson@intel.com, David Hunt <david.hunt@intel.com>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Subject": "[dpdk-dev] [PATCH v3 7/8] doc/vm_power_manager: add JSON interface\n\tAPI info"
    },
    "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..038cf1f93 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.0\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.0\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": [
        "v3",
        "7/8"
    ]
}