get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 16583,
    "url": "https://patches.dpdk.org/api/patches/16583/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1476442527-30726-3-git-send-email-shreyansh.jain@nxp.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": "<1476442527-30726-3-git-send-email-shreyansh.jain@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1476442527-30726-3-git-send-email-shreyansh.jain@nxp.com",
    "date": "2016-10-14T10:55:25",
    "name": "[dpdk-dev,v2,2/4] eal: generalize PCI map/unmap resource to EAL",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "777c0b1845e60972afeef0cc52ddb63a15fa08e6",
    "submitter": {
        "id": 497,
        "url": "https://patches.dpdk.org/api/people/497/?format=api",
        "name": "Shreyansh Jain",
        "email": "shreyansh.jain@nxp.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1476442527-30726-3-git-send-email-shreyansh.jain@nxp.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/16583/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/16583/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 6DBAD72FC;\n\tFri, 14 Oct 2016 12:54:23 +0200 (CEST)",
            "from NAM01-BY2-obe.outbound.protection.outlook.com\n\t(mail-by2nam01on0072.outbound.protection.outlook.com [104.47.34.72])\n\tby dpdk.org (Postfix) with ESMTP id 016F96CD4\n\tfor <dev@dpdk.org>; Fri, 14 Oct 2016 12:54:19 +0200 (CEST)",
            "from DM2PR03CA0027.namprd03.prod.outlook.com (10.141.96.26) by\n\tDM2PR03MB333.namprd03.prod.outlook.com (10.141.54.16) with Microsoft\n\tSMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id\n\t15.1.649.16; Fri, 14 Oct 2016 10:54:18 +0000",
            "from BY2FFO11FD029.protection.gbl (2a01:111:f400:7c0c::182) by\n\tDM2PR03CA0027.outlook.office365.com (2a01:111:e400:2428::26) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.12 via\n\tFrontend Transport; Fri, 14 Oct 2016 10:54:17 +0000",
            "from tx30smr01.am.freescale.net (192.88.168.50) by\n\tBY2FFO11FD029.mail.protection.outlook.com (10.1.14.212) with\n\tMicrosoft SMTP Server (version=TLS1_0,\n\tcipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.629.5\n\tvia Frontend Transport; Fri, 14 Oct 2016 10:54:17 +0000",
            "from Tophie.ap.freescale.net ([10.232.14.87])\n\tby tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id\n\tu9EAs936011436; Fri, 14 Oct 2016 03:54:15 -0700"
        ],
        "Authentication-Results": "spf=fail (sender IP is 192.88.168.50)\n\tsmtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed)\n\theader.d=none; nxp.com; dmarc=fail action=none header.from=nxp.com;\n\tnxp.com; \n\tdkim=none (message not signed) header.d=none;",
        "Received-SPF": "Fail (protection.outlook.com: domain of nxp.com does not\n\tdesignate 192.88.168.50 as permitted sender)\n\treceiver=protection.outlook.com; \n\tclient-ip=192.88.168.50; helo=tx30smr01.am.freescale.net;",
        "From": "Shreyansh Jain <shreyansh.jain@nxp.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<viktorin@rehivetech.com>, <thomas.monjalon@6wind.com>,\n\t<david.marchand@6wind.com>, Shreyansh Jain <shreyansh.jain@nxp.com>",
        "Date": "Fri, 14 Oct 2016 16:25:25 +0530",
        "Message-ID": "<1476442527-30726-3-git-send-email-shreyansh.jain@nxp.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1476442527-30726-1-git-send-email-shreyansh.jain@nxp.com>",
        "References": "<1474985551-14219-1-git-send-email-shreyansh.jain@nxp.com>\n\t<1476442527-30726-1-git-send-email-shreyansh.jain@nxp.com>",
        "X-EOPAttributedMessage": "0",
        "X-Matching-Connectors": "131209160576411224;\n\t(91ab9b29-cfa4-454e-5278-08d120cd25b8); ()",
        "X-Forefront-Antispam-Report": "CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI;\n\tSFV:NSPM;\n\tSFS:(10009020)(6009001)(7916002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(47776003)(50986999)(33646002)(87936001)(4326007)(11100500001)(85426001)(105606002)(6916009)(2950100002)(86362001)(6666003)(626004)(50466002)(48376002)(81156014)(575784001)(81166006)(2351001)(2906002)(5660300001)(92566002)(356003)(106466001)(110136003)(586003)(36756003)(189998001)(5890100001)(104016004)(229853001)(77096005)(8676002)(50226002)(8936002)(68736007)(97736004)(7846002)(5003940100001)(19580395003)(19580405001)(76176999)(8666005)(305945005)(7059030);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR03MB333;\n\tH:tx30smr01.am.freescale.net; \n\tFPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; ",
        "X-Microsoft-Exchange-Diagnost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DM2PR03MB333;\n\t7:4Y2dyE6yNOvSZa/uQTte6dPLmEHHDVnG0r9MWR1sh2V/fEl+UR+3S6nsuVOf2hfUmbJmpWkF9sswFZpNHsrz6rAWC+YEMvoaH0Pe3GnyJqxfPVlT21FiywxM7Bw2joG+vQ5gIG9wGIqlDi0eU673GsuxrwnRnk5F2pdc5opbWdw830BxfgdI6aRcJzslKkfH0EX3+I12Jh9RHCkdNmTlOPHB0PXCQiCSYVQSq/93vh1mRtSi3zMYv+G2n15tcz9ylvLH6eSModo3MfQxRHzqdrNQzx4+q80hJQmvD1LcCrE4FImKfJ04RMase+DJ+krIYDllq6BZFnAp4WhKfYCmKQkg0kUQiiWRLe0poXDZy14="
        ],
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-MS-Office365-Filtering-Correlation-Id": "143ef827-f5b3-4691-c4f8-08d3f42071e3",
        "X-Microsoft-Antispam": "UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB333;",
        "X-Microsoft-Antispam-PRVS": "<DM2PR03MB333B53B6A63A945D456DAC090DF0@DM2PR03MB333.namprd03.prod.outlook.com>",
        "X-Exchange-Antispam-Report-Test": "UriScan:(185117386973197);",
        "X-Exchange-Antispam-Report-CFA-Test": "BCL:0; PCL:0;\n\tRULEID:(6040176)(601004)(2401047)(13023025)(13024025)(8121501046)(13017025)(13018025)(13015025)(5005006)(3002001)(10201501046)(6055026);\n\tSRVR:DM2PR03MB333; BCL:0; PCL:0; RULEID:(400006); SRVR:DM2PR03MB333; ",
        "X-Forefront-PRVS": "0095BCF226",
        "SpamDiagnosticOutput": "1:99",
        "SpamDiagnosticMetadata": "NSPM",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "14 Oct 2016 10:54:17.4383\n\t(UTC)",
        "X-MS-Exchange-CrossTenant-Id": "5afe0b00-7697-4969-b663-5eab37d5f47e",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;\n\tIp=[192.88.168.50]; \n\tHelo=[tx30smr01.am.freescale.net]",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "DM2PR03MB333",
        "Subject": "[dpdk-dev] [PATCH v2 2/4] eal: generalize PCI map/unmap resource to\n\tEAL",
        "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: Jan Viktorin <viktorin@rehivetech.com>\n\nThe functions pci_map_resource, pci_unmap_resource are generic so the\npci_* prefix can be omitted. The functions are moved to the\neal_common_dev.c so they can be reused by other infrastructure.\n\nSigned-off-by: Jan Viktorin <viktorin@rehivetech.com>\nSigned-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>\n---\n lib/librte_eal/bsdapp/eal/eal_pci.c             |  2 +-\n lib/librte_eal/bsdapp/eal/rte_eal_version.map   |  2 ++\n lib/librte_eal/common/eal_common_dev.c          | 39 +++++++++++++++++++++++++\n lib/librte_eal/common/eal_common_pci.c          | 39 -------------------------\n lib/librte_eal/common/eal_common_pci_uio.c      | 16 +++++-----\n lib/librte_eal/common/include/rte_dev.h         | 32 ++++++++++++++++++++\n lib/librte_eal/common/include/rte_pci.h         | 32 --------------------\n lib/librte_eal/linuxapp/eal/eal_pci_uio.c       |  2 +-\n lib/librte_eal/linuxapp/eal/eal_pci_vfio.c      |  5 ++--\n lib/librte_eal/linuxapp/eal/rte_eal_version.map |  2 ++\n 10 files changed, 89 insertions(+), 82 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/bsdapp/eal/eal_pci.c b/lib/librte_eal/bsdapp/eal/eal_pci.c\nindex 8b3ed88..7ed0115 100644\n--- a/lib/librte_eal/bsdapp/eal/eal_pci.c\n+++ b/lib/librte_eal/bsdapp/eal/eal_pci.c\n@@ -228,7 +228,7 @@ pci_uio_map_resource_by_index(struct rte_pci_device *dev, int res_idx,\n \n \t/* if matching map is found, then use it */\n \toffset = res_idx * pagesz;\n-\tmapaddr = pci_map_resource(NULL, fd, (off_t)offset,\n+\tmapaddr = rte_eal_map_resource(NULL, fd, (off_t)offset,\n \t\t\t(size_t)dev->mem_resource[res_idx].len, 0);\n \tclose(fd);\n \tif (mapaddr == MAP_FAILED)\ndiff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map\nindex 2f81f7c..11d9f59 100644\n--- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map\n+++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map\n@@ -170,6 +170,8 @@ DPDK_16.11 {\n \trte_delay_us_callback_register;\n \trte_eal_dev_attach;\n \trte_eal_dev_detach;\n+\trte_eal_map_resource;\n+\trte_eal_unmap_resource;\n \trte_eal_vdrv_register;\n \trte_eal_vdrv_unregister;\n \ndiff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c\nindex 4f3b493..457d227 100644\n--- a/lib/librte_eal/common/eal_common_dev.c\n+++ b/lib/librte_eal/common/eal_common_dev.c\n@@ -36,6 +36,7 @@\n #include <string.h>\n #include <inttypes.h>\n #include <sys/queue.h>\n+#include <sys/mman.h>\n \n #include <rte_dev.h>\n #include <rte_devargs.h>\n@@ -151,3 +152,41 @@ err:\n \tRTE_LOG(ERR, EAL, \"Driver cannot detach the device (%s)\\n\", name);\n \treturn -EINVAL;\n }\n+\n+/* map a particular resource from a file */\n+void *\n+rte_eal_map_resource(void *requested_addr, int fd, off_t offset, size_t size,\n+\t\t int additional_flags)\n+{\n+\tvoid *mapaddr;\n+\n+\t/* Map the Memory resource of device */\n+\tmapaddr = mmap(requested_addr, size, PROT_READ | PROT_WRITE,\n+\t\t\tMAP_SHARED | additional_flags, fd, offset);\n+\tif (mapaddr == MAP_FAILED) {\n+\t\tRTE_LOG(ERR, EAL, \"%s(): cannot mmap(%d, %p, 0x%lx, 0x%lx): %s\"\n+\t\t\t\" (%p)\\n\", __func__, fd, requested_addr,\n+\t\t\t(unsigned long)size, (unsigned long)offset,\n+\t\t\tstrerror(errno), mapaddr);\n+\t} else\n+\t\tRTE_LOG(DEBUG, EAL, \"  Device memory mapped at %p\\n\", mapaddr);\n+\n+\treturn mapaddr;\n+}\n+\n+/* unmap a particular resource */\n+void\n+rte_eal_unmap_resource(void *requested_addr, size_t size)\n+{\n+\tif (requested_addr == NULL)\n+\t\treturn;\n+\n+\t/* Unmap the Memory resource of device */\n+\tif (munmap(requested_addr, size)) {\n+\t\tRTE_LOG(ERR, EAL, \"%s(): cannot munmap(%p, 0x%lx): %s\\n\",\n+\t\t\t__func__, requested_addr, (unsigned long)size,\n+\t\t\tstrerror(errno));\n+\t} else\n+\t\tRTE_LOG(DEBUG, EAL, \"  Device memory unmapped at %p\\n\",\n+\t\t\t\trequested_addr);\n+}\ndiff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c\nindex 638cd86..464acc1 100644\n--- a/lib/librte_eal/common/eal_common_pci.c\n+++ b/lib/librte_eal/common/eal_common_pci.c\n@@ -67,7 +67,6 @@\n #include <stdlib.h>\n #include <stdio.h>\n #include <sys/queue.h>\n-#include <sys/mman.h>\n \n #include <rte_interrupts.h>\n #include <rte_log.h>\n@@ -114,44 +113,6 @@ static struct rte_devargs *pci_devargs_lookup(struct rte_pci_device *dev)\n \treturn NULL;\n }\n \n-/* map a particular resource from a file */\n-void *\n-pci_map_resource(void *requested_addr, int fd, off_t offset, size_t size,\n-\t\t int additional_flags)\n-{\n-\tvoid *mapaddr;\n-\n-\t/* Map the PCI memory resource of device */\n-\tmapaddr = mmap(requested_addr, size, PROT_READ | PROT_WRITE,\n-\t\t\tMAP_SHARED | additional_flags, fd, offset);\n-\tif (mapaddr == MAP_FAILED) {\n-\t\tRTE_LOG(ERR, EAL, \"%s(): cannot mmap(%d, %p, 0x%lx, 0x%lx): %s (%p)\\n\",\n-\t\t\t__func__, fd, requested_addr,\n-\t\t\t(unsigned long)size, (unsigned long)offset,\n-\t\t\tstrerror(errno), mapaddr);\n-\t} else\n-\t\tRTE_LOG(DEBUG, EAL, \"  PCI memory mapped at %p\\n\", mapaddr);\n-\n-\treturn mapaddr;\n-}\n-\n-/* unmap a particular resource */\n-void\n-pci_unmap_resource(void *requested_addr, size_t size)\n-{\n-\tif (requested_addr == NULL)\n-\t\treturn;\n-\n-\t/* Unmap the PCI memory resource of device */\n-\tif (munmap(requested_addr, size)) {\n-\t\tRTE_LOG(ERR, EAL, \"%s(): cannot munmap(%p, 0x%lx): %s\\n\",\n-\t\t\t__func__, requested_addr, (unsigned long)size,\n-\t\t\tstrerror(errno));\n-\t} else\n-\t\tRTE_LOG(DEBUG, EAL, \"  PCI memory unmapped at %p\\n\",\n-\t\t\t\trequested_addr);\n-}\n-\n /*\n  * If vendor/device ID match, call the probe() function of the\n  * driver.\ndiff --git a/lib/librte_eal/common/eal_common_pci_uio.c b/lib/librte_eal/common/eal_common_pci_uio.c\nindex 367a681..3402518 100644\n--- a/lib/librte_eal/common/eal_common_pci_uio.c\n+++ b/lib/librte_eal/common/eal_common_pci_uio.c\n@@ -75,9 +75,11 @@ pci_uio_map_secondary(struct rte_pci_device *dev)\n \t\t\t\treturn -1;\n \t\t\t}\n \n-\t\t\tvoid *mapaddr = pci_map_resource(uio_res->maps[i].addr,\n-\t\t\t\t\tfd, (off_t)uio_res->maps[i].offset,\n-\t\t\t\t\t(size_t)uio_res->maps[i].size, 0);\n+\t\t\tvoid *mapaddr = rte_eal_map_resource(\n+\t\t\t\t\t\tuio_res->maps[i].addr, fd,\n+\t\t\t\t\t\t(off_t)uio_res->maps[i].offset,\n+\t\t\t\t\t\t(size_t)uio_res->maps[i].size,\n+\t\t\t\t\t\t0);\n \t\t\t/* fd is not needed in slave process, close it */\n \t\t\tclose(fd);\n \t\t\tif (mapaddr != uio_res->maps[i].addr) {\n@@ -88,11 +90,11 @@ pci_uio_map_secondary(struct rte_pci_device *dev)\n \t\t\t\tif (mapaddr != MAP_FAILED) {\n \t\t\t\t\t/* unmap addrs correctly mapped */\n \t\t\t\t\tfor (j = 0; j < i; j++)\n-\t\t\t\t\t\tpci_unmap_resource(\n+\t\t\t\t\t\trte_eal_unmap_resource(\n \t\t\t\t\t\t\tuio_res->maps[j].addr,\n \t\t\t\t\t\t\t(size_t)uio_res->maps[j].size);\n \t\t\t\t\t/* unmap addr wrongly mapped */\n-\t\t\t\t\tpci_unmap_resource(mapaddr,\n+\t\t\t\t\trte_eal_unmap_resource(mapaddr,\n \t\t\t\t\t\t(size_t)uio_res->maps[i].size);\n \t\t\t\t}\n \t\t\t\treturn -1;\n@@ -150,7 +152,7 @@ pci_uio_map_resource(struct rte_pci_device *dev)\n \treturn 0;\n error:\n \tfor (i = 0; i < map_idx; i++) {\n-\t\tpci_unmap_resource(uio_res->maps[i].addr,\n+\t\trte_eal_unmap_resource(uio_res->maps[i].addr,\n \t\t\t\t(size_t)uio_res->maps[i].size);\n \t\trte_free(uio_res->maps[i].path);\n \t}\n@@ -167,7 +169,7 @@ pci_uio_unmap(struct mapped_pci_resource *uio_res)\n \t\treturn;\n \n \tfor (i = 0; i != uio_res->nb_maps; i++) {\n-\t\tpci_unmap_resource(uio_res->maps[i].addr,\n+\t\trte_eal_unmap_resource(uio_res->maps[i].addr,\n \t\t\t\t(size_t)uio_res->maps[i].size);\n \t\tif (rte_eal_process_type() == RTE_PROC_PRIMARY)\n \t\t\trte_free(uio_res->maps[i].path);\ndiff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h\nindex e73b0fa..277c07b 100644\n--- a/lib/librte_eal/common/include/rte_dev.h\n+++ b/lib/librte_eal/common/include/rte_dev.h\n@@ -234,6 +234,38 @@ int rte_eal_dev_attach(const char *name, const char *devargs);\n  */\n int rte_eal_dev_detach(const char *name);\n \n+/*\n+ * @internal\n+ * Map a particular resource from a file.\n+ *\n+ * @param requested_addr\n+ *      The starting address for the new mapping range.\n+ * @param fd\n+ *      The file descriptor.\n+ * @param offset\n+ *      The offset for the mapping range.\n+ * @param size\n+ *      The size for the mapping range.\n+ * @param additional_flags\n+ *      The additional flags for the mapping range.\n+ * @return\n+ *   - On success, the function returns a pointer to the mapped area.\n+ *   - On error, the value MAP_FAILED is returned.\n+ */\n+void *rte_eal_map_resource(void *requested_addr, int fd, off_t offset,\n+\t\t\t   size_t size, int additional_flags);\n+\n+/**\n+ * @internal\n+ * Unmap a particular resource.\n+ *\n+ * @param requested_addr\n+ *      The address for the unmapping range.\n+ * @param size\n+ *      The size for the unmapping range.\n+ */\n+void rte_eal_unmap_resource(void *requested_addr, size_t size);\n+\n #define RTE_PMD_EXPORT_NAME_ARRAY(n, idx) n##idx[]\n \n #define RTE_PMD_EXPORT_NAME(name, idx) \\\ndiff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h\nindex 2c7046f..7d6eef5 100644\n--- a/lib/librte_eal/common/include/rte_pci.h\n+++ b/lib/librte_eal/common/include/rte_pci.h\n@@ -399,38 +399,6 @@ int rte_eal_pci_map_device(struct rte_pci_device *dev);\n void rte_eal_pci_unmap_device(struct rte_pci_device *dev);\n \n /**\n- * @internal\n- * Map a particular resource from a file.\n- *\n- * @param requested_addr\n- *      The starting address for the new mapping range.\n- * @param fd\n- *      The file descriptor.\n- * @param offset\n- *      The offset for the mapping range.\n- * @param size\n- *      The size for the mapping range.\n- * @param additional_flags\n- *      The additional flags for the mapping range.\n- * @return\n- *   - On success, the function returns a pointer to the mapped area.\n- *   - On error, the value MAP_FAILED is returned.\n- */\n-void *pci_map_resource(void *requested_addr, int fd, off_t offset,\n-\t\tsize_t size, int additional_flags);\n-\n-/**\n- * @internal\n- * Unmap a particular resource.\n- *\n- * @param requested_addr\n- *      The address for the unmapping range.\n- * @param size\n- *      The size for the unmapping range.\n- */\n-void pci_unmap_resource(void *requested_addr, size_t size);\n-\n-/**\n  * Probe the single PCI device.\n  *\n  * Scan the content of the PCI bus, and find the pci device specified by pci\ndiff --git a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c\nindex 1786b75..5c34421 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c\n@@ -347,7 +347,7 @@ pci_uio_map_resource_by_index(struct rte_pci_device *dev, int res_idx,\n \tif (pci_map_addr == NULL)\n \t\tpci_map_addr = pci_find_max_end_va();\n \n-\tmapaddr = pci_map_resource(pci_map_addr, fd, 0,\n+\tmapaddr = rte_eal_map_resource(pci_map_addr, fd, 0,\n \t\t\t(size_t)dev->mem_resource[res_idx].len, 0);\n \tclose(fd);\n \tif (mapaddr == MAP_FAILED)\ndiff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c\nindex 5f478c5..5ad8cbe 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c\n@@ -465,7 +465,8 @@ pci_vfio_map_resource(struct rte_pci_device *dev)\n \t\t\tvoid *map_addr = NULL;\n \t\t\tif (memreg[0].size) {\n \t\t\t\t/* actual map of first part */\n-\t\t\t\tmap_addr = pci_map_resource(bar_addr, vfio_dev_fd,\n+\t\t\t\tmap_addr = rte_eal_map_resource(bar_addr,\n+\t\t\t\t\t\t\t    vfio_dev_fd,\n \t\t\t\t\t\t\t    memreg[0].offset,\n \t\t\t\t\t\t\t    memreg[0].size,\n \t\t\t\t\t\t\t    MAP_FIXED);\n@@ -477,7 +478,7 @@ pci_vfio_map_resource(struct rte_pci_device *dev)\n \t\t\t\tvoid *second_addr = RTE_PTR_ADD(bar_addr,\n \t\t\t\t\t\t\t\tmemreg[1].offset -\n \t\t\t\t\t\t\t\t(uintptr_t)reg.offset);\n-\t\t\t\tmap_addr = pci_map_resource(second_addr,\n+\t\t\t\tmap_addr = rte_eal_map_resource(second_addr,\n \t\t\t\t\t\t\t    vfio_dev_fd, memreg[1].offset,\n \t\t\t\t\t\t\t    memreg[1].size,\n \t\t\t\t\t\t\t    MAP_FIXED);\ndiff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map\nindex 83721ba..22b5b59 100644\n--- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map\n+++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map\n@@ -174,6 +174,8 @@ DPDK_16.11 {\n \trte_delay_us_callback_register;\n \trte_eal_dev_attach;\n \trte_eal_dev_detach;\n+\trte_eal_map_resource;\n+\trte_eal_unmap_resource;\n \trte_eal_vdrv_register;\n \trte_eal_vdrv_unregister;\n \n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "2/4"
    ]
}