get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 69010,
    "url": "http://patches.dpdk.org/api/patches/69010/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/f2aa59260da30f5bc1e9fb7b22cbb70eb39f02db.1587405227.git.anatoly.burakov@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": "<f2aa59260da30f5bc1e9fb7b22cbb70eb39f02db.1587405227.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/f2aa59260da30f5bc1e9fb7b22cbb70eb39f02db.1587405227.git.anatoly.burakov@intel.com",
    "date": "2020-04-20T17:56:52",
    "name": "[v2,2/2] l3fwd-power: implement proper shutdown handling",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "f22698d02d8919346e340c5817f9c0ec258c22ae",
    "submitter": {
        "id": 4,
        "url": "http://patches.dpdk.org/api/people/4/?format=api",
        "name": "Anatoly Burakov",
        "email": "anatoly.burakov@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/f2aa59260da30f5bc1e9fb7b22cbb70eb39f02db.1587405227.git.anatoly.burakov@intel.com/mbox/",
    "series": [
        {
            "id": 9542,
            "url": "http://patches.dpdk.org/api/series/9542/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=9542",
            "date": "2020-04-20T17:56:51",
            "name": "[v2,1/2] l3fwd-power: exit if initializing power library failed",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/9542/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/69010/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/69010/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 31726A0598;\n\tTue, 21 Apr 2020 12:50:11 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id E3ECD1D970;\n\tTue, 21 Apr 2020 12:50:09 +0200 (CEST)",
            "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n by dpdk.org (Postfix) with ESMTP id 875861D8E9\n for <dev@dpdk.org>; Tue, 21 Apr 2020 12:50:02 +0200 (CEST)",
            "from fmsmga005.fm.intel.com ([10.253.24.32])\n by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 21 Apr 2020 03:50:02 -0700",
            "from aburakov-mobl.ger.corp.intel.com (HELO localhost.localdomain)\n ([10.213.208.123])\n by fmsmga005.fm.intel.com with ESMTP; 21 Apr 2020 03:50:01 -0700"
        ],
        "IronPort-SDR": [
            "\n iY/nRiieajrX88UA08QXBLpfkFMBTHT0DN3G9Ri5To0YVIyrKo+xKniuypQeF3KXnPCR/qv2jP\n nwFs5KC+/Udw==",
            "\n 1ig2gOZQVoMT8MI8qnf6BHM03I/x+jclLy1I/E+XV4wM3bsLb/fqkVgzz7jvBUwv3LCld34pgh\n pf3xoZ+tYGmA=="
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.72,410,1580803200\"; d=\"scan'208\";a=\"456058671\"",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "David Hunt <david.hunt@intel.com>,\n\treshma.pattan@intel.com",
        "Date": "Mon, 20 Apr 2020 17:56:52 +0000",
        "Message-Id": "\n <f2aa59260da30f5bc1e9fb7b22cbb70eb39f02db.1587405227.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": [
            "\n <b9b8f8b9efc33b447c861719f2ce03af20831700.1587405227.git.anatoly.burakov@intel.com>",
            "\n <854770a880777e7ad200481294a7aa5ac9a45f2d.1586361368.git.anatoly.burakov@intel.com>"
        ],
        "References": [
            "\n <b9b8f8b9efc33b447c861719f2ce03af20831700.1587405227.git.anatoly.burakov@intel.com>",
            "\n <854770a880777e7ad200481294a7aa5ac9a45f2d.1586361368.git.anatoly.burakov@intel.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH v2 2/2] l3fwd-power: implement proper shutdown\n\thandling",
        "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 <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": "Currently, shutdown for l3fwd-power application is all over the place\nand may or may not happen either in the signal handler or in the main()\nfunction. Fix this so that the signal handler will only set the exit\nvariable, thereby allowing all of the loops to end properly and proceed\nto deinitialize everything.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\nAcked-by: David Hunt <david.hunt@intel.com>\nReviewed-by: Reshma Pattan <reshma.pattan@intel.com>\n---\n\nNotes:\n    v2:\n    - rebase on top of latest master\n\n examples/l3fwd-power/main.c | 74 ++++++++++++++++++++-----------------\n 1 file changed, 40 insertions(+), 34 deletions(-)",
    "diff": "diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c\nindex be50ec049..293b3da4a 100644\n--- a/examples/l3fwd-power/main.c\n+++ b/examples/l3fwd-power/main.c\n@@ -422,41 +422,10 @@ static int is_done(void)\n static void\n signal_exit_now(int sigtype)\n {\n-\tunsigned lcore_id;\n-\tunsigned int portid;\n-\tint ret;\n-\n-\tif (sigtype == SIGINT) {\n-\t\tif (app_mode == APP_MODE_EMPTY_POLL ||\n-\t\t\t\tapp_mode == APP_MODE_TELEMETRY)\n-\t\t\tquit_signal = true;\n \n+\tif (sigtype == SIGINT)\n+\t\tquit_signal = true;\n \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-\n-\t\t\t/* init power management library */\n-\t\t\tret = rte_power_exit(lcore_id);\n-\t\t\tif (ret)\n-\t\t\t\trte_exit(EXIT_FAILURE, \"Power management \"\n-\t\t\t\t\t\"library de-initialization failed on \"\n-\t\t\t\t\t\t\t\"core%u\\n\", lcore_id);\n-\t\t}\n-\n-\t\tif (app_mode != APP_MODE_EMPTY_POLL) {\n-\t\t\tRTE_ETH_FOREACH_DEV(portid) {\n-\t\t\t\tif ((enabled_port_mask & (1 << portid)) == 0)\n-\t\t\t\t\tcontinue;\n-\n-\t\t\t\trte_eth_dev_stop(portid);\n-\t\t\t\trte_eth_dev_close(portid);\n-\t\t\t}\n-\t\t}\n-\t}\n-\n-\tif (app_mode != APP_MODE_EMPTY_POLL)\n-\t\trte_exit(EXIT_SUCCESS, \"User forced exit\\n\");\n }\n \n /*  Freqency scale down timer callback */\n@@ -1196,7 +1165,7 @@ main_loop(__rte_unused void *dummy)\n \telse\n \t\tRTE_LOG(INFO, L3FWD_POWER, \"RX interrupt won't enable.\\n\");\n \n-\twhile (1) {\n+\twhile (!is_done()) {\n \t\tstats[lcore_id].nb_iteration_looped++;\n \n \t\tcur_tsc = rte_rdtsc();\n@@ -1343,6 +1312,8 @@ main_loop(__rte_unused void *dummy)\n \t\t\tstats[lcore_id].sleep_time += lcore_idle_hint;\n \t\t}\n \t}\n+\n+\treturn 0;\n }\n \n static int\n@@ -2080,6 +2051,26 @@ init_power_library(void)\n \t}\n \treturn ret;\n }\n+\n+static int\n+deinit_power_library(void)\n+{\n+\tunsigned int lcore_id;\n+\tint ret = 0;\n+\n+\tRTE_LCORE_FOREACH(lcore_id) {\n+\t\t/* deinit power management library */\n+\t\tret = rte_power_exit(lcore_id);\n+\t\tif (ret) {\n+\t\t\tRTE_LOG(ERR, POWER,\n+\t\t\t\t\"Library deinitialization failed on core %u\\n\",\n+\t\t\t\tlcore_id);\n+\t\t\treturn ret;\n+\t\t}\n+\t}\n+\treturn ret;\n+}\n+\n static void\n update_telemetry(__rte_unused struct rte_timer *tim,\n \t\t__rte_unused void *arg)\n@@ -2530,8 +2521,23 @@ main(int argc, char **argv)\n \t\t\treturn -1;\n \t}\n \n+\tRTE_ETH_FOREACH_DEV(portid)\n+\t{\n+\t\tif ((enabled_port_mask & (1 << portid)) == 0)\n+\t\t\tcontinue;\n+\n+\t\trte_eth_dev_stop(portid);\n+\t\trte_eth_dev_close(portid);\n+\t}\n+\n \tif (app_mode == APP_MODE_EMPTY_POLL)\n \t\trte_power_empty_poll_stat_free();\n \n+\tif (app_mode != APP_MODE_TELEMETRY && deinit_power_library())\n+\t\trte_exit(EXIT_FAILURE, \"deinit_power_library failed\\n\");\n+\n+\tif (rte_eal_cleanup() < 0)\n+\t\tRTE_LOG(ERR, L3FWD_POWER, \"EAL cleanup failed\\n\");\n+\n \treturn 0;\n }\n",
    "prefixes": [
        "v2",
        "2/2"
    ]
}