get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 131162,
    "url": "http://patchwork.dpdk.org/api/patches/131162/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230904130123.40084-1-saurabhs@arista.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": "<20230904130123.40084-1-saurabhs@arista.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230904130123.40084-1-saurabhs@arista.com",
    "date": "2023-09-04T13:01:23",
    "name": "net/iavf: unregister intr handler before FD close",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "2a77bef7f247cde406340555f6d4e723e69c98ba",
    "submitter": {
        "id": 3174,
        "url": "http://patchwork.dpdk.org/api/people/3174/?format=api",
        "name": "Saurabh Singhal",
        "email": "saurabhs@arista.com"
    },
    "delegate": {
        "id": 1540,
        "url": "http://patchwork.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230904130123.40084-1-saurabhs@arista.com/mbox/",
    "series": [
        {
            "id": 29422,
            "url": "http://patchwork.dpdk.org/api/series/29422/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=29422",
            "date": "2023-09-04T13:01:23",
            "name": "net/iavf: unregister intr handler before FD close",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/29422/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/131162/comments/",
    "check": "fail",
    "checks": "http://patchwork.dpdk.org/api/patches/131162/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 C68A2424F1;\n\tMon,  4 Sep 2023 16:15:01 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id E6A6140697;\n\tMon,  4 Sep 2023 16:14:57 +0200 (CEST)",
            "from mail-pl1-f182.google.com (mail-pl1-f182.google.com\n [209.85.214.182])\n by mails.dpdk.org (Postfix) with ESMTP id 7F277400EF\n for <dev@dpdk.org>; Mon,  4 Sep 2023 15:01:32 +0200 (CEST)",
            "by mail-pl1-f182.google.com with SMTP id\n d9443c01a7336-1c0db66af1bso5343345ad.2\n for <dev@dpdk.org>; Mon, 04 Sep 2023 06:01:32 -0700 (PDT)",
            "from saurabhs-sfelagsubintfimpl-0.sjc.aristanetworks.com\n ([74.123.28.17]) by smtp.gmail.com with ESMTPSA id\n w1-20020a170902e88100b001b9d335223csm7564942plg.26.2023.09.04.06.01.30\n (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);\n Mon, 04 Sep 2023 06:01:30 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=arista.com; s=google; t=1693832491; x=1694437291; darn=dpdk.org;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=CmcIBUZP/RDGA/LbiZwrrmVFhodQNLsmfq7+EcYd0Bo=;\n b=ZnZTRUiuTWwjT/QYTFihjdAoeB3XiS4vJRBjn2qqDlx4dwBfkw8913nAwRD/sfrA93\n Hc4Ww1Vcuq/Ted8wAuTrJdZhmTtrVQqC+6yKD6oS62Bk6nFVCWIbAIAEMvHlapQJKM3v\n /EghWd8BMEPhyLLU5gXDxMHAaqHb0yW3FnUiUdlwTmkgajlTuB0Rj+gbJ6kRr7qm2CjD\n Ey+Rv388o2JXdrPT+yuMG+Z7qiwCEwEWvbhMKq1umdXowkMVwCpitqUY/1PMo0iNSpE3\n Esoxd0kYsdy2nJjYNC1zzIm0icV6JoGinbc4Qop8BnlgXHpfIGDXhHD4qrKp/dYq6TiG\n 0Qmw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20221208; t=1693832491; x=1694437291;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-message-state:from:to:cc:subject:date:message-id\n :reply-to;\n bh=CmcIBUZP/RDGA/LbiZwrrmVFhodQNLsmfq7+EcYd0Bo=;\n b=aJ5XPz+69tnOhs2sqbM+KJLO40at5nIf/vn9DYEzZCDeY849HZHkipOQcqhkQZskse\n MRFjuqGxtUyxvepGaGpdjAjwXXuuadSa1H0lslDDt8CgDQkWnqb8hebxfNP0fvhXL8g9\n T8/0/MQw+1q/SyRAJNGmfI4YYAw8zov2eqiuptZNCfR0FKBxXVd7rPqeWw3C0ziP0kXp\n jDwsMe28LlRaTNRwMz4+SM8Qq3NqkDmi3K4vT56PqNjQisXXYTr0PcCwHBDosz4MtcBf\n 2VV3z35cgqMrl+ymDkdFjmEVons+SxjKZsALhxdKI/Rxq7NtFOaosoOC+ks8ti5UyEDj\n 2UFA==",
        "X-Gm-Message-State": "AOJu0YyhB0Yw7tcvAMt2i4AAt77oN//TnrPUzLYWbiXc1HeuzzTUQVX1\n pXRR6UmT3rrwsmrSluwH/9uWyA==",
        "X-Google-Smtp-Source": "\n AGHT+IGQjGa5ZcybzRv5AlgjDIZNv5LhYS7Vjh5Js0wuQNXrgOSJwf/HjNVW3w1bvny0qDUKYtjF+Q==",
        "X-Received": "by 2002:a17:902:da86:b0:1c0:c7ae:a8a2 with SMTP id\n j6-20020a170902da8600b001c0c7aea8a2mr3969241plx.35.1693832491247;\n Mon, 04 Sep 2023 06:01:31 -0700 (PDT)",
        "From": "Saurabh Singhal <saurabhs@arista.com>",
        "To": "Thomas Monjalon <thomas@monjalon.net>,\n Jingjing Wu <jingjing.wu@intel.com>,\n Beilei Xing <beilei.xing@intel.com>",
        "Cc": "dev@dpdk.org,\n\tSaurabh Singhal <saurabhs@arista.com>",
        "Subject": "[PATCH] net/iavf: unregister intr handler before FD close",
        "Date": "Mon,  4 Sep 2023 06:01:23 -0700",
        "Message-ID": "<20230904130123.40084-1-saurabhs@arista.com>",
        "X-Mailer": "git-send-email 2.41.0",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Mailman-Approved-At": "Mon, 04 Sep 2023 16:14:55 +0200",
        "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"
    },
    "content": "Unregister VFIO interrupt handler before the interrupt fd gets closed in\ncase iavf_dev_init() returns an error.\n\ndpdk creates a standalone thread named eal-intr-thread for processing\ninterrupts for the PCI devices. The interrupt handler callbacks are\nregistered by the VF driver(iavf, in this case).\n\nWhen we do a PCI probe of the network interfaces, we register an\ninterrupt handler, open a vfio-device fd using ioctl, and an eventfd in\ndpdk. These interrupt sources are registered in a global linked list\nthat the eal-intr-thread keeps iterating over for handling the\ninterrupts. In our internal testing, we see eal-intr-thread crash in\nthese two ways:\n\nError adding fd 660 epoll_ctl, Operation not permitted\n\nor\n\nError adding fd 660 epoll_ctl, Bad file descriptor\n\nepoll_ctl() returns EPERM if the target fd does not support poll.\nIt returns EBADF when the epoll fd itself is closed or the target fd is\nclosed.\n\nWhen the first type of crash happens, we see that the fd 660 is\nanon_inode:[vfio-device] which does not support poll.\n\nWhen the second type of crash happens, we could see from the fd map of\nthe crashing process that the fd 660 was already closed.\n\nThis means the said fd has been closed and in certain cases may have\nbeen reassigned to a different device by the operating system but the\neal-intr-thread does not know about it.\n\nWe observed that these crashes were always accompanied by an error in\niavf_dev_init() after rte_intr_callback_register() and\niavf_enable_irq0() have already happened. In the error path, the\nintr_handle_fd was being closed but the interrupt handler wasn't being\nunregistered.\n\nThe fix is to unregister the interrupt handle in the\niavf_dev_init() error path.\n\nSigned-off-by: Saurabh Singhal <saurabhs@arista.com>\n---\n .mailmap                       |  1 +\n drivers/net/iavf/iavf_ethdev.c | 15 +++++++++++++++\n 2 files changed, 16 insertions(+)",
    "diff": "diff --git a/.mailmap b/.mailmap\nindex 864d33ee46..4dac53011b 100644\n--- a/.mailmap\n+++ b/.mailmap\n@@ -1227,6 +1227,7 @@ Satananda Burla <sburla@marvell.com>\n Satha Rao <skoteshwar@marvell.com> <skoteshwar@caviumnetworks.com>\n Satheesh Paul <psatheesh@marvell.com>\n Sathesh Edara <sedara@marvell.com>\n+Saurabh Singhal <saurabhs@arista.com>\n Savinay Dharmappa <savinay.dharmappa@intel.com>\n Scott Branden <scott.branden@broadcom.com>\n Scott Daniels <daniels@research.att.com>\ndiff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c\nindex f2fc5a5621..df87a553db 100644\n--- a/drivers/net/iavf/iavf_ethdev.c\n+++ b/drivers/net/iavf/iavf_ethdev.c\n@@ -133,6 +133,8 @@ static int iavf_dev_rx_queue_intr_enable(struct rte_eth_dev *dev,\n \t\t\t\t\tuint16_t queue_id);\n static int iavf_dev_rx_queue_intr_disable(struct rte_eth_dev *dev,\n \t\t\t\t\t uint16_t queue_id);\n+static void iavf_dev_interrupt_handler(void *param);\n+static inline void iavf_disable_irq0(struct iavf_hw *hw);\n static int iavf_dev_flow_ops_get(struct rte_eth_dev *dev,\n \t\t\t\t const struct rte_flow_ops **ops);\n static int iavf_set_mc_addr_list(struct rte_eth_dev *dev,\n@@ -2490,9 +2492,22 @@ iavf_uninit_vf(struct rte_eth_dev *dev)\n {\n \tstruct iavf_hw *hw = IAVF_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n \tstruct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);\n+\tstruct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);\n+\tstruct rte_intr_handle *intr_handle = pci_dev->intr_handle;\n \n \tiavf_shutdown_adminq(hw);\n \n+\tif (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR) {\n+\t\t/* disable uio intr before callback unregiser */\n+\t\trte_intr_disable(intr_handle);\n+\n+\t\t/* unregister callback func from eal lib */\n+\t\trte_intr_callback_unregister(intr_handle,\n+\t\t\t\t\t     iavf_dev_interrupt_handler, dev);\n+\t} else {\n+\t\trte_eal_alarm_cancel(iavf_dev_alarm_handler, dev);\n+\t}\n+\n \trte_free(vf->vf_res);\n \tvf->vsi_res = NULL;\n \tvf->vf_res = NULL;\n",
    "prefixes": []
}