get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 18171,
    "url": "http://patches.dpdk.org/api/patches/18171/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1482180853-18823-12-git-send-email-hemant.agrawal@nxp.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": "<1482180853-18823-12-git-send-email-hemant.agrawal@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1482180853-18823-12-git-send-email-hemant.agrawal@nxp.com",
    "date": "2016-12-19T20:53:50",
    "name": "[dpdk-dev,PATCHv2,11/34] bus/fslmc: add vfio support",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "1cb8b28c159cd707a0234a34dc18d80ddfb8c651",
    "submitter": {
        "id": 477,
        "url": "http://patches.dpdk.org/api/people/477/?format=api",
        "name": "Hemant Agrawal",
        "email": "hemant.agrawal@nxp.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1482180853-18823-12-git-send-email-hemant.agrawal@nxp.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/18171/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/18171/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 1590BFA6F;\n\tMon, 19 Dec 2016 16:21:40 +0100 (CET)",
            "from NAM01-SN1-obe.outbound.protection.outlook.com\n\t(mail-sn1nam01on0042.outbound.protection.outlook.com [104.47.32.42])\n\tby dpdk.org (Postfix) with ESMTP id A3B98FA38\n\tfor <dev@dpdk.org>; Mon, 19 Dec 2016 16:21:13 +0100 (CET)",
            "from BY2PR03CA062.namprd03.prod.outlook.com (10.141.249.35) by\n\tDM2PR0301MB0752.namprd03.prod.outlook.com (10.160.97.148) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id\n\t15.1.771.8; Mon, 19 Dec 2016 15:21:10 +0000",
            "from BN1BFFO11FD034.protection.gbl (2a01:111:f400:7c10::1:154) by\n\tBY2PR03CA062.outlook.office365.com (2a01:111:e400:2c5d::35) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.789.14 via\n\tFrontend Transport; Mon, 19 Dec 2016 15:21:10 +0000",
            "from az84smr01.freescale.net (192.88.158.2) by\n\tBN1BFFO11FD034.mail.protection.outlook.com (10.58.144.97) with\n\tMicrosoft SMTP Server (version=TLS1_0,\n\tcipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.789.10\n\tvia Frontend Transport; Mon, 19 Dec 2016 15:21:10 +0000",
            "from bf-netperf1.idc ([10.232.134.28])\n\tby az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id\n\tuBJFKMha029110; Mon, 19 Dec 2016 08:21:06 -0700"
        ],
        "Authentication-Results": "spf=fail (sender IP is 192.88.158.2)\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.158.2 as permitted sender)\n\treceiver=protection.outlook.com; \n\tclient-ip=192.88.158.2; helo=az84smr01.freescale.net;",
        "From": "Hemant Agrawal <hemant.agrawal@nxp.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<thomas.monjalon@6wind.com>, <bruce.richardson@intel.com>,\n\t<shreyansh.jain@nxp.com>, <john.mcnamara@intel.com>,\n\t<ferruh.yigit@intel.com>, <jerin.jacob@caviumnetworks.com>,\n\tHemant Agrawal <hemant.agrawal@nxp.com>",
        "Date": "Tue, 20 Dec 2016 02:23:50 +0530",
        "Message-ID": "<1482180853-18823-12-git-send-email-hemant.agrawal@nxp.com>",
        "X-Mailer": "git-send-email 1.9.1",
        "In-Reply-To": "<1482180853-18823-1-git-send-email-hemant.agrawal@nxp.com>",
        "References": "<1480875447-23680-1-git-send-email-hemant.agrawal@nxp.com>\n\t<1482180853-18823-1-git-send-email-hemant.agrawal@nxp.com>",
        "X-EOPAttributedMessage": "0",
        "X-Matching-Connectors": "131266344704839775;\n\t(91ab9b29-cfa4-454e-5278-08d120cd25b8); ()",
        "X-Forefront-Antispam-Report": "CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI;\n\tSFV:NSPM;\n\tSFS:(10009020)(6009001)(7916002)(336005)(39450400003)(39860400002)(39850400002)(39840400002)(39400400002)(39410400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(50986999)(76176999)(2351001)(68736007)(106466001)(47776003)(36756003)(50466002)(97736004)(2906002)(48376002)(110136003)(189998001)(33646002)(356003)(2950100002)(6666003)(104016004)(8666005)(5660300001)(6916009)(5003940100001)(85426001)(8936002)(8676002)(50226002)(626004)(81156014)(38730400001)(81166006)(4326007)(92566002)(305945005)(69596002)(77096006)(105606002)(86362001)(7059030);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0301MB0752;\n\tH:az84smr01.freescale.net; \n\tFPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; ",
        "X-Microsoft-Exchange-Diagnostics": [
            "1; BN1BFFO11FD034;\n\t1:xl6cMs4lEk9bBi4VHMJxhUYGdxjrZRSk0vQBOXsZGsI4fIl+pMaLoOGvFYDH7XfJoMt3J2z31WJsLNFm3eU/1vp/8ri5YKUd1bANXXkoPyHkK3jbv2qKZfLWuueIoI41AXz77s/NRM4fMtudHbCfTboT+hARhf6UkB93nkKuRQC1LYRSJ+/zTibpBEVPOB0u/WBwY++2iBMtFcdQHgaBipehaBWCX2lwekf/9rduOBfQp0Wm+wWBHbRg8Pl5QvnlgfN8peuI9XwxFBFDXVtEad06GRBOnPEVTJjLWXyhyafVAme1EDWafxAYsA8ub/XvQfFGtDSizj6geatXla7kum+ppLKaGhOLGBC3jNk0bmNGdxRRXwmLkbB8EMg/CdF+SAS5eM1Ukdl4N0jQsO37TJW2Yb94sKpM+SHtcAsh1uKIx9QMjf2sQs/RMPQAtBvv0vV//Ou2OltgI7pe0iC/xZVZEJbwfR4yqxJ//bcLKN39eZROjplvl3xLmQtMhPtZB8BYUfCeNJa0wZOZjpu/KI1it0kWnz8kRuDocXb0jEMy+8GujtEbgAVKsNadiu1/Xr+RAv4f/sGPlWeD9pqIg7ErhuaYy3WXeU2+IOun6BufplnTZ0dRxKHaMWEfTgefC6ZxIVPr9Mhu8zWu+9oueiN1w+DbE81tpheLnhR1cTFZREho4Amz3BAFu8QW7S9/KhA/t8wvTAqj2KboE03n+9TcVYNbpnP78qQse3I9SZNjqeYdqpxstxZWkLN9zTnL6hky+Az0PxsXPXGezYTRcA==",
            "1; DM2PR0301MB0752;\n\t3:dGbZ3JIUuRlKy63dFp3kdxylQJ3kIgds3gXJ6TQHjhuFxdnVpYyUOxslfbjmoDgh08VwpJ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6LU16ZxQS0puic3DGfJj2w==",
            "1; DM2PR0301MB0752;\n\t4:HW9DxQ9xM5JUppMqrnZnVqJp6e66J2j3voM359cdEsKGHT/vSh7ST2GOGV2tJgAe14q378KyEuJVrXRo01EcPrFvuAUWmEomTTzriKuFgUfyRxCmIlRcob7ro7bzzPfg6LtsE0ENtg1wsuWT9+aQa9+22u1SCNWOI/8i3QuPLhHLm4ftTnMfTimhA3uyrYfnelHTtxTLVfHRCMsTBmdbUNIG+m0z7yzeIMBYLBNfCbSMeej8m5jRfR8mkTPJ6Qy97+CK5QXL9N+ENhpMufc25r7JWthEHK9CrKdWzN/QAwo6w+5q/XkSGnLK6J0tM/YKUDRev6AYc2VcGZ+4dd+d5ukMIdjJT+/2mQmkHp1W0647mt9pNDmS6hL0GttS0a9YD7yDf14xsOzarnARFfgi74KW0v/jpF1OyuOrUGiuiLfk61exZcMvdukjaWau/DMoUa+oGE23h4Q0DXoJf6joCzVrYaJH5zbZSxmSw3tBWiOVx9NBZSSg4+GqzaqsdjTadUGQbwTBagTe+PPO25vKrI6/vJQjP7QIdBS2Jp3sP2uzSIw4afgMIIaak6m3NAxEvLyz62ACm64XQnxjdDSDNk4N4QKhn2Cma5jnxk27Qj4cM+CvlV4fb067nUhQNal3PULvX9V4l591j17VLWHzhI2txD+QWQ/fOXJNIUO032LsVWPQ+63SzAVR2uvQBTPe2QCjgWCk2MqqbUOsla3ObixIGkyMyjfhODt1jMy3HwwloG7Yt1+qSqghln8RrpZYK26MoOWjxvmwwASVfBvt8tb1R5tHNgw7vRRpa3U/qHk8T0txdEri0e10Nyd/J3CJ",
            "=?us-ascii?Q?1; DM2PR0301MB0752;\n\t23:9p1XPUIgBnrTbbrVSBcJVpxcIPikWqa3wc9kq3I?=\n\tCNZaGFnvPJ7GmoglixDOiGx0bWHlCrp5B1m63JWYMWgNqowILjkoxPx0owNQkCfL56nbshftONISOjWnj56dVlBawUEn4rGzmTXP9EfSasSMZPplwyk1iYdxGzmA39aJZA+1Xr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O4NaWYIypJTzp2fWjZHA0agIjRMCAVokjDhAbqApmnf7bcGpMD4NaXmkm01dZvmSZAbiBLfplghrFvng6DMfDPRk8HYDgR3t6gO7Ab1IJBb5NeAwR5quuo8cpe+inrDshOrTp7U0KH9GDSwspnZLMQcmFMkpZzSUOwvixUe1FG1Bu6WZp+Ws0rdqoR4GpxCqDeTipqg2B7RKvSdBbc8eG5rNefz/a/iH2aZuoMFGsU5p9XF+eyyYul8h7VBGANVebxKtQ=="
        ],
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-MS-Office365-Filtering-Correlation-Id": "36f1782d-85bb-44fa-2efd-08d42822a98d",
        "X-Microsoft-Antispam": "UriScan:; BCL:0; PCL:0; RULEID:(22001);\n\tSRVR:DM2PR0301MB0752; ",
        "X-Microsoft-Antispam-PRVS": "<DM2PR0301MB07523133500B61FC5883582089910@DM2PR0301MB0752.namprd03.prod.outlook.com>",
        "X-Exchange-Antispam-Report-Test": "UriScan:(185117386973197)(275809806118684)(21532816269658); ",
        "X-Exchange-Antispam-Report-CFA-Test": "BCL:0; PCL:0;\n\tRULEID:(6095060)(601004)(2401047)(5005006)(8121501046)(13024025)(13017025)(13015025)(13023025)(13018025)(10201501046)(3002001)(6055026)(6096035)(20161123556025)(20161123563025)(20161123565025)(20161123559025)(20161123561025);\n\tSRVR:DM2PR0301MB0752; BCL:0; PCL:0; RULEID:(400006);\n\tSRVR:DM2PR0301MB0752; ",
        "X-Forefront-PRVS": "01613DFDC8",
        "SpamDiagnosticOutput": "1:99",
        "SpamDiagnosticMetadata": "NSPM",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "19 Dec 2016 15:21:10.2343\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.158.2]; \n\tHelo=[az84smr01.freescale.net]",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "DM2PR0301MB0752",
        "Subject": "[dpdk-dev] [PATCHv2 11/34] bus/fslmc: add vfio support",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <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": "Add support for using VFIO for dpaa2 based fsl-mc bus.\n\nThere are some differences in the way vfio used for fsl-mc bus\nfrom the eal vfio.\n - The scanning of bus for individual objects on the basis of\n   the DPRC container.\n - The use and mapping of MC portal for object access\n\nWith the evolution of bus model, they canbe further aligned with\neal vfio code.\n\nSigned-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>\n---\n doc/guides/nics/features/dpaa2.ini |   1 +\n drivers/bus/fslmc/Makefile         |   2 +\n drivers/bus/fslmc/fslmc_bus.c      |  26 +-\n drivers/bus/fslmc/fslmc_vfio.c     | 471 +++++++++++++++++++++++++++++++++++++\n drivers/bus/fslmc/fslmc_vfio.h     |  74 ++++++\n 5 files changed, 570 insertions(+), 4 deletions(-)\n create mode 100644 drivers/bus/fslmc/fslmc_vfio.c\n create mode 100644 drivers/bus/fslmc/fslmc_vfio.h",
    "diff": "diff --git a/doc/guides/nics/features/dpaa2.ini b/doc/guides/nics/features/dpaa2.ini\nindex b2ad6ec..b176208 100644\n--- a/doc/guides/nics/features/dpaa2.ini\n+++ b/doc/guides/nics/features/dpaa2.ini\n@@ -4,5 +4,6 @@\n ; Refer to default.ini for the full list of available PMD features.\n ;\n [Features]\n+Linux VFIO           = Y\n ARMv8                = Y\n Usage doc            = Y\ndiff --git a/drivers/bus/fslmc/Makefile b/drivers/bus/fslmc/Makefile\nindex f5da4e0..54f757b 100644\n--- a/drivers/bus/fslmc/Makefile\n+++ b/drivers/bus/fslmc/Makefile\n@@ -41,6 +41,7 @@ CFLAGS += \"-Wno-strict-aliasing\"\n \n CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc\n CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/mc\n+CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal\n \n # versioning export map\n EXPORT_MAP := rte_pmd_fslmcbus_version.map\n@@ -55,6 +56,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += \\\n         mc/dpio.c \\\n         mc/mc_sys.c\n \n+SRCS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += fslmc_vfio.c\n SRCS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += fslmc_bus.c\n \n # library dependencies\ndiff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c\nindex cbf7600..ef38b3b 100644\n--- a/drivers/bus/fslmc/fslmc_bus.c\n+++ b/drivers/bus/fslmc/fslmc_bus.c\n@@ -42,21 +42,39 @@\n #include <rte_ethdev.h>\n \n #include \"rte_fslmc.h\"\n+#include \"fslmc_vfio.h\"\n \n #define FSLMC_BUS_LOG(level, fmt, args...) \\\n \tRTE_LOG(level, EAL, \"%s(): \" fmt \"\\n\", __func__, ##args)\n \n static\n-int rte_fslmc_scan(struct rte_bus *bus_d __rte_unused)\n+int rte_fslmc_scan(struct rte_bus *bus_d)\n {\n+\tif (fslmc_vfio_setup_group()) {\n+\t\tFSLMC_BUS_LOG(ERR, \"fslmc: Unable to setup VFIO\");\n+\t\treturn -1;\n+\t}\n+\tif (fslmc_vfio_process_group(bus_d)) {\n+\t\tFSLMC_BUS_LOG(ERR, \"fslmc: Unable to setup devices\");\n+\t\treturn -1;\n+\t}\n+\tRTE_LOG(INFO, EAL, \"fslmc: Bus scan completed\");\n \treturn 0;\n }\n \n static\n-int rte_fslmc_match(struct rte_driver *drv __rte_unused,\n-\t\t    struct rte_device *dev __rte_unused)\n+int rte_fslmc_match(struct rte_driver *drv, struct rte_device *dev)\n {\n-\treturn 0;\n+\tstruct rte_dpaa2_driver *dpaa2_drv;\n+\tstruct rte_dpaa2_device *dpaa2_dev;\n+\n+\tdpaa2_drv = container_of(drv, struct rte_dpaa2_driver, driver);\n+\tdpaa2_dev = container_of(dev, struct rte_dpaa2_device, device);\n+\n+\tif (dpaa2_drv->drv_type == dpaa2_dev->dev_type)\n+\t\treturn 0;\n+\n+\treturn 1;\n }\n \n struct rte_bus fslmc_bus = {\ndiff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c\nnew file mode 100644\nindex 0000000..eae6495\n--- /dev/null\n+++ b/drivers/bus/fslmc/fslmc_vfio.c\n@@ -0,0 +1,471 @@\n+/*-\n+ *   BSD LICENSE\n+ *\n+ *   Copyright (c) 2015-2016 Freescale Semiconductor, Inc. All rights reserved.\n+ *   Copyright (c) 2016 NXP. All rights reserved.\n+ *\n+ *   Redistribution and use in source and binary forms, with or without\n+ *   modification, are permitted provided that the following conditions\n+ *   are met:\n+ *\n+ *     * Redistributions of source code must retain the above copyright\n+ *       notice, this list of conditions and the following disclaimer.\n+ *     * Redistributions in binary form must reproduce the above copyright\n+ *       notice, this list of conditions and the following disclaimer in\n+ *       the documentation and/or other materials provided with the\n+ *       distribution.\n+ *     * Neither the name of Freescale Semiconductor, Inc nor the names of its\n+ *       contributors may be used to endorse or promote products derived\n+ *       from this software without specific prior written permission.\n+ *\n+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#include <unistd.h>\n+#include <stdio.h>\n+#include <sys/types.h>\n+#include <string.h>\n+#include <stdlib.h>\n+#include <fcntl.h>\n+#include <errno.h>\n+#include <sys/ioctl.h>\n+#include <sys/stat.h>\n+#include <sys/types.h>\n+#include <sys/mman.h>\n+#include <sys/vfs.h>\n+#include <libgen.h>\n+#include <dirent.h>\n+#include <sys/eventfd.h>\n+\n+#include <rte_mbuf.h>\n+#include <rte_ethdev.h>\n+#include <rte_malloc.h>\n+#include <rte_memcpy.h>\n+#include <rte_string_fns.h>\n+#include <rte_cycles.h>\n+#include <rte_kvargs.h>\n+#include <rte_dev.h>\n+#include <rte_ethdev.h>\n+#include <rte_bus.h>\n+\n+#include \"rte_fslmc.h\"\n+#include \"fslmc_vfio.h\"\n+\n+#define VFIO_MAX_CONTAINERS\t1\n+\n+#define FSLMC_VFIO_LOG(level, fmt, args...) \\\n+\tRTE_LOG(level, EAL, \"%s(): \" fmt \"\\n\", __func__, ##args)\n+\n+/** Pathname of FSL-MC devices directory. */\n+#define SYSFS_DPAA2_MC_DEVICES \"/sys/bus/fsl-mc/devices\"\n+\n+/* Number of VFIO containers & groups with in */\n+static struct fslmc_vfio_group vfio_groups[VFIO_MAX_GRP];\n+static struct fslmc_vfio_container vfio_containers[VFIO_MAX_CONTAINERS];\n+static int container_device_fd;\n+void *(*mcp_ptr_list);\n+static uint32_t mcp_id;\n+\n+static int vfio_connect_container(struct fslmc_vfio_group *vfio_group)\n+{\n+\tstruct fslmc_vfio_container *container;\n+\tint i, fd, ret;\n+\n+\t/* Try connecting to vfio container if already created */\n+\tfor (i = 0; i < VFIO_MAX_CONTAINERS; i++) {\n+\t\tcontainer = &vfio_containers[i];\n+\t\tif (!ioctl(vfio_group->fd, VFIO_GROUP_SET_CONTAINER,\n+\t\t\t   &container->fd)) {\n+\t\t\tFSLMC_VFIO_LOG(INFO, \"Container pre-exists with\"\n+\t\t\t\t    \" FD[0x%x] for this group\",\n+\t\t\t\t    container->fd);\n+\t\t\tvfio_group->container = container;\n+\t\t\treturn 0;\n+\t\t}\n+\t}\n+\n+\t/* Opens main vfio file descriptor which represents the \"container\" */\n+\tfd = vfio_get_container_fd();\n+\tif (fd < 0) {\n+\t\tFSLMC_VFIO_LOG(ERR, \"Failed to open VFIO container\");\n+\t\treturn -errno;\n+\t}\n+\n+\t/* Check whether support for SMMU type IOMMU present or not */\n+\tif (ioctl(fd, VFIO_CHECK_EXTENSION, VFIO_TYPE1_IOMMU)) {\n+\t\t/* Connect group to container */\n+\t\tret = ioctl(vfio_group->fd, VFIO_GROUP_SET_CONTAINER, &fd);\n+\t\tif (ret) {\n+\t\t\tFSLMC_VFIO_LOG(ERR, \"Failed to setup group container\");\n+\t\t\tclose(fd);\n+\t\t\treturn -errno;\n+\t\t}\n+\n+\t\tret = ioctl(fd, VFIO_SET_IOMMU, VFIO_TYPE1_IOMMU);\n+\t\tif (ret) {\n+\t\t\tFSLMC_VFIO_LOG(ERR, \"Failed to setup VFIO iommu\");\n+\t\t\tclose(fd);\n+\t\t\treturn -errno;\n+\t\t}\n+\t} else {\n+\t\tFSLMC_VFIO_LOG(ERR, \"No supported IOMMU available\");\n+\t\tclose(fd);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tcontainer = NULL;\n+\tfor (i = 0; i < VFIO_MAX_CONTAINERS; i++) {\n+\t\tif (vfio_containers[i].used)\n+\t\t\tcontinue;\n+\t\tFSLMC_VFIO_LOG(DEBUG, \"Unused container at index %d\", i);\n+\t\tcontainer = &vfio_containers[i];\n+\t}\n+\tif (!container) {\n+\t\tFSLMC_VFIO_LOG(ERR, \"No free container found\");\n+\t\tclose(fd);\n+\t\treturn -ENOMEM;\n+\t}\n+\n+\tcontainer->used = 1;\n+\tcontainer->fd = fd;\n+\tcontainer->group_list[container->index] = vfio_group;\n+\tvfio_group->container = container;\n+\tcontainer->index++;\n+\treturn 0;\n+}\n+\n+int vfio_dmamap_mem_region(uint64_t vaddr,\n+\t\t\t   uint64_t iova,\n+\t\t\t   uint64_t size)\n+{\n+\tstruct fslmc_vfio_group *group;\n+\tstruct vfio_iommu_type1_dma_map dma_map = {\n+\t\t.argsz = sizeof(dma_map),\n+\t\t.flags = VFIO_DMA_MAP_FLAG_READ | VFIO_DMA_MAP_FLAG_WRITE,\n+\t};\n+\n+\tdma_map.vaddr = vaddr;\n+\tdma_map.size = size;\n+\tdma_map.iova = iova;\n+\n+\t/* SET DMA MAP for IOMMU */\n+\tgroup = &vfio_groups[0];\n+\tif (ioctl(group->container->fd, VFIO_IOMMU_MAP_DMA, &dma_map)) {\n+\t\tFSLMC_VFIO_LOG(ERR, \"VFIO_IOMMU_MAP_DMA (errno = %d)\", errno);\n+\t\treturn -1;\n+\t}\n+\treturn 0;\n+}\n+static int64_t vfio_map_mcp_obj(struct fslmc_vfio_group *group, char *mcp_obj)\n+{\n+\tint64_t v_addr = (int64_t)MAP_FAILED;\n+\tint32_t ret, mc_fd;\n+\n+\tstruct vfio_device_info d_info = { .argsz = sizeof(d_info) };\n+\tstruct vfio_region_info reg_info = { .argsz = sizeof(reg_info) };\n+\n+\t/* getting the mcp object's fd*/\n+\tmc_fd = ioctl(group->fd, VFIO_GROUP_GET_DEVICE_FD, mcp_obj);\n+\tif (mc_fd < 0) {\n+\t\tFSLMC_VFIO_LOG(ERR, \"error in VFIO get device %s fd from group\"\n+\t\t\t    \" %d\", mcp_obj, group->fd);\n+\t\treturn v_addr;\n+\t}\n+\n+\t/* getting device info*/\n+\tret = ioctl(mc_fd, VFIO_DEVICE_GET_INFO, &d_info);\n+\tif (ret < 0) {\n+\t\tFSLMC_VFIO_LOG(ERR, \"error in VFIO getting DEVICE_INFO\");\n+\t\tgoto MC_FAILURE;\n+\t}\n+\n+\t/* getting device region info*/\n+\tret = ioctl(mc_fd, VFIO_DEVICE_GET_REGION_INFO, &reg_info);\n+\tif (ret < 0) {\n+\t\tFSLMC_VFIO_LOG(ERR, \"error in VFIO getting REGION_INFO\");\n+\t\tgoto MC_FAILURE;\n+\t}\n+\n+\tFSLMC_VFIO_LOG(DEBUG, \"region offset = %llx  , region size = %llx\",\n+\t\t     reg_info.offset, reg_info.size);\n+\n+\tv_addr = (uint64_t)mmap(NULL, reg_info.size,\n+\t\tPROT_WRITE | PROT_READ, MAP_SHARED,\n+\t\tmc_fd, reg_info.offset);\n+\n+MC_FAILURE:\n+\tclose(mc_fd);\n+\n+\treturn v_addr;\n+}\n+\n+/* Following function shall fetch total available list of MC devices\n+ * from VFIO container & populate private list of devices and other\n+ * data structures\n+ */\n+int fslmc_vfio_process_group(struct rte_bus *bus __rte_unused)\n+{\n+\tstruct fslmc_vfio_device *vdev;\n+\tstruct vfio_device_info device_info = { .argsz = sizeof(device_info) };\n+\tchar *temp_obj, *object_type __rte_unused, *mcp_obj, *dev_name;\n+\tint32_t object_id, i, dev_fd;\n+\tDIR *d;\n+\tstruct dirent *dir;\n+\tchar path[PATH_MAX];\n+\tint64_t v_addr;\n+\tint ndev_count;\n+\tstruct fslmc_vfio_group *group = &vfio_groups[0];\n+\tstatic int process_once;\n+\n+\t/* if already done once */\n+\tif (process_once) {\n+\t\tFSLMC_VFIO_LOG(DEBUG, \"Already scanned once - re-scan \"\n+\t\t\t    \"not supported\");\n+\t\treturn 0;\n+\t}\n+\tprocess_once = 0;\n+\n+\tsprintf(path, \"/sys/kernel/iommu_groups/%d/devices\", group->groupid);\n+\n+\td = opendir(path);\n+\tif (!d) {\n+\t\tFSLMC_VFIO_LOG(ERR, \"Unable to open directory %s\", path);\n+\t\treturn -1;\n+\t}\n+\n+\t/*Counting the number of devices in a group and getting the mcp ID*/\n+\tndev_count = 0;\n+\tmcp_obj = NULL;\n+\twhile ((dir = readdir(d)) != NULL) {\n+\t\tif (dir->d_type == DT_LNK) {\n+\t\t\tndev_count++;\n+\t\t\tif (!strncmp(\"dpmcp\", dir->d_name, 5)) {\n+\t\t\t\tif (mcp_obj)\n+\t\t\t\t\tfree(mcp_obj);\n+\t\t\t\tmcp_obj = malloc(sizeof(dir->d_name));\n+\t\t\t\tif (!mcp_obj) {\n+\t\t\t\t\tFSLMC_VFIO_LOG(ERR, \"mcp obj:Unable to\"\n+\t\t\t\t\t\t    \" allocate memory\");\n+\t\t\t\t\treturn -ENOMEM;\n+\t\t\t\t}\n+\t\t\t\tstrcpy(mcp_obj, dir->d_name);\n+\t\t\t\ttemp_obj = strtok(dir->d_name, \".\");\n+\t\t\t\ttemp_obj = strtok(NULL, \".\");\n+\t\t\t\tsscanf(temp_obj, \"%d\", &mcp_id);\n+\t\t\t}\n+\t\t}\n+\t}\n+\tclosedir(d);\n+\n+\tif (!mcp_obj) {\n+\t\tFSLMC_VFIO_LOG(ERR, \"DPAA2 MCP Object not Found\");\n+\t\treturn -ENODEV;\n+\t}\n+\tRTE_LOG(INFO, EAL, \"fslmc: DPRC contains = %d devices\\n\", ndev_count);\n+\n+\t/* Allocate the memory depends upon number of objects in a group*/\n+\tgroup->vfio_device = (struct fslmc_vfio_device *)malloc(ndev_count *\n+\t\t\t     sizeof(struct fslmc_vfio_device));\n+\tif (!(group->vfio_device)) {\n+\t\tFSLMC_VFIO_LOG(ERR, \"vfio device: Unable to allocate memory\\n\");\n+\t\tfree(mcp_obj);\n+\t\treturn -ENOMEM;\n+\t}\n+\n+\t/* Allocate memory for MC Portal list */\n+\tmcp_ptr_list = malloc(sizeof(void *) * 1);\n+\tif (!mcp_ptr_list) {\n+\t\tFSLMC_VFIO_LOG(ERR, \"portal list: Unable to allocate memory!\");\n+\t\tfree(mcp_obj);\n+\t\tgoto FAILURE;\n+\t}\n+\n+\tv_addr = vfio_map_mcp_obj(group, mcp_obj);\n+\tfree(mcp_obj);\n+\tif (v_addr == (int64_t)MAP_FAILED) {\n+\t\tFSLMC_VFIO_LOG(ERR, \"Error mapping region (errno = %d)\", errno);\n+\t\tgoto FAILURE;\n+\t}\n+\n+\tFSLMC_VFIO_LOG(DEBUG, \"DPAA2 MC has VIR_ADD = %ld\", v_addr);\n+\n+\tmcp_ptr_list[0] = (void *)v_addr;\n+\n+\td = opendir(path);\n+\tif (!d) {\n+\t\tFSLMC_VFIO_LOG(ERR, \"Unable to open %s Directory\", path);\n+\t\tgoto FAILURE;\n+\t}\n+\n+\ti = 0;\n+\tFSLMC_VFIO_LOG(DEBUG, \"DPAA2 - Parsing devices:\");\n+\t/* Parsing each object and initiating them*/\n+\twhile ((dir = readdir(d)) != NULL) {\n+\t\tif (dir->d_type != DT_LNK)\n+\t\t\tcontinue;\n+\t\tif (!strncmp(\"dprc\", dir->d_name, 4) ||\n+\t\t    !strncmp(\"dpmcp\", dir->d_name, 5))\n+\t\t\tcontinue;\n+\t\tdev_name = malloc(sizeof(dir->d_name));\n+\t\tif (!dev_name) {\n+\t\t\tFSLMC_VFIO_LOG(ERR, \"name: Unable to allocate memory\");\n+\t\t\tgoto FAILURE;\n+\t\t}\n+\t\tstrcpy(dev_name, dir->d_name);\n+\t\tobject_type = strtok(dir->d_name, \".\");\n+\t\ttemp_obj = strtok(NULL, \".\");\n+\t\tsscanf(temp_obj, \"%d\", &object_id);\n+\t\tFSLMC_VFIO_LOG(DEBUG, \" - %s \", dev_name);\n+\n+\t\t/* getting the device fd*/\n+\t\tdev_fd = ioctl(group->fd, VFIO_GROUP_GET_DEVICE_FD, dev_name);\n+\t\tif (dev_fd < 0) {\n+\t\t\tFSLMC_VFIO_LOG(ERR, \"VFIO_GROUP_GET_DEVICE_FD error\"\n+\t\t\t\t    \" Device fd: %s, Group: %d\",\n+\t\t\t\t    dev_name, group->fd);\n+\t\t\tfree(dev_name);\n+\t\t\tgoto FAILURE;\n+\t\t}\n+\n+\t\tfree(dev_name);\n+\t\tvdev = &group->vfio_device[group->object_index++];\n+\t\tvdev->fd = dev_fd;\n+\t\tvdev->index = i;\n+\t\ti++;\n+\t\t/* Get Device inofrmation */\n+\t\tif (ioctl(vdev->fd, VFIO_DEVICE_GET_INFO, &device_info)) {\n+\t\t\tFSLMC_VFIO_LOG(ERR, \"DPAA2 VFIO_DEVICE_GET_INFO fail\");\n+\t\t\tgoto FAILURE;\n+\t\t}\n+\t}\n+\tclosedir(d);\n+\n+\treturn 0;\n+\n+FAILURE:\n+\tfree(group->vfio_device);\n+\tgroup->vfio_device = NULL;\n+\treturn -1;\n+}\n+\n+\n+int fslmc_vfio_setup_group(void)\n+{\n+\tchar path[PATH_MAX];\n+\tchar iommu_group_path[PATH_MAX], *group_name;\n+\tstruct fslmc_vfio_group *group = NULL;\n+\tstruct stat st;\n+\tint groupid;\n+\tint ret, len, i;\n+\tchar *container;\n+\tstruct vfio_group_status status = { .argsz = sizeof(status) };\n+\n+\t/* if already done once */\n+\tif (container_device_fd)\n+\t\treturn 0;\n+\n+\tcontainer = getenv(\"DPRC\");\n+\n+\tif (container == NULL) {\n+\t\tFSLMC_VFIO_LOG(ERR, \"VFIO container not set in env DPRC\");\n+\t\treturn -1;\n+\t}\n+\tRTE_LOG(INFO, PMD, \"DPAA2: Processing Container = %s\\n\", container);\n+\tsnprintf(path, sizeof(path), \"%s/%s\",\n+\t\t SYSFS_DPAA2_MC_DEVICES, container);\n+\n+\t/* Check whether fsl-mc container exists or not */\n+\tFSLMC_VFIO_LOG(DEBUG, \"container device path = %s\", path);\n+\tif (stat(path, &st) < 0) {\n+\t\tFSLMC_VFIO_LOG(ERR, \"Error (%d) getting FSL-MC dev (%s)\",\n+\t\t\t     errno,  path);\n+\t\treturn -errno;\n+\t}\n+\n+\t/* DPRC container exists. Now checkout the IOMMU Group */\n+\tstrncat(path, \"/iommu_group\", sizeof(path) - strlen(path) - 1);\n+\n+\tlen = readlink(path, iommu_group_path, PATH_MAX);\n+\tif (len == -1) {\n+\t\tFSLMC_VFIO_LOG(ERR, \"Error no iommu_group for device\"\n+\t\t\t       \"   %s: len = %d, (errno = %d)\",\n+\t\t\t       path, len, errno);\n+\t\treturn -errno;\n+\t}\n+\n+\tiommu_group_path[len] = 0;\n+\tgroup_name = basename(iommu_group_path);\n+\tif (sscanf(group_name, \"%d\", &groupid) != 1) {\n+\t\tFSLMC_VFIO_LOG(ERR, \"error in VFIO groupname reading %s\", path);\n+\t\treturn -errno;\n+\t}\n+\n+\tFSLMC_VFIO_LOG(DEBUG, \"VFIO iommu group id = %d\", groupid);\n+\n+\t/* Check if group already exists */\n+\tfor (i = 0; i < VFIO_MAX_GRP; i++) {\n+\t\tgroup = &vfio_groups[i];\n+\t\tif (group->groupid == groupid) {\n+\t\t\tFSLMC_VFIO_LOG(ERR, \"groupid already exists %d\",\n+\t\t\t\t     groupid);\n+\t\t\treturn 0;\n+\t\t}\n+\t}\n+\n+\t/* Open the VFIO file corresponding to the IOMMU group */\n+\tsnprintf(path, sizeof(path), \"/dev/vfio/%d\", groupid);\n+\n+\tgroup->fd = open(path, O_RDWR);\n+\tif (group->fd < 0) {\n+\t\tFSLMC_VFIO_LOG(ERR, \" VFIO error opening %s\", path);\n+\t\treturn -1;\n+\t}\n+\n+\t/* Test & Verify that group is VIABLE & AVAILABLE */\n+\tif (ioctl(group->fd, VFIO_GROUP_GET_STATUS, &status)) {\n+\t\tFSLMC_VFIO_LOG(ERR, \" VFIO error getting group status\");\n+\t\tclose(group->fd);\n+\t\treturn -1;\n+\t}\n+\tif (!(status.flags & VFIO_GROUP_FLAGS_VIABLE)) {\n+\t\tFSLMC_VFIO_LOG(ERR, \"VFIO group not viable\");\n+\t\tclose(group->fd);\n+\t\treturn -1;\n+\t}\n+\t/* Since Group is VIABLE, Store the groupid */\n+\tgroup->groupid = groupid;\n+\n+\t/* check if group does not have a container yet */\n+\tif (!(status.flags & VFIO_GROUP_FLAGS_CONTAINER_SET)) {\n+\t\t/* Now connect this IOMMU group to given container */\n+\t\tif (vfio_connect_container(group)) {\n+\t\t\tFSLMC_VFIO_LOG(ERR, \"VFIO error connecting container\"\n+\t\t\t\t       \" with groupid %d\", groupid);\n+\t\t\tclose(group->fd);\n+\t\t\treturn -1;\n+\t\t}\n+\t}\n+\n+\t/* Get Device information */\n+\tret = ioctl(group->fd, VFIO_GROUP_GET_DEVICE_FD, container);\n+\tif (ret < 0) {\n+\t\tFSLMC_VFIO_LOG(ERR, \"VFIO error getting device %s fd from\"\n+\t\t\t       \" group  %d\", container, group->groupid);\n+\t\treturn ret;\n+\t}\n+\tcontainer_device_fd = ret;\n+\tFSLMC_VFIO_LOG(DEBUG, \"VFIO Container FD is [0x%X]\",\n+\t\t     container_device_fd);\n+\n+\treturn 0;\n+}\ndiff --git a/drivers/bus/fslmc/fslmc_vfio.h b/drivers/bus/fslmc/fslmc_vfio.h\nnew file mode 100644\nindex 0000000..c5a42fe\n--- /dev/null\n+++ b/drivers/bus/fslmc/fslmc_vfio.h\n@@ -0,0 +1,74 @@\n+/*-\n+ *   BSD LICENSE\n+ *\n+ *   Copyright (c) 2015-2016 Freescale Semiconductor, Inc. All rights reserved.\n+ *   Copyright (c) 2016 NXP. All rights reserved.\n+ *\n+ *   Redistribution and use in source and binary forms, with or without\n+ *   modification, are permitted provided that the following conditions\n+ *   are met:\n+ *\n+ *     * Redistributions of source code must retain the above copyright\n+ *       notice, this list of conditions and the following disclaimer.\n+ *     * Redistributions in binary form must reproduce the above copyright\n+ *       notice, this list of conditions and the following disclaimer in\n+ *       the documentation and/or other materials provided with the\n+ *       distribution.\n+ *     * Neither the name of Freescale Semiconductor, Inc nor the names of its\n+ *       contributors may be used to endorse or promote products derived\n+ *       from this software without specific prior written permission.\n+ *\n+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#ifndef _FSLMC_VFIO_H_\n+#define _FSLMC_VFIO_H_\n+\n+#include \"eal_vfio.h\"\n+\n+#define DPAA2_VENDOR_ID\t\t0x1957\n+#define DPAA2_MC_DPNI_DEVID\t7\n+#define DPAA2_MC_DPSECI_DEVID\t3\n+\n+#define VFIO_MAX_GRP 1\n+\n+typedef struct fslmc_vfio_device {\n+\tint fd; /* fslmc root container device ?? */\n+\tint index; /*index of child object */\n+\tstruct fslmc_vfio_device *child; /* Child object */\n+} fslmc_vfio_device;\n+\n+typedef struct fslmc_vfio_group {\n+\tint fd; /* /dev/vfio/\"groupid\" */\n+\tint groupid;\n+\tstruct fslmc_vfio_container *container;\n+\tint object_index;\n+\tstruct fslmc_vfio_device *vfio_device;\n+} fslmc_vfio_group;\n+\n+typedef struct fslmc_vfio_container {\n+\tint fd; /* /dev/vfio/vfio */\n+\tint used;\n+\tint index; /* index in group list */\n+\tstruct fslmc_vfio_group *group_list[VFIO_MAX_GRP];\n+} fslmc_vfio_container;\n+\n+int vfio_dmamap_mem_region(\n+\tuint64_t vaddr,\n+\tuint64_t iova,\n+\tuint64_t size);\n+\n+int fslmc_vfio_setup_group(void);\n+int fslmc_vfio_process_group(struct rte_bus *bus);\n+\n+#endif /* _FSLMC_VFIO_H_ */\n",
    "prefixes": [
        "dpdk-dev",
        "PATCHv2",
        "11/34"
    ]
}