get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 9848,
    "url": "https://patches.dpdk.org/api/patches/9848/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1452757372-686-7-git-send-email-yuanhan.liu@linux.intel.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<1452757372-686-7-git-send-email-yuanhan.liu@linux.intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1452757372-686-7-git-send-email-yuanhan.liu@linux.intel.com",
    "date": "2016-01-14T07:42:50",
    "name": "[dpdk-dev,v3,6/8] eal: pci: export pci_[un]map_device",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "fe7584d9c605adf4ed965b05d2d1ac7a3eb9c667",
    "submitter": {
        "id": 307,
        "url": "https://patches.dpdk.org/api/people/307/?format=api",
        "name": "Yuanhan Liu",
        "email": "yuanhan.liu@linux.intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1452757372-686-7-git-send-email-yuanhan.liu@linux.intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/9848/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/9848/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 718FE9190;\n\tThu, 14 Jan 2016 08:41:49 +0100 (CET)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id A4ED68E83\n\tfor <dev@dpdk.org>; Thu, 14 Jan 2016 08:41:43 +0100 (CET)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby orsmga102.jf.intel.com with ESMTP; 13 Jan 2016 23:41:43 -0800",
            "from yliu-dev.sh.intel.com ([10.239.66.49])\n\tby FMSMGA003.fm.intel.com with ESMTP; 13 Jan 2016 23:41:42 -0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.22,293,1449561600\"; d=\"scan'208\";a=\"633215319\"",
        "From": "Yuanhan Liu <yuanhan.liu@linux.intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Thu, 14 Jan 2016 15:42:50 +0800",
        "Message-Id": "<1452757372-686-7-git-send-email-yuanhan.liu@linux.intel.com>",
        "X-Mailer": "git-send-email 1.9.0",
        "In-Reply-To": "<1452757372-686-1-git-send-email-yuanhan.liu@linux.intel.com>",
        "References": "<1452581944-24838-1-git-send-email-yuanhan.liu@linux.intel.com>\n\t<1452757372-686-1-git-send-email-yuanhan.liu@linux.intel.com>",
        "Cc": "\"Michael S. Tsirkin\" <mst@redhat.com>",
        "Subject": "[dpdk-dev] [PATCH v3 6/8] eal: pci: export pci_[un]map_device",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Normally we could set RTE_PCI_DRV_NEED_MAPPING flag so that eal will\ninvoke pci_map_device internally for us. From that point view, there\nis no need to export pci_map_device.\n\nHowever, for virtio pmd driver, which is designed to work without\nbinding UIO (or something similar first), pci_map_device() will fail,\nwhich ends up with virtio pmd driver being skipped. Therefore, we can\nnot set RTE_PCI_DRV_NEED_MAPPING blindly at virtio pmd driver.\n\nTherefore, this patch exports pci_map_device, and let virtio pmd\ncall it when necessary.\n\nCc: David Marchand <david.marchand@6wind.com>\nSigned-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>\n---\nv3: - export pci_unmap_device as well\n\n    - Add few more comments about rte_eal_pci_map_device().\n---\n lib/librte_eal/bsdapp/eal/eal_pci.c             |  4 ++--\n lib/librte_eal/bsdapp/eal/rte_eal_version.map   |  7 +++++++\n lib/librte_eal/common/eal_common_pci.c          |  4 ++--\n lib/librte_eal/common/eal_private.h             | 18 -----------------\n lib/librte_eal/common/include/rte_pci.h         | 27 +++++++++++++++++++++++++\n lib/librte_eal/linuxapp/eal/eal_pci.c           |  4 ++--\n lib/librte_eal/linuxapp/eal/rte_eal_version.map |  7 +++++++\n 7 files changed, 47 insertions(+), 24 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/bsdapp/eal/eal_pci.c b/lib/librte_eal/bsdapp/eal/eal_pci.c\nindex 6c21fbd..95c32c1 100644\n--- a/lib/librte_eal/bsdapp/eal/eal_pci.c\n+++ b/lib/librte_eal/bsdapp/eal/eal_pci.c\n@@ -93,7 +93,7 @@ pci_unbind_kernel_driver(struct rte_pci_device *dev __rte_unused)\n \n /* Map pci device */\n int\n-pci_map_device(struct rte_pci_device *dev)\n+rte_eal_pci_map_device(struct rte_pci_device *dev)\n {\n \tint ret = -1;\n \n@@ -115,7 +115,7 @@ pci_map_device(struct rte_pci_device *dev)\n \n /* Unmap pci device */\n void\n-pci_unmap_device(struct rte_pci_device *dev)\n+rte_eal_pci_unmap_device(struct rte_pci_device *dev)\n {\n \t/* try unmapping the NIC resources */\n \tswitch (dev->kdrv) {\ndiff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map\nindex 9d7adf1..1b28170 100644\n--- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map\n+++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map\n@@ -135,3 +135,10 @@ DPDK_2.2 {\n \trte_xen_dom0_supported;\n \n } DPDK_2.1;\n+\n+DPDK_2.3 {\n+\tglobal:\n+\n+\trte_eal_pci_map_device;\n+\trte_eal_pci_unmap_device;\n+} DPDK_2.2;\ndiff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c\nindex dcfe947..96d5113 100644\n--- a/lib/librte_eal/common/eal_common_pci.c\n+++ b/lib/librte_eal/common/eal_common_pci.c\n@@ -188,7 +188,7 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *d\n \t\t\tpci_config_space_set(dev);\n #endif\n \t\t\t/* map resources for devices that use igb_uio */\n-\t\t\tret = pci_map_device(dev);\n+\t\t\tret = rte_eal_pci_map_device(dev);\n \t\t\tif (ret != 0)\n \t\t\t\treturn ret;\n \t\t} else if (dr->drv_flags & RTE_PCI_DRV_FORCE_UNBIND &&\n@@ -254,7 +254,7 @@ rte_eal_pci_detach_dev(struct rte_pci_driver *dr,\n \n \t\tif (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING)\n \t\t\t/* unmap resources for devices that use igb_uio */\n-\t\t\tpci_unmap_device(dev);\n+\t\t\trte_eal_pci_unmap_device(dev);\n \n \t\treturn 0;\n \t}\ndiff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/eal_private.h\nindex 072e672..2342fa1 100644\n--- a/lib/librte_eal/common/eal_private.h\n+++ b/lib/librte_eal/common/eal_private.h\n@@ -165,24 +165,6 @@ struct rte_pci_device;\n int pci_unbind_kernel_driver(struct rte_pci_device *dev);\n \n /**\n- * Map this device\n- *\n- * This function is private to EAL.\n- *\n- * @return\n- *   0 on success, negative on error and positive if no driver\n- *   is found for the device.\n- */\n-int pci_map_device(struct rte_pci_device *dev);\n-\n-/**\n- * Unmap this device\n- *\n- * This function is private to EAL.\n- */\n-void pci_unmap_device(struct rte_pci_device *dev);\n-\n-/**\n  * Map the PCI resource of a PCI device in virtual memory\n  *\n  * This function is private to EAL.\ndiff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h\nindex 334c12e..2224109 100644\n--- a/lib/librte_eal/common/include/rte_pci.h\n+++ b/lib/librte_eal/common/include/rte_pci.h\n@@ -485,6 +485,33 @@ int rte_eal_pci_read_config(const struct rte_pci_device *device,\n  */\n int rte_eal_pci_write_config(const struct rte_pci_device *device,\n \t\t\t     const void *buf, size_t len, off_t offset);\n+/**\n+ * Map the PCI device resources in user space virtual memory address\n+ *\n+ * Note that driver should not call this function when flag\n+ * RTE_PCI_DRV_NEED_MAPPING is set, as EAL will do that for\n+ * you when it's on.\n+ *\n+ * @param dev\n+ *   A pointer to a rte_pci_device structure describing the device\n+ *   to use\n+ *\n+ * @return\n+ *   0 on success, negative on error and positive if no driver\n+ *   is found for the device.\n+ */\n+int rte_eal_pci_map_device(struct rte_pci_device *dev);\n+\n+/**\n+ * Unmap this device\n+ *\n+ * @param dev\n+ *   A pointer to a rte_pci_device structure describing the device\n+ *   to use\n+ */\n+void rte_eal_pci_unmap_device(struct rte_pci_device *dev);\n+\n+\n \n #ifdef RTE_PCI_CONFIG\n /**\ndiff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c\nindex bc5b5be..db947da 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_pci.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c\n@@ -124,7 +124,7 @@ pci_get_kernel_driver_by_path(const char *filename, char *dri_name)\n \n /* Map pci device */\n int\n-pci_map_device(struct rte_pci_device *dev)\n+rte_eal_pci_map_device(struct rte_pci_device *dev)\n {\n \tint ret = -1;\n \n@@ -153,7 +153,7 @@ pci_map_device(struct rte_pci_device *dev)\n \n /* Unmap pci device */\n void\n-pci_unmap_device(struct rte_pci_device *dev)\n+rte_eal_pci_unmap_device(struct rte_pci_device *dev)\n {\n \t/* try unmapping the NIC resources using VFIO if it exists */\n \tswitch (dev->kdrv) {\ndiff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map\nindex cbe175f..b9937c4 100644\n--- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map\n+++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map\n@@ -138,3 +138,10 @@ DPDK_2.2 {\n \trte_xen_dom0_supported;\n \n } DPDK_2.1;\n+\n+DPDK_2.3 {\n+\tglobal:\n+\n+\trte_eal_pci_map_device;\n+\trte_eal_pci_unmap_device;\n+} DPDK_2.2;\n",
    "prefixes": [
        "dpdk-dev",
        "v3",
        "6/8"
    ]
}