get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 56471,
    "url": "http://patches.dpdk.org/api/patches/56471/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190716064631.135115-1-ndabilpuram@marvell.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": "<20190716064631.135115-1-ndabilpuram@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190716064631.135115-1-ndabilpuram@marvell.com",
    "date": "2019-07-16T06:46:31",
    "name": "[RFC] eal: add mask and unmask interrupt apis",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e607941afeabd6fc2c5ecff82938a0b10f4d0e9e",
    "submitter": {
        "id": 1202,
        "url": "http://patches.dpdk.org/api/people/1202/?format=api",
        "name": "Nithin Dabilpuram",
        "email": "ndabilpuram@marvell.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/20190716064631.135115-1-ndabilpuram@marvell.com/mbox/",
    "series": [
        {
            "id": 5511,
            "url": "http://patches.dpdk.org/api/series/5511/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=5511",
            "date": "2019-07-16T06:46:31",
            "name": "[RFC] eal: add mask and unmask interrupt apis",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/5511/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/56471/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/56471/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 B7A7D2BD5;\n\tTue, 16 Jul 2019 08:46:46 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n\t[67.231.148.174]) by dpdk.org (Postfix) with ESMTP id CF4FA1B53\n\tfor <dev@dpdk.org>; Tue, 16 Jul 2019 08:46:44 +0200 (CEST)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n\tby mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id\n\tx6G6jZcj015459; Mon, 15 Jul 2019 23:46:42 -0700",
            "from sc-exch02.marvell.com ([199.233.58.182])\n\tby mx0a-0016f401.pphosted.com with ESMTP id 2ts07v9yns-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); \n\tMon, 15 Jul 2019 23:46:42 -0700",
            "from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH02.marvell.com\n\t(10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3;\n\tMon, 15 Jul 2019 23:46:41 -0700",
            "from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com\n\t(10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend\n\tTransport; Mon, 15 Jul 2019 23:46:41 -0700",
            "from hyd1588t430.marvell.com (unknown [10.29.52.204])\n\tby maili.marvell.com (Postfix) with ESMTP id 29DE33F703F;\n\tMon, 15 Jul 2019 23:46:37 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n\th=from : to : cc :\n\tsubject : date : message-id : in-reply-to : references : mime-version\n\t: content-type; s=pfpt0818;\n\tbh=B/PhbU7EbRy+g1TLOT4TtKXjrJwuWyWqu3a+jY+TOUw=; \n\tb=ncpcnN0FX/DcyhLzbhfdjDe76UIoiYBLCtLofjih92YacS7z26hao3qcCG5h4PqqjNq+\n\tlN/RH32n19MeMpbtpFQNx51zjZo87TsjP0nx6o8w70L0xQkKoQUhwvUYu2/CnekVNLOO\n\tVyOGe4obeRFOPezHtPAx7QrlDVoCPqqapEbfTpvAwjTQZZOCfnHNKQgplp8rRCBtm6fu\n\tIYiIlA4otEZMRmHiEbWVKYw/ZeTpbM9D+T6Rqu6lpGJWOiNbhFR7/cG9LrYkx1rm8Mb5\n\t11KZ7zJBq0XWA3QRfM1hOhqnqhvmNwyjly7tFw6UPKtXVIKRX4neXzRWji17zD2LFLBD\n\tUw== ",
        "From": "Nithin Dabilpuram <ndabilpuram@marvell.com>",
        "To": "Hyong Youb Kim <hyonkim@cisco.com>, David Marchand\n\t<david.marchand@redhat.com>, Thomas Monjalon <thomas@monjalon.net>,\n\t\"Ferruh Yigit\" <ferruh.yigit@intel.com>",
        "CC": "<jerinj@marvell.com>, John Daley <johndale@cisco.com>, Shahed Shaikh\n\t<shshaikh@marvell.com>, <dev@dpdk.org>, Nithin Dabilpuram\n\t<ndabilpuram@marvell.com>",
        "Date": "Tue, 16 Jul 2019 12:16:31 +0530",
        "Message-ID": "<20190716064631.135115-1-ndabilpuram@marvell.com>",
        "X-Mailer": "git-send-email 2.8.4",
        "In-Reply-To": "<BYAPR18MB24241C91FEA95541CE94FFABC8CF0@BYAPR18MB2424.namprd18.prod.outlook.com>",
        "References": "<BYAPR18MB24241C91FEA95541CE94FFABC8CF0@BYAPR18MB2424.namprd18.prod.outlook.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:5.22.84,1.0.8\n\tdefinitions=2019-07-16_02:2019-07-16,2019-07-16 signatures=0",
        "Subject": "[dpdk-dev] [RFC PATCH] eal: add mask and unmask interrupt apis",
        "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": "Add new mask and unmask interrupt api's specifically for\nVFIO_LEGACY type of interrupts. For legacy/intx vfio-pci masks the\ninterrupt before posting the event and application has to unmask it\nas a part of its interrupt handling. Hence these new api's can be used\nfor the light-weight operation of masking and unmasking.\n\nIn all the other VFIO interrupts i.e MSI & MSIx, vfio-pci doesn't\ndo anything like that and there is also no implementation for\nmasking and unmasking.\n---\n lib/librte_eal/common/include/rte_interrupts.h |  23 ++++\n lib/librte_eal/linux/eal/eal_interrupts.c      | 155 +++++++++++++++++++++++++\n 2 files changed, 178 insertions(+)",
    "diff": "diff --git a/lib/librte_eal/common/include/rte_interrupts.h b/lib/librte_eal/common/include/rte_interrupts.h\nindex c1e912c..b0675be 100644\n--- a/lib/librte_eal/common/include/rte_interrupts.h\n+++ b/lib/librte_eal/common/include/rte_interrupts.h\n@@ -118,6 +118,29 @@ int rte_intr_enable(const struct rte_intr_handle *intr_handle);\n  */\n int rte_intr_disable(const struct rte_intr_handle *intr_handle);\n \n+/**\n+ * It masks the interrupt for the specified handle.\n+ *\n+ * @param intr_handle\n+ *  pointer to the interrupt handle.\n+ *\n+ * @return\n+ *  - On success, zero.\n+ *  - On failure, a negative value.\n+ */\n+int rte_intr_mask(const struct rte_intr_handle *intr_handle);\n+\n+/**\n+ * It unmasks the interrupt for the specified handle.\n+ *\n+ * @param intr_handle\n+ *  pointer to the interrupt handle.\n+ *\n+ * @return\n+ *  - On success, zero.\n+ *  - On failure, a negative value.\n+ */\n+int rte_intr_unmask(const struct rte_intr_handle *intr_handle);\n #ifdef __cplusplus\n }\n #endif\ndiff --git a/lib/librte_eal/linux/eal/eal_interrupts.c b/lib/librte_eal/linux/eal/eal_interrupts.c\nindex 79ad5e8..d91022c 100644\n--- a/lib/librte_eal/linux/eal/eal_interrupts.c\n+++ b/lib/librte_eal/linux/eal/eal_interrupts.c\n@@ -197,6 +197,63 @@ vfio_disable_intx(const struct rte_intr_handle *intr_handle) {\n \treturn 0;\n }\n \n+/* unmask legacy (INTx) interrupts */\n+static int\n+vfio_unmask_intx(const struct rte_intr_handle *intr_handle)\n+{\n+\tstruct vfio_irq_set *irq_set;\n+\tchar irq_set_buf[IRQ_SET_BUF_LEN];\n+\tint len, ret;\n+\n+\tlen = sizeof(struct vfio_irq_set);\n+\n+\t/* unmask INTx */\n+\tirq_set = (struct vfio_irq_set *) irq_set_buf;\n+\tmemset(irq_set, 0, len);\n+\tirq_set->argsz = len;\n+\tirq_set->count = 1;\n+\tirq_set->flags = VFIO_IRQ_SET_DATA_NONE | VFIO_IRQ_SET_ACTION_UNMASK;\n+\tirq_set->index = VFIO_PCI_INTX_IRQ_INDEX;\n+\tirq_set->start = 0;\n+\n+\tret = ioctl(intr_handle->vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);\n+\n+\tif (ret) {\n+\t\tRTE_LOG(ERR, EAL, \"Error unmasking INTx interrupts for fd %d\\n\",\n+\t\t\tintr_handle->fd);\n+\t\treturn -1;\n+\t}\n+\treturn 0;\n+}\n+\n+/* mask legacy (INTx) interrupts */\n+static int\n+vfio_mask_intx(const struct rte_intr_handle *intr_handle)\n+{\n+\tstruct vfio_irq_set *irq_set;\n+\tchar irq_set_buf[IRQ_SET_BUF_LEN];\n+\tint len, ret;\n+\n+\tlen = sizeof(struct vfio_irq_set);\n+\n+\t/* mask interrupts */\n+\tirq_set = (struct vfio_irq_set *) irq_set_buf;\n+\tirq_set->argsz = len;\n+\tirq_set->count = 1;\n+\tirq_set->flags = VFIO_IRQ_SET_DATA_NONE | VFIO_IRQ_SET_ACTION_MASK;\n+\tirq_set->index = VFIO_PCI_INTX_IRQ_INDEX;\n+\tirq_set->start = 0;\n+\n+\tret = ioctl(intr_handle->vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);\n+\n+\tif (ret) {\n+\t\tRTE_LOG(ERR, EAL, \"Error masking INTx interrupts for fd %d\\n\",\n+\t\t\tintr_handle->fd);\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n /* enable MSI interrupts */\n static int\n vfio_enable_msi(const struct rte_intr_handle *intr_handle) {\n@@ -694,6 +751,104 @@ rte_intr_enable(const struct rte_intr_handle *intr_handle)\n }\n \n int\n+rte_intr_mask(const struct rte_intr_handle *intr_handle)\n+{\n+\tif (intr_handle && intr_handle->type == RTE_INTR_HANDLE_VDEV)\n+\t\treturn 0;\n+\n+\tif (!intr_handle || intr_handle->fd < 0 || intr_handle->uio_cfg_fd < 0)\n+\t\treturn -1;\n+\n+\tswitch (intr_handle->type){\n+\t/* Both masking and disabling are same for UIO */\n+\tcase RTE_INTR_HANDLE_UIO:\n+\t\tif (uio_intr_disable(intr_handle))\n+\t\t\treturn -1;\n+\t\tbreak;\n+\tcase RTE_INTR_HANDLE_UIO_INTX:\n+\t\tif (uio_intx_intr_disable(intr_handle))\n+\t\t\treturn -1;\n+\t\tbreak;\n+\t/* not used at this moment */\n+\tcase RTE_INTR_HANDLE_ALARM:\n+\t\treturn -1;\n+#ifdef VFIO_PRESENT\n+\tcase RTE_INTR_HANDLE_VFIO_MSIX:\n+\tcase RTE_INTR_HANDLE_VFIO_MSI:\n+\t\treturn -1;\n+\tcase RTE_INTR_HANDLE_VFIO_LEGACY:\n+\t\tif (vfio_mask_intx(intr_handle))\n+\t\t\treturn -1;\n+\t\tbreak;\n+#ifdef HAVE_VFIO_DEV_REQ_INTERFACE\n+\tcase RTE_INTR_HANDLE_VFIO_REQ:\n+\t\treturn -1;\n+#endif\n+#endif\n+\t/* not used at this moment */\n+\tcase RTE_INTR_HANDLE_DEV_EVENT:\n+\t\treturn -1;\n+\t/* unknown handle type */\n+\tdefault:\n+\t\tRTE_LOG(ERR, EAL,\n+\t\t\t\"Unknown handle type of fd %d\\n\",\n+\t\t\t\t\tintr_handle->fd);\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+int\n+rte_intr_unmask(const struct rte_intr_handle *intr_handle)\n+{\n+\tif (intr_handle && intr_handle->type == RTE_INTR_HANDLE_VDEV)\n+\t\treturn 0;\n+\n+\tif (!intr_handle || intr_handle->fd < 0 || intr_handle->uio_cfg_fd < 0)\n+\t\treturn -1;\n+\n+\tswitch (intr_handle->type){\n+\t/* Both unmasking and disabling are same for UIO */\n+\tcase RTE_INTR_HANDLE_UIO:\n+\t\tif (uio_intr_enable(intr_handle))\n+\t\t\treturn -1;\n+\t\tbreak;\n+\tcase RTE_INTR_HANDLE_UIO_INTX:\n+\t\tif (uio_intx_intr_enable(intr_handle))\n+\t\t\treturn -1;\n+\t\tbreak;\n+\t/* not used at this moment */\n+\tcase RTE_INTR_HANDLE_ALARM:\n+\t\treturn -1;\n+#ifdef VFIO_PRESENT\n+\tcase RTE_INTR_HANDLE_VFIO_MSIX:\n+\tcase RTE_INTR_HANDLE_VFIO_MSI:\n+\t\treturn -1;\n+\tcase RTE_INTR_HANDLE_VFIO_LEGACY:\n+\t\tif (vfio_unmask_intx(intr_handle))\n+\t\t\treturn -1;\n+\t\tbreak;\n+#ifdef HAVE_VFIO_DEV_REQ_INTERFACE\n+\tcase RTE_INTR_HANDLE_VFIO_REQ:\n+\t\treturn -1;\n+#endif\n+#endif\n+\t/* not used at this moment */\n+\tcase RTE_INTR_HANDLE_DEV_EVENT:\n+\t\treturn -1;\n+\t/* unknown handle type */\n+\tdefault:\n+\t\tRTE_LOG(ERR, EAL,\n+\t\t\t\"Unknown handle type of fd %d\\n\",\n+\t\t\t\t\tintr_handle->fd);\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+int\n rte_intr_disable(const struct rte_intr_handle *intr_handle)\n {\n \tif (intr_handle && intr_handle->type == RTE_INTR_HANDLE_VDEV)\n",
    "prefixes": [
        "RFC"
    ]
}