get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 55459,
    "url": "http://patches.dpdk.org/api/patches/55459/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190627093343.5171-6-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": "<20190627093343.5171-6-hemant.agrawal@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190627093343.5171-6-hemant.agrawal@nxp.com",
    "date": "2019-06-27T09:33:43",
    "name": "[v2,5/5] mempool/dpaa2: vfio dmamap for user allocated memory",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "ed2a04396b559e0a10a33c76aea340f02d630aa9",
    "submitter": {
        "id": 477,
        "url": "http://patches.dpdk.org/api/people/477/?format=api",
        "name": "Hemant Agrawal",
        "email": "hemant.agrawal@nxp.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20190627093343.5171-6-hemant.agrawal@nxp.com/mbox/",
    "series": [
        {
            "id": 5192,
            "url": "http://patches.dpdk.org/api/series/5192/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=5192",
            "date": "2019-06-27T09:33:38",
            "name": "FSLMC bus enchancements",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/5192/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/55459/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/55459/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 729E737B0;\n\tThu, 27 Jun 2019 11:35:47 +0200 (CEST)",
            "from inva021.nxp.com (inva021.nxp.com [92.121.34.21])\n\tby dpdk.org (Postfix) with ESMTP id 2912025D9\n\tfor <dev@dpdk.org>; Thu, 27 Jun 2019 11:35:35 +0200 (CEST)",
            "from inva021.nxp.com (localhost [127.0.0.1])\n\tby inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id D9855200748;\n\tThu, 27 Jun 2019 11:35:34 +0200 (CEST)",
            "from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com\n\t[165.114.16.14])\n\tby inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id E41DC200268;\n\tThu, 27 Jun 2019 11:35:32 +0200 (CEST)",
            "from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net\n\t[10.232.133.63])\n\tby invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 7FFEC40323;\n\tThu, 27 Jun 2019 17:35:28 +0800 (SGT)"
        ],
        "From": "Hemant Agrawal <hemant.agrawal@nxp.com>",
        "To": "dev@dpdk.org",
        "Cc": "ferruh.yigit@intel.com",
        "Date": "Thu, 27 Jun 2019 15:03:43 +0530",
        "Message-Id": "<20190627093343.5171-6-hemant.agrawal@nxp.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20190627093343.5171-1-hemant.agrawal@nxp.com>",
        "References": "<20190625104411.19565-1-hemant.agrawal@nxp.com>\n\t<20190627093343.5171-1-hemant.agrawal@nxp.com>",
        "X-Virus-Scanned": "ClamAV using ClamSMTP",
        "Subject": "[dpdk-dev] [PATCH v2 5/5] mempool/dpaa2: vfio dmamap for user\n\tallocated memory",
        "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": "From: Sachin Saxena <sachin.saxena@nxp.com>\n\nSigned-off-by: Sachin Saxena <sachin.saxena@nxp.com>\n---\n drivers/bus/fslmc/fslmc_vfio.c              | 39 +++++++++++++++++++++\n drivers/bus/fslmc/fslmc_vfio.h              |  4 ++-\n drivers/bus/fslmc/rte_bus_fslmc_version.map |  6 ++++\n drivers/mempool/dpaa2/dpaa2_hw_mempool.c    | 13 +++++++\n 4 files changed, 61 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c\nindex 711780e74..e44bd31b9 100644\n--- a/drivers/bus/fslmc/fslmc_vfio.c\n+++ b/drivers/bus/fslmc/fslmc_vfio.c\n@@ -358,6 +358,45 @@ fslmc_dmamap_seg(const struct rte_memseg_list *msl __rte_unused,\n \treturn ret;\n }\n \n+__rte_experimental\n+int rte_fslmc_vfio_mem_dmamap(uint64_t vaddr, uint64_t iova, uint64_t size)\n+{\n+\tint ret;\n+\tstruct fslmc_vfio_group *group;\n+\tstruct vfio_iommu_type1_dma_map dma_map = {\n+\t\t.argsz = sizeof(struct vfio_iommu_type1_dma_map),\n+\t\t.flags = VFIO_DMA_MAP_FLAG_READ | VFIO_DMA_MAP_FLAG_WRITE,\n+\t};\n+\n+\tif (fslmc_iommu_type == RTE_VFIO_NOIOMMU) {\n+\t\tDPAA2_BUS_DEBUG(\"Running in NOIOMMU mode\");\n+\t\treturn 0;\n+\t}\n+\n+\t/* SET DMA MAP for IOMMU */\n+\tgroup = &vfio_group;\n+\tif (!group->container) {\n+\t\tDPAA2_BUS_ERR(\"Container is not connected\");\n+\t\treturn -1;\n+\t}\n+\n+\tdma_map.size = size;\n+\tdma_map.vaddr = vaddr;\n+\tdma_map.iova = iova;\n+\n+\tDPAA2_BUS_DEBUG(\"VFIO dmamap 0x%llx:0x%llx, size 0x%llx\\n\",\n+\t\t\tdma_map.vaddr, dma_map.iova, dma_map.size);\n+\tret = ioctl(group->container->fd, VFIO_IOMMU_MAP_DMA,\n+\t\t    &dma_map);\n+\tif (ret) {\n+\t\tprintf(\"Unable to map DMA address (errno = %d)\\n\",\n+\t\t\terrno);\n+\t\treturn ret;\n+\t}\n+\n+\treturn 0;\n+}\n+\n int rte_fslmc_vfio_dmamap(void)\n {\n \tint i = 0, ret;\ndiff --git a/drivers/bus/fslmc/fslmc_vfio.h b/drivers/bus/fslmc/fslmc_vfio.h\nindex 9e2c4feef..e877255ea 100644\n--- a/drivers/bus/fslmc/fslmc_vfio.h\n+++ b/drivers/bus/fslmc/fslmc_vfio.h\n@@ -1,7 +1,7 @@\n /* SPDX-License-Identifier: BSD-3-Clause\n  *\n  *   Copyright (c) 2015-2016 Freescale Semiconductor, Inc. All rights reserved.\n- *   Copyright 2016 NXP\n+ *   Copyright 2016,2019 NXP\n  *\n  */\n \n@@ -50,5 +50,7 @@ int fslmc_vfio_process_group(void);\n char *fslmc_get_container(void);\n int fslmc_get_container_group(int *gropuid);\n int rte_fslmc_vfio_dmamap(void);\n+__rte_experimental\n+int rte_fslmc_vfio_mem_dmamap(uint64_t vaddr, uint64_t iova, uint64_t size);\n \n #endif /* _FSLMC_VFIO_H_ */\ndiff --git a/drivers/bus/fslmc/rte_bus_fslmc_version.map b/drivers/bus/fslmc/rte_bus_fslmc_version.map\nindex e86007384..4da787236 100644\n--- a/drivers/bus/fslmc/rte_bus_fslmc_version.map\n+++ b/drivers/bus/fslmc/rte_bus_fslmc_version.map\n@@ -141,3 +141,9 @@ DPDK_19.05 {\n \tqbman_result_eqresp_set_rspid;\n \tqbman_swp_enqueue_multiple_fd;\n } DPDK_18.11;\n+\n+EXPERIMENTAL {\n+\tglobal:\n+\n+\trte_fslmc_vfio_mem_dmamap;\n+};\ndiff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c\nindex da66577cc..f26c30b00 100644\n--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c\n+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c\n@@ -23,6 +23,7 @@\n #include <rte_dev.h>\n #include \"rte_dpaa2_mempool.h\"\n \n+#include \"fslmc_vfio.h\"\n #include <fslmc_logs.h>\n #include <mc/fsl_dpbp.h>\n #include <portal/dpaa2_hw_pvt.h>\n@@ -405,6 +406,18 @@ dpaa2_populate(struct rte_mempool *mp, unsigned int max_objs,\n \t      void *vaddr, rte_iova_t paddr, size_t len,\n \t      rte_mempool_populate_obj_cb_t *obj_cb, void *obj_cb_arg)\n {\n+\tstruct rte_memseg_list *msl;\n+\t/* The memsegment list exists incase the memory is not external.\n+\t * So, DMA-Map is required only when memory is provided by user,\n+\t * i.e. External.\n+\t */\n+\tmsl = rte_mem_virt2memseg_list(vaddr);\n+\n+\tif (!msl) {\n+\t\tDPAA2_MEMPOOL_DEBUG(\"Memsegment is External.\\n\");\n+\t\trte_fslmc_vfio_mem_dmamap((size_t)vaddr,\n+\t\t\t\t(size_t)paddr, (size_t)len);\n+\t}\n \t/* Insert entry into the PA->VA Table */\n \tdpaax_iova_table_update(paddr, vaddr, len);\n \n",
    "prefixes": [
        "v2",
        "5/5"
    ]
}