get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 45816,
    "url": "http://patches.dpdk.org/api/patches/45816/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20181002084328.57127-11-david.hunt@intel.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<20181002084328.57127-11-david.hunt@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20181002084328.57127-11-david.hunt@intel.com",
    "date": "2018-10-02T08:43:28",
    "name": "[v6,10/10] doc/vm_power_manager: add JSON interface API info",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "ec47a174d6db6935dfc23a78f376fde7b777ea3e",
    "submitter": {
        "id": 342,
        "url": "http://patches.dpdk.org/api/people/342/?format=api",
        "name": "Hunt, David",
        "email": "david.hunt@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20181002084328.57127-11-david.hunt@intel.com/mbox/",
    "series": [
        {
            "id": 1628,
            "url": "http://patches.dpdk.org/api/series/1628/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1628",
            "date": "2018-10-02T08:43:20",
            "name": "add json power policy interface for containers",
            "version": 6,
            "mbox": "http://patches.dpdk.org/series/1628/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/45816/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/45816/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 961EC5B2C;\n\tTue,  2 Oct 2018 10:43:59 +0200 (CEST)",
            "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n\tby dpdk.org (Postfix) with ESMTP id 8D9F437B4\n\tfor <dev@dpdk.org>; Tue,  2 Oct 2018 10:43:47 +0200 (CEST)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t02 Oct 2018 01:43:47 -0700",
            "from silpixa00399952.ir.intel.com (HELO\n\tsilpixa00399952.ger.corp.intel.com) ([10.237.223.64])\n\tby fmsmga006.fm.intel.com with ESMTP; 02 Oct 2018 01:43:45 -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,331,1534834800\"; d=\"scan'208\";a=\"268705679\"",
        "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": "Tue,  2 Oct 2018 09:43:28 +0100",
        "Message-Id": "<20181002084328.57127-11-david.hunt@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20181002084328.57127-1-david.hunt@intel.com>",
        "References": "<20180926163727.47337-1-david.hunt@intel.com>\n\t<20181002084328.57127-1-david.hunt@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v6 10/10] 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>\nAcked-by: Marko Kovacevic <marko.kovacevic@intel.com>\n---\n .../sample_app_ug/vm_power_management.rst     | 300 +++++++++++++++++-\n 1 file changed, 298 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..1ad4f1490 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,270 @@ 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:: javascript\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:: javascript\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 integers, 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:: javascript\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:: javascript\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:: javascript\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:: javascript\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:: javascript\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:: javascript\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:: javascript\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:: javascript\n+\n+    \"core_list\":[ 10, 11 ]\n+\n+:Pair Name: \"workload\"\n+:Description: When our policy is of type WORKLOAD, we need to specify how\n+  heavy our workload is.\n+:Type: string\n+:Values:\n+\n+  :HIGH: For cores running workloads that require high frequencies\n+  :MEDIUM: For cores running workloads that require medium frequencies\n+  :LOW: For cores running workloads that require low frequencies\n+:Required: only for WORKLOAD policy types\n+:Example:\n+\n+  .. code-block:: javascript\n+\n+    \"workload\", \"MEDIUM\"\n+\n+:Pair Name: \"mac_list\"\n+:Description: When our policy is of type TRAFFIC, we need to specify the\n+  MAC addresses that the host needs to monitor\n+:Type: string\n+:Values: array with a list of mac address strings.\n+:Required: only for TRAFFIC policy types\n+:Example:\n+\n+  .. code-block:: javascript\n+\n+    \"mac_list\":[ \"de:ad:be:ef:01:01\", \"de:ad:be:ef:01:02\" ]\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:: javascript\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:: javascript\n+\n+    \"resource_id\": 10\n+\n+JSON API Examples\n+~~~~~~~~~~~~~~~~~\n+\n+Profile create example:\n+\n+  .. code-block:: javascript\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:: javascript\n+\n+    {\"profile\": {\n+      \"name\": \"ubuntu\",\n+      \"command\": \"destroy\",\n+    }}\n+\n+Power command example:\n+\n+  .. code-block:: javascript\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 +646,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 +655,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": [
        "v6",
        "10/10"
    ]
}