get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 86429,
    "url": "http://patchwork.dpdk.org/api/patches/86429/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/cde07642b12a095e3d5e2cf42409e34a93d80dde.1610473000.git.anatoly.burakov@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<cde07642b12a095e3d5e2cf42409e34a93d80dde.1610473000.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/cde07642b12a095e3d5e2cf42409e34a93d80dde.1610473000.git.anatoly.burakov@intel.com",
    "date": "2021-01-12T17:37:19",
    "name": "[v16,11/11] examples/l3fwd-power: enable PMD power mgmt",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "01853aa37b1ea5df89de42184968d36765487fb8",
    "submitter": {
        "id": 4,
        "url": "http://patchwork.dpdk.org/api/people/4/?format=api",
        "name": "Anatoly Burakov",
        "email": "anatoly.burakov@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/cde07642b12a095e3d5e2cf42409e34a93d80dde.1610473000.git.anatoly.burakov@intel.com/mbox/",
    "series": [
        {
            "id": 14673,
            "url": "http://patchwork.dpdk.org/api/series/14673/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=14673",
            "date": "2021-01-12T17:37:08",
            "name": "Add PMD power management",
            "version": 16,
            "mbox": "http://patchwork.dpdk.org/series/14673/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/86429/comments/",
    "check": "fail",
    "checks": "http://patchwork.dpdk.org/api/patches/86429/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 2B600A04B5;\n\tTue, 12 Jan 2021 18:39:08 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id C2329140EFC;\n\tTue, 12 Jan 2021 18:37:53 +0100 (CET)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n by mails.dpdk.org (Postfix) with ESMTP id AFDFC140EF7\n for <dev@dpdk.org>; Tue, 12 Jan 2021 18:37:52 +0100 (CET)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 12 Jan 2021 09:37:52 -0800",
            "from silpixa00399498.ir.intel.com (HELO\n silpixa00399498.ger.corp.intel.com) ([10.237.222.179])\n by fmsmga001.fm.intel.com with ESMTP; 12 Jan 2021 09:37:50 -0800"
        ],
        "IronPort-SDR": [
            "\n 7uIaeEo/W8MEvYPj0PLXcPyc6Q/Zkl5Y5Ei5j57tJjUgVRHe/CXCrN73vTY72wOlOQq53pO6Sm\n bcWKH4lO/pqw==",
            "\n JuTDhTmHeuNBmfMoeVTcpx6Hr9Wsq84uYA+pMa5+3eKwB1PKx9KGAJhC7uweWieyrXTaG0VQEq\n kG83X9jWhjDA=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9862\"; a=\"175498081\"",
            "E=Sophos;i=\"5.79,342,1602572400\"; d=\"scan'208\";a=\"175498081\"",
            "E=Sophos;i=\"5.79,342,1602572400\"; d=\"scan'208\";a=\"464604284\""
        ],
        "X-ExtLoop1": "1",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Liang Ma <liang.j.ma@intel.com>, David Hunt <david.hunt@intel.com>,\n thomas@monjalon.net, konstantin.ananyev@intel.com,\n timothy.mcdaniel@intel.com, bruce.richardson@intel.com,\n chris.macnamara@intel.com",
        "Date": "Tue, 12 Jan 2021 17:37:19 +0000",
        "Message-Id": "\n <cde07642b12a095e3d5e2cf42409e34a93d80dde.1610473000.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<cover.1610473000.git.anatoly.burakov@intel.com>",
        "References": "<cover.1610377084.git.anatoly.burakov@intel.com>\n <cover.1610473000.git.anatoly.burakov@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v16 11/11] examples/l3fwd-power: enable PMD power\n mgmt",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <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 <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Liang Ma <liang.j.ma@intel.com>\n\nAdd PMD power management feature support to l3fwd-power sample app.\n\nSigned-off-by: Liang Ma <liang.j.ma@intel.com>\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n\nNotes:\n    v12:\n    - Allow selecting PMD power management scheme from command-line\n    - Enforce 1 core 1 queue rule\n\n .../sample_app_ug/l3_forward_power_man.rst    | 35 ++++++++\n examples/l3fwd-power/main.c                   | 89 ++++++++++++++++++-\n 2 files changed, 122 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/doc/guides/sample_app_ug/l3_forward_power_man.rst b/doc/guides/sample_app_ug/l3_forward_power_man.rst\nindex 85a78a5c1e..aaa9367fae 100644\n--- a/doc/guides/sample_app_ug/l3_forward_power_man.rst\n+++ b/doc/guides/sample_app_ug/l3_forward_power_man.rst\n@@ -109,6 +109,8 @@ where,\n \n *   --telemetry:  Telemetry mode.\n \n+*   --pmd-mgmt: PMD power management mode.\n+\n See :doc:`l3_forward` for details.\n The L3fwd-power example reuses the L3fwd command line options.\n \n@@ -456,3 +458,36 @@ reference cycles and accordingly busy rate is set  to either 0% or\n \n The new stats ``empty_poll`` , ``full_poll`` and ``busy_percent`` can be viewed by running the script\n ``/usertools/dpdk-telemetry-client.py`` and selecting the menu option ``Send for global Metrics``.\n+\n+PMD power management Mode\n+-------------------------\n+\n+The PMD power management  mode support for ``l3fwd-power`` is a standalone mode, in this mode\n+``l3fwd-power`` does simple l3fwding along with enable the power saving scheme on specific\n+port/queue/lcore. Main purpose for this mode is to demonstrate how to use the PMD power management API.\n+\n+.. code-block:: console\n+\n+        ./build/examples/dpdk-l3fwd-power -l 1-3 --  --pmd-mgmt -p 0x0f --config=\"(0,0,2),(0,1,3)\"\n+\n+PMD Power Management Mode\n+-------------------------\n+There is also a traffic-aware operating mode that, instead of using explicit\n+power management, will use automatic PMD power management. This mode is limited\n+to one queue per core, and has three available power management schemes:\n+\n+* ``monitor`` - this will use ``rte_power_monitor()`` function to enter a\n+  power-optimized state (subject to platform support).\n+\n+* ``pause`` - this will use ``rte_power_pause()`` or ``rte_pause()`` to avoid\n+  busy looping when there is no traffic.\n+\n+* ``scale`` - this will use frequency scaling routines available in the\n+  ``librte_power`` library.\n+\n+See :doc:`Power Management<../prog_guide/power_man>` chapter in the DPDK\n+Programmer's Guide for more details on PMD power management.\n+\n+.. code-block:: console\n+\n+        ./<build_dir>/examples/dpdk-l3fwd-power -l 1-3 -- -p 0x0f --config=\"(0,0,2),(0,1,3)\" --pmd-mgmt=scale\ndiff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c\nindex 995a3b6ad7..e312b6f355 100644\n--- a/examples/l3fwd-power/main.c\n+++ b/examples/l3fwd-power/main.c\n@@ -47,6 +47,7 @@\n #include <rte_power_empty_poll.h>\n #include <rte_metrics.h>\n #include <rte_telemetry.h>\n+#include <rte_power_pmd_mgmt.h>\n \n #include \"perf_core.h\"\n #include \"main.h\"\n@@ -199,11 +200,14 @@ enum appmode {\n \tAPP_MODE_LEGACY,\n \tAPP_MODE_EMPTY_POLL,\n \tAPP_MODE_TELEMETRY,\n-\tAPP_MODE_INTERRUPT\n+\tAPP_MODE_INTERRUPT,\n+\tAPP_MODE_PMD_MGMT\n };\n \n enum appmode app_mode;\n \n+static enum rte_power_pmd_mgmt_type pmgmt_type;\n+\n enum freq_scale_hint_t\n {\n \tFREQ_LOWER    =      -1,\n@@ -1611,7 +1615,9 @@ print_usage(const char *prgname)\n \t\t\" follow (training_flag, high_threshold, med_threshold)\\n\"\n \t\t\" --telemetry: enable telemetry mode, to update\"\n \t\t\" empty polls, full polls, and core busyness to telemetry\\n\"\n-\t\t\" --interrupt-only: enable interrupt-only mode\\n\",\n+\t\t\" --interrupt-only: enable interrupt-only mode\\n\"\n+\t\t\" --pmd-mgmt MODE: enable PMD power management mode. \"\n+\t\t\"Currently supported modes: monitor, pause, scale\\n\",\n \t\tprgname);\n }\n \n@@ -1701,6 +1707,32 @@ parse_config(const char *q_arg)\n \n \treturn 0;\n }\n+\n+static int\n+parse_pmd_mgmt_config(const char *name)\n+{\n+#define PMD_MGMT_MONITOR \"monitor\"\n+#define PMD_MGMT_PAUSE   \"pause\"\n+#define PMD_MGMT_SCALE   \"scale\"\n+\n+\tif (strncmp(PMD_MGMT_MONITOR, name, sizeof(PMD_MGMT_MONITOR)) == 0) {\n+\t\tpmgmt_type = RTE_POWER_MGMT_TYPE_MONITOR;\n+\t\treturn 0;\n+\t}\n+\n+\tif (strncmp(PMD_MGMT_PAUSE, name, sizeof(PMD_MGMT_PAUSE)) == 0) {\n+\t\tpmgmt_type = RTE_POWER_MGMT_TYPE_PAUSE;\n+\t\treturn 0;\n+\t}\n+\n+\tif (strncmp(PMD_MGMT_SCALE, name, sizeof(PMD_MGMT_SCALE)) == 0) {\n+\t\tpmgmt_type = RTE_POWER_MGMT_TYPE_SCALE;\n+\t\treturn 0;\n+\t}\n+\t/* unknown PMD power management mode */\n+\treturn -1;\n+}\n+\n static int\n parse_ep_config(const char *q_arg)\n {\n@@ -1755,6 +1787,7 @@ parse_ep_config(const char *q_arg)\n #define CMD_LINE_OPT_EMPTY_POLL \"empty-poll\"\n #define CMD_LINE_OPT_INTERRUPT_ONLY \"interrupt-only\"\n #define CMD_LINE_OPT_TELEMETRY \"telemetry\"\n+#define CMD_LINE_OPT_PMD_MGMT \"pmd-mgmt\"\n \n /* Parse the argument given in the command line of the application */\n static int\n@@ -1776,6 +1809,7 @@ parse_args(int argc, char **argv)\n \t\t{CMD_LINE_OPT_LEGACY, 0, 0, 0},\n \t\t{CMD_LINE_OPT_TELEMETRY, 0, 0, 0},\n \t\t{CMD_LINE_OPT_INTERRUPT_ONLY, 0, 0, 0},\n+\t\t{CMD_LINE_OPT_PMD_MGMT, 1, 0, 0},\n \t\t{NULL, 0, 0, 0}\n \t};\n \n@@ -1886,6 +1920,21 @@ parse_args(int argc, char **argv)\n \t\t\t\tprintf(\"telemetry mode is enabled\\n\");\n \t\t\t}\n \n+\t\t\tif (!strncmp(lgopts[option_index].name,\n+\t\t\t\t\tCMD_LINE_OPT_PMD_MGMT,\n+\t\t\t\t\tsizeof(CMD_LINE_OPT_PMD_MGMT))) {\n+\t\t\t\tif (app_mode != APP_MODE_DEFAULT) {\n+\t\t\t\t\tprintf(\" power mgmt mode is mutually exclusive with other modes\\n\");\n+\t\t\t\t\treturn -1;\n+\t\t\t\t}\n+\t\t\t\tif (parse_pmd_mgmt_config(optarg) < 0) {\n+\t\t\t\t\tprintf(\" Invalid PMD power management mode: %s\\n\",\n+\t\t\t\t\t\t\toptarg);\n+\t\t\t\t\treturn -1;\n+\t\t\t\t}\n+\t\t\t\tapp_mode = APP_MODE_PMD_MGMT;\n+\t\t\t\tprintf(\"PMD power mgmt mode is enabled\\n\");\n+\t\t\t}\n \t\t\tif (!strncmp(lgopts[option_index].name,\n \t\t\t\t\tCMD_LINE_OPT_INTERRUPT_ONLY,\n \t\t\t\t\tsizeof(CMD_LINE_OPT_INTERRUPT_ONLY))) {\n@@ -2442,6 +2491,8 @@ mode_to_str(enum appmode mode)\n \t\treturn \"telemetry\";\n \tcase APP_MODE_INTERRUPT:\n \t\treturn \"interrupt-only\";\n+\tcase APP_MODE_PMD_MGMT:\n+\t\treturn \"pmd mgmt\";\n \tdefault:\n \t\treturn \"invalid\";\n \t}\n@@ -2671,6 +2722,13 @@ main(int argc, char **argv)\n \t\tqconf = &lcore_conf[lcore_id];\n \t\tprintf(\"\\nInitializing rx queues on lcore %u ... \", lcore_id );\n \t\tfflush(stdout);\n+\n+\t\t/* PMD power management mode can only do 1 queue per core */\n+\t\tif (app_mode == APP_MODE_PMD_MGMT && qconf->n_rx_queue > 1) {\n+\t\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t\"In PMD power management mode, only one queue per lcore is allowed\\n\");\n+\t\t}\n+\n \t\t/* init RX queues */\n \t\tfor(queue = 0; queue < qconf->n_rx_queue; ++queue) {\n \t\t\tstruct rte_eth_rxconf rxq_conf;\n@@ -2708,6 +2766,16 @@ main(int argc, char **argv)\n \t\t\t\t\trte_exit(EXIT_FAILURE,\n \t\t\t\t\t\t \"Fail to add ptype cb\\n\");\n \t\t\t}\n+\n+\t\t\tif (app_mode == APP_MODE_PMD_MGMT) {\n+\t\t\t\tret = rte_power_pmd_mgmt_queue_enable(\n+\t\t\t\t\t\tlcore_id, portid, queueid,\n+\t\t\t\t\t\tpmgmt_type);\n+\t\t\t\tif (ret < 0)\n+\t\t\t\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t\t\t\"rte_power_pmd_mgmt_queue_enable: err=%d, port=%d\\n\",\n+\t\t\t\t\t\t\tret, portid);\n+\t\t\t}\n \t\t}\n \t}\n \n@@ -2798,6 +2866,9 @@ main(int argc, char **argv)\n \t\t\t\t\t\tSKIP_MAIN);\n \t} else if (app_mode == APP_MODE_INTERRUPT) {\n \t\trte_eal_mp_remote_launch(main_intr_loop, NULL, CALL_MAIN);\n+\t} else if (app_mode == APP_MODE_PMD_MGMT) {\n+\t\t/* reuse telemetry loop for PMD power management mode */\n+\t\trte_eal_mp_remote_launch(main_telemetry_loop, NULL, CALL_MAIN);\n \t}\n \n \tif (app_mode == APP_MODE_EMPTY_POLL || app_mode == APP_MODE_TELEMETRY)\n@@ -2824,6 +2895,20 @@ main(int argc, char **argv)\n \tif (app_mode == APP_MODE_EMPTY_POLL)\n \t\trte_power_empty_poll_stat_free();\n \n+\tif (app_mode == APP_MODE_PMD_MGMT) {\n+\t\tfor (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {\n+\t\t\tif (rte_lcore_is_enabled(lcore_id) == 0)\n+\t\t\t\tcontinue;\n+\t\t\tqconf = &lcore_conf[lcore_id];\n+\t\t\tfor (queue = 0; queue < qconf->n_rx_queue; ++queue) {\n+\t\t\t\tportid = qconf->rx_queue_list[queue].port_id;\n+\t\t\t\tqueueid = qconf->rx_queue_list[queue].queue_id;\n+\t\t\t\trte_power_pmd_mgmt_queue_disable(lcore_id,\n+\t\t\t\t\t\t\tportid, queueid);\n+\t\t\t}\n+\t\t}\n+\t}\n+\n \tif ((app_mode == APP_MODE_LEGACY || app_mode == APP_MODE_EMPTY_POLL) &&\n \t\t\tdeinit_power_library())\n \t\trte_exit(EXIT_FAILURE, \"deinit_power_library failed\\n\");\n",
    "prefixes": [
        "v16",
        "11/11"
    ]
}