get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 68686,
    "url": "http://patches.dpdk.org/api/patches/68686/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1587045052-16708-1-git-send-email-wangyunjian@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": "<1587045052-16708-1-git-send-email-wangyunjian@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1587045052-16708-1-git-send-email-wangyunjian@huawei.com",
    "date": "2020-04-16T13:50:52",
    "name": "net/tap: fix unexpected link handler",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "635d27ba5d013eafe6145bfd17cb4b1317d1dc68",
    "submitter": {
        "id": 551,
        "url": "http://patches.dpdk.org/api/people/551/?format=api",
        "name": "Yunjian Wang",
        "email": "wangyunjian@huawei.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1587045052-16708-1-git-send-email-wangyunjian@huawei.com/mbox/",
    "series": [
        {
            "id": 9429,
            "url": "http://patches.dpdk.org/api/series/9429/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=9429",
            "date": "2020-04-16T13:50:52",
            "name": "net/tap: fix unexpected link handler",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/9429/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/68686/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/68686/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 B8F3FA0588;\n\tThu, 16 Apr 2020 15:51:05 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 7DBE11DCC8;\n\tThu, 16 Apr 2020 15:51:05 +0200 (CEST)",
            "from huawei.com (szxga06-in.huawei.com [45.249.212.32])\n by dpdk.org (Postfix) with ESMTP id 7357A1C1DD;\n Thu, 16 Apr 2020 15:51:03 +0200 (CEST)",
            "from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60])\n by Forcepoint Email with ESMTP id B633EFAE0D2EE2F9FEDE;\n Thu, 16 Apr 2020 21:51:01 +0800 (CST)",
            "from localhost (10.173.251.152) by DGGEMS402-HUB.china.huawei.com\n (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Thu, 16 Apr 2020\n 21:50:54 +0800"
        ],
        "From": "wangyunjian <wangyunjian@huawei.com>",
        "To": "<dev@dpdk.org>, <ferruh.yigit@intel.com>",
        "CC": "<keith.wiles@intel.com>, <jerry.lilijun@huawei.com>,\n <xudingke@huawei.com>, Yunjian Wang <wangyunjian@huawei.com>,\n <stable@dpdk.org>",
        "Date": "Thu, 16 Apr 2020 21:50:52 +0800",
        "Message-ID": "<1587045052-16708-1-git-send-email-wangyunjian@huawei.com>",
        "X-Mailer": "git-send-email 1.9.5.msysgit.1",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.173.251.152]",
        "X-CFilter-Loop": "Reflected",
        "Subject": "[dpdk-dev]  [PATCH] net/tap: fix unexpected link handler",
        "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": "From: Yunjian Wang <wangyunjian@huawei.com>\n\nThe nic's interrupt source has some active handler, which maybe call\ntap_dev_intr_handler() to set link handler. We should cancel the link\nhandler before close fd to prevent executing the link handler. It\ntriggers segfault.\n\nCall Trace:\n   0x00007f15e08dad99 in __rte_panic (Error adding fd %d epoll_ctl, %s\\n\")\n   0x00007f15e08e9b87 in eal_intr_thread_main ()\n   0x00007f15e249be15 in start_thread ()\n   0x00007f15d5322f9d in clone ()\n\nFixes: c0bddd3a057f (\"net/tap: add link status notification\")\nCC: stable@dpdk.org\n\nSigned-off-by: Yunjian Wang <wangyunjian@huawei.com>\n---\n drivers/net/tap/rte_eth_tap.c | 27 ++++++++++++++++++++++-----\n 1 file changed, 22 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c\nindex 05470a211..6aa3d5cd3 100644\n--- a/drivers/net/tap/rte_eth_tap.c\n+++ b/drivers/net/tap/rte_eth_tap.c\n@@ -18,6 +18,7 @@\n #include <rte_string_fns.h>\n #include <rte_ethdev.h>\n #include <rte_errno.h>\n+#include <rte_cycles.h>\n \n #include <assert.h>\n #include <sys/types.h>\n@@ -1563,13 +1564,12 @@ static int\n tap_lsc_intr_handle_set(struct rte_eth_dev *dev, int set)\n {\n \tstruct pmd_internals *pmd = dev->data->dev_private;\n+\tint ret;\n \n \t/* In any case, disable interrupt if the conf is no longer there. */\n \tif (!dev->data->dev_conf.intr_conf.lsc) {\n \t\tif (pmd->intr_handle.fd != -1) {\n-\t\t\ttap_nl_final(pmd->intr_handle.fd);\n-\t\t\trte_intr_callback_unregister(&pmd->intr_handle,\n-\t\t\t\ttap_dev_intr_handler, dev);\n+\t\t\tgoto clean;\n \t\t}\n \t\treturn 0;\n \t}\n@@ -1580,9 +1580,26 @@ tap_lsc_intr_handle_set(struct rte_eth_dev *dev, int set)\n \t\treturn rte_intr_callback_register(\n \t\t\t&pmd->intr_handle, tap_dev_intr_handler, dev);\n \t}\n+\n+clean:\n+\tdo {\n+\t\tret = rte_intr_callback_unregister(&pmd->intr_handle,\n+\t\t\ttap_dev_intr_handler, dev);\n+\t\tif (ret >= 0) {\n+\t\t\tbreak;\n+\t\t} else if (ret == -EAGAIN) {\n+\t\t\trte_delay_ms(100);\n+\t\t} else {\n+\t\t\tTAP_LOG(ERR, \"intr callback unregister failed: %d\",\n+\t\t\t\t     ret);\n+\t\t\tbreak;\n+\t\t}\n+\t} while (true);\n+\n \ttap_nl_final(pmd->intr_handle.fd);\n-\treturn rte_intr_callback_unregister(&pmd->intr_handle,\n-\t\t\t\t\t    tap_dev_intr_handler, dev);\n+\tpmd->intr_handle.fd = -1;\n+\n+\treturn 0;\n }\n \n static int\n",
    "prefixes": []
}