get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 53208,
    "url": "http://patches.dpdk.org/api/patches/53208/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1556800505-59917-1-git-send-email-mousuanming@huawei.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": "<1556800505-59917-1-git-send-email-mousuanming@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1556800505-59917-1-git-send-email-mousuanming@huawei.com",
    "date": "2019-05-02T12:35:05",
    "name": "[v7] app/pdump: add pudmp exits with primary support",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "6f80a19057b1d290d38ca2cbcb15f187bf731a43",
    "submitter": {
        "id": 1301,
        "url": "http://patches.dpdk.org/api/people/1301/?format=api",
        "name": "Suanming.Mou",
        "email": "mousuanming@huawei.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1556800505-59917-1-git-send-email-mousuanming@huawei.com/mbox/",
    "series": [
        {
            "id": 4538,
            "url": "http://patches.dpdk.org/api/series/4538/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4538",
            "date": "2019-05-02T12:35:05",
            "name": "[v7] app/pdump: add pudmp exits with primary support",
            "version": 7,
            "mbox": "http://patches.dpdk.org/series/4538/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/53208/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/53208/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 69CE62C55;\n\tThu,  2 May 2019 12:32:33 +0200 (CEST)",
            "from huawei.com (szxga06-in.huawei.com [45.249.212.32])\n\tby dpdk.org (Postfix) with ESMTP id 34C262C4F\n\tfor <dev@dpdk.org>; Thu,  2 May 2019 12:32:31 +0200 (CEST)",
            "from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58])\n\tby Forcepoint Email with ESMTP id 180FCA24FEBB27C0306F\n\tfor <dev@dpdk.org>; Thu,  2 May 2019 18:32:29 +0800 (CST)",
            "from huawei.com (10.175.100.202) by DGGEMS405-HUB.china.huawei.com\n\t(10.3.19.205) with Microsoft SMTP Server id 14.3.439.0;\n\tThu, 2 May 2019 18:32:24 +0800"
        ],
        "From": "Suanming.Mou <mousuanming@huawei.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<vipin.varghese@intel.com>, <anatoly.burakov@intel.com>",
        "Date": "Thu, 2 May 2019 12:35:05 +0000",
        "Message-ID": "<1556800505-59917-1-git-send-email-mousuanming@huawei.com>",
        "X-Mailer": "git-send-email 1.8.3.4",
        "In-Reply-To": "<1556774432-59147-1-git-send-email-mousuanming@huawei.com>",
        "References": "<1556774432-59147-1-git-send-email-mousuanming@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.175.100.202]",
        "X-CFilter-Loop": "Reflected",
        "Subject": "[dpdk-dev] [PATCH v7] app/pdump: add pudmp exits with primary\n\tsupport",
        "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": "When primary app exits, the residual running pdump will stop the\nprimary app to restart. Add pdump exits with primary support.\n\nSigned-off-by: Suanming.Mou <mousuanming@huawei.com>\n---\nV7:\n* omit `else` in monitor_primary.\n* add eixting due to primary is not alive message.\n* add pdump.rst update.\n\n app/pdump/main.c           | 47 +++++++++++++++++++++++++++++++++++++++++++++-\n doc/guides/tools/pdump.rst |  2 ++\n 2 files changed, 48 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/app/pdump/main.c b/app/pdump/main.c\nindex 3d20854..0b74c27 100644\n--- a/app/pdump/main.c\n+++ b/app/pdump/main.c\n@@ -13,6 +13,7 @@\n #include <net/if.h>\n \n #include <rte_eal.h>\n+#include <rte_alarm.h>\n #include <rte_common.h>\n #include <rte_debug.h>\n #include <rte_ethdev.h>\n@@ -65,6 +66,8 @@\n #define SIZE 256\n #define BURST_SIZE 32\n #define NUM_VDEVS 2\n+/* Enough to set it to 500ms for exiting. */\n+#define MONITOR_INTERVAL (500 * 1000)\n \n /* true if x is a power of 2 */\n #define POWEROF2(x) ((((x)-1) & (x)) == 0)\n@@ -413,6 +416,21 @@ struct parse_val {\n }\n \n static void\n+monitor_primary(void *arg __rte_unused)\n+{\n+\tif (quit_signal)\n+\t\treturn;\n+\n+\tif (rte_eal_primary_proc_alive(NULL)) {\n+\t\trte_eal_alarm_set(MONITOR_INTERVAL, monitor_primary, NULL);\n+\t\treturn;\n+\t}\n+\n+\tprintf(\"Exiting dump while primary is not alive...\\n\");\n+\tquit_signal = 1;\n+}\n+\n+static void\n print_pdump_stats(void)\n {\n \tint i;\n@@ -537,6 +555,20 @@ struct parse_val {\n }\n \n static void\n+disable_primary_monitor(void)\n+{\n+\tint ret;\n+\n+\t/*\n+\t * Don't worry about it is primary exit case. The alarm cancel\n+\t * function will take care about that. Ignore the ENOENT case.\n+\t */\n+\tret = rte_eal_alarm_cancel(monitor_primary, NULL);\n+\tif (ret < 0)\n+\t\tprintf(\"Fail to disable monitor:%d\\n\", ret);\n+}\n+\n+static void\n signal_handler(int sig_num)\n {\n \tif (sig_num == SIGINT) {\n@@ -910,6 +942,17 @@ struct parse_val {\n \t\t;\n }\n \n+static void\n+enable_primary_monitor(void)\n+{\n+\tint ret;\n+\n+\t/* Once primary exits, so will pdump. */\n+\tret = rte_eal_alarm_set(MONITOR_INTERVAL, monitor_primary, NULL);\n+\tif (ret < 0)\n+\t\tprintf(\"Fail to enable monitor:%d\\n\", ret);\n+}\n+\n int\n main(int argc, char **argv)\n {\n@@ -950,11 +993,13 @@ struct parse_val {\n \t\t\trte_exit(EXIT_FAILURE, \"Invalid argument\\n\");\n \t}\n \n-\t/* create mempool, ring and vdevs info */\n+\t/* create mempool, ring, vdevs info and primary monitor */\n \tcreate_mp_ring_vdev();\n \tenable_pdump();\n+\tenable_primary_monitor();\n \tdump_packets();\n \n+\tdisable_primary_monitor();\n \tcleanup_pdump_resources();\n \t/* dump debug stats */\n \tprint_pdump_stats();\ndiff --git a/doc/guides/tools/pdump.rst b/doc/guides/tools/pdump.rst\nindex 53cd2b4..62b4a5e 100644\n--- a/doc/guides/tools/pdump.rst\n+++ b/doc/guides/tools/pdump.rst\n@@ -26,6 +26,8 @@ a DPDK secondary process and is capable of enabling packet capture on dpdk ports\n         Once the libpcap development files are installed, the libpcap based PMD\n         can be enabled by setting CONFIG_RTE_LIBRTE_PMD_PCAP=y and recompiling the DPDK.\n \n+      * The ``dpdk-pdump`` tool runs as a DPDK secondary process. It exits when\n+        the primary application exits.\n \n Running the Application\n -----------------------\n",
    "prefixes": [
        "v7"
    ]
}