get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 37695,
    "url": "https://patches.dpdk.org/api/patches/37695/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/afac28d74c7c692a75fb81f514909f17f700eef0.1523296700.git.anatoly.burakov@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": "<afac28d74c7c692a75fb81f514909f17f700eef0.1523296700.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/afac28d74c7c692a75fb81f514909f17f700eef0.1523296700.git.anatoly.burakov@intel.com",
    "date": "2018-04-09T18:00:29",
    "name": "[dpdk-dev,v5,26/70] bus/fslmc: use memseg walk instead of iteration",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "c6e54783320f27e7f619ee99e509b8687a987ec8",
    "submitter": {
        "id": 4,
        "url": "https://patches.dpdk.org/api/people/4/?format=api",
        "name": "Burakov, Anatoly",
        "email": "anatoly.burakov@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/afac28d74c7c692a75fb81f514909f17f700eef0.1523296700.git.anatoly.burakov@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/37695/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/37695/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 13ED51B984;\n\tMon,  9 Apr 2018 20:02:38 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id 1C0931B86A\n\tfor <dev@dpdk.org>; Mon,  9 Apr 2018 20:01:32 +0200 (CEST)",
            "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t09 Apr 2018 11:01:32 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby fmsmga005.fm.intel.com with ESMTP; 09 Apr 2018 11:01:28 -0700",
            "from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com\n\t[10.237.217.45])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tw39I1SkH031104; Mon, 9 Apr 2018 19:01:28 +0100",
            "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id w39I1SvH027863;\n\tMon, 9 Apr 2018 19:01:28 +0100",
            "(from aburakov@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id w39I1RmY027859;\n\tMon, 9 Apr 2018 19:01:27 +0100"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.48,427,1517904000\"; d=\"scan'208\";a=\"219003861\"",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Hemant Agrawal <hemant.agrawal@nxp.com>,\n\tShreyansh Jain <shreyansh.jain@nxp.com>, keith.wiles@intel.com,\n\tjianfeng.tan@intel.com, andras.kovacs@ericsson.com,\n\tlaszlo.vadkeri@ericsson.com, benjamin.walker@intel.com,\n\tbruce.richardson@intel.com, thomas@monjalon.net,\n\tkonstantin.ananyev@intel.com, kuralamudhan.ramakrishnan@intel.com,\n\tlouise.m.daly@intel.com, nelio.laranjeiro@6wind.com,\n\tyskoh@mellanox.com, pepperjo@japf.ch, jerin.jacob@caviumnetworks.com, \n\tolivier.matz@6wind.com, gowrishankar.m@linux.vnet.ibm.com",
        "Date": "Mon,  9 Apr 2018 19:00:29 +0100",
        "Message-Id": "<afac28d74c7c692a75fb81f514909f17f700eef0.1523296700.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "In-Reply-To": [
            "<cover.1523296700.git.anatoly.burakov@intel.com>",
            "<cover.1523296700.git.anatoly.burakov@intel.com>"
        ],
        "References": [
            "<cover.1523296700.git.anatoly.burakov@intel.com>",
            "<cover.1523218215.git.anatoly.burakov@intel.com>\n\t<cover.1523296700.git.anatoly.burakov@intel.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH v5 26/70] bus/fslmc: use memseg walk instead of\n\titeration",
        "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://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": "<https://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": "Reduce dependency on internal details of EAL memory subsystem, and\nsimplify code.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\nAcked-by: Shreyansh Jain <shreyansh.jain@nxp.com>\nTested-by: Santosh Shukla <Santosh.Shukla@caviumnetworks.com>\nTested-by: Hemant Agrawal <hemant.agrawal@nxp.com>\n---\n drivers/bus/fslmc/fslmc_vfio.c | 78 ++++++++++++++++++++++--------------------\n 1 file changed, 41 insertions(+), 37 deletions(-)",
    "diff": "diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c\nindex 4291871..0c048dc 100644\n--- a/drivers/bus/fslmc/fslmc_vfio.c\n+++ b/drivers/bus/fslmc/fslmc_vfio.c\n@@ -189,17 +189,51 @@ static int vfio_map_irq_region(struct fslmc_vfio_group *group)\n \treturn -errno;\n }\n \n-int rte_fslmc_vfio_dmamap(void)\n+static int\n+fslmc_vfio_map(const struct rte_memseg *ms, void *arg)\n {\n-\tint ret;\n+\tint *n_segs = arg;\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+\tint ret;\n+\n+\tdma_map.size = ms->len;\n+\tdma_map.vaddr = ms->addr_64;\n+#ifdef RTE_LIBRTE_DPAA2_USE_PHYS_IOVA\n+\tdma_map.iova = ms->iova;\n+#else\n+\tdma_map.iova = dma_map.vaddr;\n+#endif\n+\n+\t/* SET DMA MAP for IOMMU */\n+\tgroup = &vfio_group;\n+\n+\tif (!group->container) {\n+\t\tDPAA2_BUS_ERR(\"Container is not connected \");\n+\t\treturn -1;\n+\t}\n+\n+\tDPAA2_BUS_DEBUG(\"-->Initial SHM Virtual ADDR %llX\",\n+\t\t\tdma_map.vaddr);\n+\tDPAA2_BUS_DEBUG(\"-----> DMA size 0x%llX\", dma_map.size);\n+\tret = ioctl(group->container->fd, VFIO_IOMMU_MAP_DMA,\n+\t\t\t&dma_map);\n+\tif (ret) {\n+\t\tDPAA2_BUS_ERR(\"VFIO_IOMMU_MAP_DMA API(errno = %d)\",\n+\t\t\t\terrno);\n+\t\treturn -1;\n+\t}\n+\t(*n_segs)++;\n+\treturn 0;\n+}\n \n-\tint i;\n+int rte_fslmc_vfio_dmamap(void)\n+{\n \tconst struct rte_memseg *memseg;\n+\tint i = 0;\n \n \tif (is_dma_done)\n \t\treturn 0;\n@@ -210,51 +244,21 @@ int rte_fslmc_vfio_dmamap(void)\n \t\treturn -ENODEV;\n \t}\n \n-\tfor (i = 0; i < RTE_MAX_MEMSEG; i++) {\n-\t\tif (memseg[i].addr == NULL && memseg[i].len == 0) {\n-\t\t\tDPAA2_BUS_DEBUG(\"Total %d segments found\", i);\n-\t\t\tbreak;\n-\t\t}\n-\n-\t\tdma_map.size = memseg[i].len;\n-\t\tdma_map.vaddr = memseg[i].addr_64;\n-#ifdef RTE_LIBRTE_DPAA2_USE_PHYS_IOVA\n-\t\tdma_map.iova = memseg[i].iova;\n-#else\n-\t\tdma_map.iova = dma_map.vaddr;\n-#endif\n-\n-\t\t/* SET DMA MAP for IOMMU */\n-\t\tgroup = &vfio_group;\n-\n-\t\tif (!group->container) {\n-\t\t\tDPAA2_BUS_ERR(\"Container is not connected\");\n-\t\t\treturn -1;\n-\t\t}\n-\n-\t\tDPAA2_BUS_DEBUG(\"-->Initial SHM Virtual ADDR %llX\",\n-\t\t\t\tdma_map.vaddr);\n-\t\tDPAA2_BUS_DEBUG(\"-----> DMA size 0x%llX\", dma_map.size);\n-\t\tret = ioctl(group->container->fd, VFIO_IOMMU_MAP_DMA,\n-\t\t\t    &dma_map);\n-\t\tif (ret) {\n-\t\t\tDPAA2_BUS_ERR(\"Unable to map DMA address (errno = %d)\",\n-\t\t\t\t      errno);\n-\t\t\treturn ret;\n-\t\t}\n-\t}\n+\tif (rte_memseg_walk(fslmc_vfio_map, &i) < 0)\n+\t\treturn -1;\n \n \t/* Verifying that at least single segment is available */\n \tif (i <= 0) {\n \t\tDPAA2_BUS_ERR(\"No Segments found for VFIO Mapping\");\n \t\treturn -1;\n \t}\n+\tDPAA2_BUS_DEBUG(\"Total %d segments found.\", i);\n \n \t/* TODO - This is a W.A. as VFIO currently does not add the mapping of\n \t * the interrupt region to SMMU. This should be removed once the\n \t * support is added in the Kernel.\n \t */\n-\tvfio_map_irq_region(group);\n+\tvfio_map_irq_region(&vfio_group);\n \n \tis_dma_done = 1;\n \n",
    "prefixes": [
        "dpdk-dev",
        "v5",
        "26/70"
    ]
}