get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 46890,
    "url": "http://patches.dpdk.org/api/patches/46890/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1539690153-133112-1-git-send-email-jia.guo@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": "<1539690153-133112-1-git-send-email-jia.guo@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1539690153-133112-1-git-send-email-jia.guo@intel.com",
    "date": "2018-10-16T11:42:33",
    "name": "[2/2] vfio: fix build issue",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "6483925096377de734c13371a669065271069605",
    "submitter": {
        "id": 507,
        "url": "http://patches.dpdk.org/api/people/507/?format=api",
        "name": "Guo, Jia",
        "email": "jia.guo@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1539690153-133112-1-git-send-email-jia.guo@intel.com/mbox/",
    "series": [
        {
            "id": 1920,
            "url": "http://patches.dpdk.org/api/series/1920/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1920",
            "date": "2018-10-16T11:41:00",
            "name": "[1/2] eal/bsd: fix FreeBSD build",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/1920/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/46890/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/46890/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 E08D15B2E;\n\tTue, 16 Oct 2018 13:39:33 +0200 (CEST)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id 7757B5B12\n\tfor <dev@dpdk.org>; Tue, 16 Oct 2018 13:39:32 +0200 (CEST)",
            "from orsmga007.jf.intel.com ([10.7.209.58])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t16 Oct 2018 04:39:31 -0700",
            "from jeffguo-s2600wt2.sh.intel.com (HELO localhost.localdomain)\n\t([10.67.110.10])\n\tby orsmga007.jf.intel.com with ESMTP; 16 Oct 2018 04:39:30 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.54,388,1534834800\"; d=\"scan'208\";a=\"81609265\"",
        "From": "Jeff Guo <jia.guo@intel.com>",
        "To": "anatoly.burakov@intel.com, ferruh.yigit@intel.com, thomas@monjalon.net",
        "Cc": "dev@dpdk.org,\n\tjia.guo@intel.com",
        "Date": "Tue, 16 Oct 2018 19:42:33 +0800",
        "Message-Id": "<1539690153-133112-1-git-send-email-jia.guo@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 2/2] vfio: fix build issue",
        "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": "Since the older kernel version do not implement the device request\ninterface for vfio, so when build on the kernel < v4.0.0, which is\nthe version begin to add the device request interface, it will\nthrow the error to show “VFIO_PCI_REQ_IRQ_INDEX” is undeclared.\nThis patch aim to fix this compile issue by add the macro\n“HAVE_VFIO_DEV_REQ_INTERFACE” after checking the kernel version.\n\nSigned-off-by: Jeff Guo <jia.guo@intel.com>\n---\n drivers/bus/pci/linux/pci_vfio.c             | 12 ++++++++++++\n drivers/bus/pci/pci_common.c                 |  2 ++\n lib/librte_eal/common/include/rte_vfio.h     |  3 +++\n lib/librte_eal/linuxapp/eal/eal_interrupts.c | 17 ++++++++++++-----\n 4 files changed, 29 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c\nindex 72d77bf..cc2387e 100644\n--- a/drivers/bus/pci/linux/pci_vfio.c\n+++ b/drivers/bus/pci/linux/pci_vfio.c\n@@ -279,6 +279,7 @@ pci_vfio_setup_interrupts(struct rte_pci_device *dev, int vfio_dev_fd)\n \treturn -1;\n }\n \n+#ifdef HAVE_VFIO_DEV_REQ_INTERFACE\n static void\n pci_vfio_req_handler(void *param)\n {\n@@ -384,6 +385,7 @@ pci_vfio_disable_notifier(struct rte_pci_device *dev)\n \n \treturn 0;\n }\n+#endif\n \n static int\n pci_vfio_is_ioport_bar(int vfio_dev_fd, int bar_index)\n@@ -625,7 +627,9 @@ pci_vfio_map_resource_primary(struct rte_pci_device *dev)\n \tstruct pci_map *maps;\n \n \tdev->intr_handle.fd = -1;\n+#ifdef HAVE_VFIO_DEV_REQ_INTERFACE\n \tdev->vfio_req_intr_handle.fd = -1;\n+#endif\n \n \t/* store PCI address string */\n \tsnprintf(pci_addr, sizeof(pci_addr), PCI_PRI_FMT,\n@@ -736,11 +740,13 @@ pci_vfio_map_resource_primary(struct rte_pci_device *dev)\n \t\tgoto err_vfio_res;\n \t}\n \n+#ifdef HAVE_VFIO_DEV_REQ_INTERFACE\n \tif (pci_vfio_enable_notifier(dev, vfio_dev_fd) != 0) {\n \t\tRTE_LOG(ERR, EAL, \"Error setting up notifier!\\n\");\n \t\tgoto err_vfio_res;\n \t}\n \n+#endif\n \tTAILQ_INSERT_TAIL(vfio_res_list, vfio_res, next);\n \n \treturn 0;\n@@ -766,7 +772,9 @@ pci_vfio_map_resource_secondary(struct rte_pci_device *dev)\n \tstruct pci_map *maps;\n \n \tdev->intr_handle.fd = -1;\n+#ifdef HAVE_VFIO_DEV_REQ_INTERFACE\n \tdev->vfio_req_intr_handle.fd = -1;\n+#endif\n \n \t/* store PCI address string */\n \tsnprintf(pci_addr, sizeof(pci_addr), PCI_PRI_FMT,\n@@ -807,7 +815,9 @@ pci_vfio_map_resource_secondary(struct rte_pci_device *dev)\n \n \t/* we need save vfio_dev_fd, so it can be used during release */\n \tdev->intr_handle.vfio_dev_fd = vfio_dev_fd;\n+#ifdef HAVE_VFIO_DEV_REQ_INTERFACE\n \tdev->vfio_req_intr_handle.vfio_dev_fd = vfio_dev_fd;\n+#endif\n \n \treturn 0;\n err_vfio_dev_fd:\n@@ -880,12 +890,14 @@ pci_vfio_unmap_resource_primary(struct rte_pci_device *dev)\n \tsnprintf(pci_addr, sizeof(pci_addr), PCI_PRI_FMT,\n \t\t\tloc->domain, loc->bus, loc->devid, loc->function);\n \n+#ifdef HAVE_VFIO_DEV_REQ_INTERFACE\n \tret = pci_vfio_disable_notifier(dev);\n \tif (ret) {\n \t\tRTE_LOG(ERR, EAL, \"fail to disable req notifier.\\n\");\n \t\treturn -1;\n \t}\n \n+#endif\n \tif (close(dev->intr_handle.fd) < 0) {\n \t\tRTE_LOG(INFO, EAL, \"Error when closing eventfd file descriptor for %s\\n\",\n \t\t\tpci_addr);\ndiff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c\nindex 5085c34..4b3749a 100644\n--- a/drivers/bus/pci/pci_common.c\n+++ b/drivers/bus/pci/pci_common.c\n@@ -444,6 +444,7 @@ pci_hot_unplug_handler(struct rte_device *dev)\n \t\treturn -1;\n \n \tswitch (pdev->kdrv) {\n+#ifdef HAVE_VFIO_DEV_REQ_INTERFACE\n \tcase RTE_KDRV_VFIO:\n \t\t/*\n \t\t * vfio kernel module guaranty the pci device would not be\n@@ -454,6 +455,7 @@ pci_hot_unplug_handler(struct rte_device *dev)\n \t\trte_dev_event_callback_process(dev->name,\n \t\t\t\t\t       RTE_DEV_EVENT_REMOVE);\n \t\tbreak;\n+#endif\n \tcase RTE_KDRV_IGB_UIO:\n \tcase RTE_KDRV_UIO_GENERIC:\n \tcase RTE_KDRV_NIC_UIO:\ndiff --git a/lib/librte_eal/common/include/rte_vfio.h b/lib/librte_eal/common/include/rte_vfio.h\nindex f6617e0..7d66438 100644\n--- a/lib/librte_eal/common/include/rte_vfio.h\n+++ b/lib/librte_eal/common/include/rte_vfio.h\n@@ -24,6 +24,9 @@ extern \"C\" {\n #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)\n #define VFIO_PRESENT\n #endif /* kernel version >= 3.6.0 */\n+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)\n+#define HAVE_VFIO_DEV_REQ_INTERFACE\n+#endif /* kernel version >= 4.0.0 */\n #endif /* RTE_EAL_VFIO */\n \n #ifdef VFIO_PRESENT\ndiff --git a/lib/librte_eal/linuxapp/eal/eal_interrupts.c b/lib/librte_eal/linuxapp/eal/eal_interrupts.c\nindex 7f611b3..767b508 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_interrupts.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_interrupts.c\n@@ -309,6 +309,7 @@ vfio_disable_msix(const struct rte_intr_handle *intr_handle) {\n \treturn ret;\n }\n \n+#ifdef HAVE_VFIO_DEV_REQ_INTERFACE\n /* enable req notifier */\n static int\n vfio_enable_req(const struct rte_intr_handle *intr_handle)\n@@ -367,6 +368,7 @@ vfio_disable_req(const struct rte_intr_handle *intr_handle)\n \treturn ret;\n }\n #endif\n+#endif\n \n static int\n uio_intx_intr_disable(const struct rte_intr_handle *intr_handle)\n@@ -614,11 +616,13 @@ rte_intr_enable(const struct rte_intr_handle *intr_handle)\n \t\tif (vfio_enable_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\tif (vfio_enable_req(intr_handle))\n \t\t\treturn -1;\n \t\tbreak;\n #endif\n+#endif\n \t/* not used at this moment */\n \tcase RTE_INTR_HANDLE_DEV_EVENT:\n \t\treturn -1;\n@@ -668,11 +672,12 @@ rte_intr_disable(const struct rte_intr_handle *intr_handle)\n \t\tif (vfio_disable_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\tif (vfio_disable_req(intr_handle))\n \t\t\treturn -1;\n \t\tbreak;\n-\n+#endif\n #endif\n \t/* not used at this moment */\n \tcase RTE_INTR_HANDLE_DEV_EVENT:\n@@ -739,6 +744,12 @@ eal_intr_process_interrupts(struct epoll_event *events, int nfds)\n \t\tcase RTE_INTR_HANDLE_VFIO_LEGACY:\n \t\t\tbytes_read = sizeof(buf.vfio_intr_count);\n \t\t\tbreak;\n+#ifdef HAVE_VFIO_DEV_REQ_INTERFACE\n+\t\tcase RTE_INTR_HANDLE_VFIO_REQ:\n+\t\t\tbytes_read = 0;\n+\t\t\tcall = true;\n+\t\t\tbreak;\n+#endif\n #endif\n \t\tcase RTE_INTR_HANDLE_VDEV:\n \t\tcase RTE_INTR_HANDLE_EXT:\n@@ -749,10 +760,6 @@ eal_intr_process_interrupts(struct epoll_event *events, int nfds)\n \t\t\tbytes_read = 0;\n \t\t\tcall = true;\n \t\t\tbreak;\n-\t\tcase RTE_INTR_HANDLE_VFIO_REQ:\n-\t\t\tbytes_read = 0;\n-\t\t\tcall = true;\n-\t\t\tbreak;\n \t\tdefault:\n \t\t\tbytes_read = 1;\n \t\t\tbreak;\n",
    "prefixes": [
        "2/2"
    ]
}