get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 68011,
    "url": "http://patches.dpdk.org/api/patches/68011/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/bc4ecf502076f0d221a37f4ab0b67f3ef0c99af0.1586361368.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": "<bc4ecf502076f0d221a37f4ab0b67f3ef0c99af0.1586361368.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/bc4ecf502076f0d221a37f4ab0b67f3ef0c99af0.1586361368.git.anatoly.burakov@intel.com",
    "date": "2020-04-08T15:56:14",
    "name": "[2/2] l3fwd-power: implement proper shutdown handling",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "9e662d1c56b7a9f12d4e7848be4224d01a3f0d16",
    "submitter": {
        "id": 4,
        "url": "http://patches.dpdk.org/api/people/4/?format=api",
        "name": "Anatoly Burakov",
        "email": "anatoly.burakov@intel.com"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/bc4ecf502076f0d221a37f4ab0b67f3ef0c99af0.1586361368.git.anatoly.burakov@intel.com/mbox/",
    "series": [
        {
            "id": 9254,
            "url": "http://patches.dpdk.org/api/series/9254/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=9254",
            "date": "2020-04-08T15:56:13",
            "name": "[1/2] l3fwd-power: exit if initializing power library failed",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/9254/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/68011/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/68011/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 DD88BA0597;\n\tWed,  8 Apr 2020 17:56:25 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id AD7641C0C7;\n\tWed,  8 Apr 2020 17:56:21 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n by dpdk.org (Postfix) with ESMTP id CBE911C065\n for <dev@dpdk.org>; Wed,  8 Apr 2020 17:56:17 +0200 (CEST)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 08 Apr 2020 08:56:17 -0700",
            "from silpixa00399498.ir.intel.com (HELO\n silpixa00399498.ger.corp.intel.com) ([10.237.222.52])\n by FMSMGA003.fm.intel.com with ESMTP; 08 Apr 2020 08:56:16 -0700"
        ],
        "IronPort-SDR": [
            "\n MaDRkvIFUwzZrCdDvepTFImq8xtM8Gz7mv0zhqJmsiEPBkQl3b6+q6Oyq5kOHK5tSLC9W7fYAo\n iC75xwZoxSww==",
            "\n d/gYgA4+eBqF9SNCF8LeHwLc6aoz8saSPPkm1nTfyEeIzWxDrB6xGSda0m4Sstj6siK7zuv37G\n GUSEaGHBhz2w=="
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.72,359,1580803200\"; d=\"scan'208\";a=\"297271513\"",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "David Hunt <david.hunt@intel.com>,\n\treshma.pattan@intel.com",
        "Date": "Wed,  8 Apr 2020 16:56:14 +0100",
        "Message-Id": "\n <bc4ecf502076f0d221a37f4ab0b67f3ef0c99af0.1586361368.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": [
            "\n <854770a880777e7ad200481294a7aa5ac9a45f2d.1586361368.git.anatoly.burakov@intel.com>",
            "\n <854770a880777e7ad200481294a7aa5ac9a45f2d.1586361368.git.anatoly.burakov@intel.com>"
        ],
        "References": [
            "\n <854770a880777e7ad200481294a7aa5ac9a45f2d.1586361368.git.anatoly.burakov@intel.com>",
            "\n <854770a880777e7ad200481294a7aa5ac9a45f2d.1586361368.git.anatoly.burakov@intel.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH 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>\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 0e5fe42a64..0fd80e9c1e 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+\tif (sigtype == SIGINT)\n+\t\tquit_signal = true;\n \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(__attribute__((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(__attribute__((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(__attribute__((unused)) struct rte_timer *tim,\n \t\t__attribute__((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": [
        "2/2"
    ]
}