Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/5962/?format=api
https://patches.dpdk.org/api/patches/5962/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1435652668-3380-12-git-send-email-mukawa@igel.co.jp/", "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": "<1435652668-3380-12-git-send-email-mukawa@igel.co.jp>", "list_archive_url": "https://inbox.dpdk.org/dev/1435652668-3380-12-git-send-email-mukawa@igel.co.jp", "date": "2015-06-30T08:24:27", "name": "[dpdk-dev,v7,11/12] eal: Consolidate pci_map/unmap_device() of linuxapp and bsdapp", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "18ad65208aaaa101b8dbaac805e2c0078b311aa5", "submitter": { "id": 64, "url": "https://patches.dpdk.org/api/people/64/?format=api", "name": "Tetsuya Mukawa", "email": "mukawa@igel.co.jp" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1435652668-3380-12-git-send-email-mukawa@igel.co.jp/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/5962/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/5962/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 56BB8C4C6;\n\tTue, 30 Jun 2015 10:25:39 +0200 (CEST)", "from mail-pd0-f178.google.com (mail-pd0-f178.google.com\n\t[209.85.192.178]) by dpdk.org (Postfix) with ESMTP id 15AF1C406\n\tfor <dev@dpdk.org>; Tue, 30 Jun 2015 10:25:33 +0200 (CEST)", "by pdcu2 with SMTP id u2so2161479pdc.3\n\tfor <dev@dpdk.org>; Tue, 30 Jun 2015 01:25:32 -0700 (PDT)", "from localhost.localdomain (napt.igel.co.jp. [219.106.231.132])\n\tby mx.google.com with ESMTPSA id\n\tk9sm44733339pdp.60.2015.06.30.01.25.30\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tTue, 30 Jun 2015 01:25:31 -0700 (PDT)" ], "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=0QeWQnjxFN97V6YO1Jerq69flgbskOVs97TokTnisik=;\n\tb=d25vYFUS+j4SGalZGiJGmKHV0Y3wBp+onUplakzNkO3XU3ZIehzdoZnqGbZ4aZ2Dm0\n\tB1aeHO3Sf50+wRZOa5pwtB7IQAzUMUzREQ4yIJxetT9i1lbQdXKup9QysA/TL9oRmJ5d\n\tjD6Wf7wTw9KqNVSUq48s9GkdtmqenFl58S879Euv9AdjfCg+U1DHKlC4JRruPTil+sCP\n\txgscnHj6ARKUdBYa6qtjcup6QtMcjDcjysaccpBHSexZ1KkM7Eqp7WvhBWkzapHYo91/\n\tNsUKZTPNZWvdpb5NmTtuqYEF/pDYu1LTUo1GtEKlGer5R2vxI4m9HqC8ZtTRAVqzTtRY\n\tTplA==", "X-Gm-Message-State": "ALoCoQl+1wdidCPMj/JEYmIqLcCjq4f9xU70g6p0JcmgIhIvaDvwMRMooHkkY8AhMGRONyv4n9Yv", "X-Received": "by 10.66.142.199 with SMTP id ry7mr41130002pab.14.1435652732495; \n\tTue, 30 Jun 2015 01:25:32 -0700 (PDT)", "From": "Tetsuya Mukawa <mukawa@igel.co.jp>", "To": "dev@dpdk.org", "Date": "Tue, 30 Jun 2015 17:24:27 +0900", "Message-Id": "<1435652668-3380-12-git-send-email-mukawa@igel.co.jp>", "X-Mailer": "git-send-email 2.1.4", "In-Reply-To": "<1435652668-3380-1-git-send-email-mukawa@igel.co.jp>", "References": "<1435306705-11645-4-git-send-email-mukawa@igel.co.jp>\n\t<1435652668-3380-1-git-send-email-mukawa@igel.co.jp>", "Subject": "[dpdk-dev] [PATCH v7 11/12] eal: Consolidate pci_map/unmap_device()\n\tof linuxapp and bsdapp", "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": "From: \"Tetsuya.Mukawa\" <mukawa@igel.co.jp>\n\nThe patch consolidates below functions, and implemented in common\neal code.\n - pci_map_device()\n - pci_unmap_device()\n\nSigned-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>\n---\n lib/librte_eal/bsdapp/eal/eal_pci.c | 3 ++\n lib/librte_eal/common/eal_common_pci.c | 57 +++++++++++++++++++++++++++++++++\n lib/librte_eal/common/eal_private.h | 19 +++++++++++\n lib/librte_eal/common/include/rte_pci.h | 1 +\n lib/librte_eal/linuxapp/eal/eal_pci.c | 53 ------------------------------\n lib/librte_ether/rte_ethdev.c | 1 +\n 6 files changed, 81 insertions(+), 53 deletions(-)", "diff": "diff --git a/lib/librte_eal/bsdapp/eal/eal_pci.c b/lib/librte_eal/bsdapp/eal/eal_pci.c\nindex 329c268..c057f6a 100644\n--- a/lib/librte_eal/bsdapp/eal/eal_pci.c\n+++ b/lib/librte_eal/bsdapp/eal/eal_pci.c\n@@ -238,6 +238,9 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf)\n \t/* FreeBSD has no NUMA support (yet) */\n \tdev->numa_node = 0;\n \n+\t/* FreeBSD has only one pass through driver */\n+\tdev->kdrv = RTE_KDRV_NIC_UIO;\n+\n \t/* parse resources */\n \tswitch (conf->pc_hdr & PCIM_HDRTYPE) {\n \tcase PCIM_HDRTYPE_NORMAL:\ndiff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c\nindex 81b8fd6..c0be292 100644\n--- a/lib/librte_eal/common/eal_common_pci.c\n+++ b/lib/librte_eal/common/eal_common_pci.c\n@@ -137,6 +137,63 @@ pci_unmap_resource(void *requested_addr, size_t size)\n \t\t\t\trequested_addr);\n }\n \n+/* Map pci device */\n+int\n+pci_map_device(struct rte_pci_device *dev)\n+{\n+\tint ret = -1;\n+\n+\t/* try mapping the NIC resources using VFIO if it exists */\n+\tswitch (dev->kdrv) {\n+\tcase RTE_KDRV_VFIO:\n+#ifdef VFIO_PRESENT\n+\t\tif (pci_vfio_is_enabled())\n+\t\t\tret = pci_vfio_map_resource(dev);\n+#endif\n+\t\tbreak;\n+\tcase RTE_KDRV_IGB_UIO:\n+\tcase RTE_KDRV_UIO_GENERIC:\n+\tcase RTE_KDRV_NIC_UIO:\n+\t\t/* map resources for devices that use uio */\n+\t\tret = pci_uio_map_resource(dev);\n+\t\tbreak;\n+\tdefault:\n+\t\tRTE_LOG(DEBUG, EAL, \" Not managed by a supported kernel driver,\"\n+\t\t\t\" skipped\\n\");\n+\t\tret = 1;\n+\t\tbreak;\n+\t}\n+\n+\treturn ret;\n+}\n+\n+#ifdef RTE_LIBRTE_EAL_HOTPLUG\n+/* Unmap pci device */\n+void\n+pci_unmap_device(struct rte_pci_device *dev)\n+{\n+\tif (dev == NULL)\n+\t\treturn;\n+\n+\t/* try unmapping the NIC resources using VFIO if it exists */\n+\tswitch (dev->kdrv) {\n+\tcase RTE_KDRV_VFIO:\n+\t\tRTE_LOG(ERR, EAL, \"Hotplug doesn't support vfio yet\\n\");\n+\t\tbreak;\n+\tcase RTE_KDRV_IGB_UIO:\n+\tcase RTE_KDRV_UIO_GENERIC:\n+\tcase RTE_KDRV_NIC_UIO:\n+\t\t/* unmap resources for devices that use uio */\n+\t\tpci_uio_unmap_resource(dev);\n+\t\tbreak;\n+\tdefault:\n+\t\tRTE_LOG(DEBUG, EAL, \" Not managed by a supported kernel driver,\"\n+\t\t\t\" skipped\\n\");\n+\t\tbreak;\n+\t}\n+}\n+#endif /* RTE_LIBRTE_EAL_HOTPLUG */\n+\n /*\n * If vendor/device ID match, call the devinit() function of all\n * registered driver for the given device. Return -1 if initialization\ndiff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/eal_private.h\nindex c3a3fe4..eec396c 100644\n--- a/lib/librte_eal/common/eal_private.h\n+++ b/lib/librte_eal/common/eal_private.h\n@@ -162,6 +162,25 @@ struct rte_pci_device;\n * @return\n * 0 on success, negative on error\n */\n+int pci_map_device(struct rte_pci_device *dev);\n+\n+#ifdef RTE_LIBRTE_EAL_HOTPLUG\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+#endif /* RTE_LIBRTE_EAL_HOTPLUG */\n+\n+/**\n+ * Map this device\n+ *\n+ * This function is private to EAL.\n+ *\n+ * @return\n+ * 0 on success, negative on error\n+ */\n int pci_uio_map_resource(struct rte_pci_device *dev);\n \n #ifdef RTE_LIBRTE_EAL_HOTPLUG\ndiff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h\nindex 56dcb46..475d2dc 100644\n--- a/lib/librte_eal/common/include/rte_pci.h\n+++ b/lib/librte_eal/common/include/rte_pci.h\n@@ -148,6 +148,7 @@ enum rte_kernel_driver {\n \tRTE_KDRV_IGB_UIO,\n \tRTE_KDRV_VFIO,\n \tRTE_KDRV_UIO_GENERIC,\n+\tRTE_KDRV_NIC_UIO,\n };\n \n /**\ndiff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c\nindex fc99eaa..7e8df7d 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_pci.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c\n@@ -522,59 +522,6 @@ pci_config_space_set(struct rte_pci_device *dev)\n }\n #endif\n \n-static int\n-pci_map_device(struct rte_pci_device *dev)\n-{\n-\tint ret = -1;\n-\n-\t/* try mapping the NIC resources using VFIO if it exists */\n-\tswitch (dev->kdrv) {\n-\tcase RTE_KDRV_VFIO:\n-#ifdef VFIO_PRESENT\n-\t\tif (pci_vfio_is_enabled())\n-\t\t\tret = pci_vfio_map_resource(dev);\n-#endif\n-\t\tbreak;\n-\tcase RTE_KDRV_IGB_UIO:\n-\tcase RTE_KDRV_UIO_GENERIC:\n-\t\t/* map resources for devices that use uio */\n-\t\tret = pci_uio_map_resource(dev);\n-\t\tbreak;\n-\tdefault:\n-\t\tRTE_LOG(DEBUG, EAL, \" Not managed by a supported kernel driver,\"\n-\t\t\t\" skipped\\n\");\n-\t\tret = 1;\n-\t\tbreak;\n-\t}\n-\n-\treturn ret;\n-}\n-\n-#ifdef RTE_LIBRTE_EAL_HOTPLUG\n-static void\n-pci_unmap_device(struct rte_pci_device *dev)\n-{\n-\tif (dev == NULL)\n-\t\treturn;\n-\n-\t/* try unmapping the NIC resources using VFIO if it exists */\n-\tswitch (dev->kdrv) {\n-\tcase RTE_KDRV_VFIO:\n-\t\tRTE_LOG(ERR, EAL, \"Hotplug doesn't support vfio yet\\n\");\n-\t\tbreak;\n-\tcase RTE_KDRV_IGB_UIO:\n-\tcase RTE_KDRV_UIO_GENERIC:\n-\t\t/* unmap resources for devices that use uio */\n-\t\tpci_uio_unmap_resource(dev);\n-\t\tbreak;\n-\tdefault:\n-\t\tRTE_LOG(DEBUG, EAL, \" Not managed by a supported kernel driver,\"\n-\t\t\t\" skipped\\n\");\n-\t\tbreak;\n-\t}\n-}\n-#endif /* RTE_LIBRTE_EAL_HOTPLUG */\n-\n /*\n * If vendor/device ID match, call the devinit() function of the\n * driver.\ndiff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c\nindex 02cd07f..1822258 100644\n--- a/lib/librte_ether/rte_ethdev.c\n+++ b/lib/librte_ether/rte_ethdev.c\n@@ -515,6 +515,7 @@ rte_eth_dev_is_detachable(uint8_t port_id)\n \t\tswitch (rte_eth_devices[port_id].pci_dev->kdrv) {\n \t\tcase RTE_KDRV_IGB_UIO:\n \t\tcase RTE_KDRV_UIO_GENERIC:\n+\t\tcase RTE_KDRV_NIC_UIO:\n \t\t\tbreak;\n \t\tcase RTE_KDRV_VFIO:\n \t\tdefault:\n", "prefixes": [ "dpdk-dev", "v7", "11/12" ] }{ "id": 5962, "url": "