get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 56432,
    "url": "http://patches.dpdk.org/api/patches/56432/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190715084442.14686-4-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": "<20190715084442.14686-4-hemant.agrawal@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190715084442.14686-4-hemant.agrawal@nxp.com",
    "date": "2019-07-15T08:44:40",
    "name": "[v3,3/5] bus/fslmc: dynamic iommu mode detection",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "9c90f34b32482273c490ad9c97cb11588bcdbbf6",
    "submitter": {
        "id": 477,
        "url": "http://patches.dpdk.org/api/people/477/?format=api",
        "name": "Hemant Agrawal",
        "email": "hemant.agrawal@nxp.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20190715084442.14686-4-hemant.agrawal@nxp.com/mbox/",
    "series": [
        {
            "id": 5489,
            "url": "http://patches.dpdk.org/api/series/5489/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=5489",
            "date": "2019-07-15T08:44:37",
            "name": "FSLMC bus enchancements",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/5489/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/56432/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/56432/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 16C3B1B993;\n\tMon, 15 Jul 2019 10:46:10 +0200 (CEST)",
            "from inva021.nxp.com (inva021.nxp.com [92.121.34.21])\n\tby dpdk.org (Postfix) with ESMTP id 1243D3772\n\tfor <dev@dpdk.org>; Mon, 15 Jul 2019 10:46:03 +0200 (CEST)",
            "from inva021.nxp.com (localhost [127.0.0.1])\n\tby inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id C31062001B5;\n\tMon, 15 Jul 2019 10:46:03 +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 6BAA420000E;\n\tMon, 15 Jul 2019 10:46:01 +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 3459F402A8;\n\tMon, 15 Jul 2019 16:45:58 +0800 (SGT)"
        ],
        "From": "Hemant Agrawal <hemant.agrawal@nxp.com>",
        "To": "dev@dpdk.org",
        "Cc": "thomas@monjalon.net,\n\tShreyansh Jain <shreyansh.jain@nxp.com>",
        "Date": "Mon, 15 Jul 2019 14:14:40 +0530",
        "Message-Id": "<20190715084442.14686-4-hemant.agrawal@nxp.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20190715084442.14686-1-hemant.agrawal@nxp.com>",
        "References": "<20190627093343.5171-2-hemant.agrawal@nxp.com>\n\t<20190715084442.14686-1-hemant.agrawal@nxp.com>",
        "X-Virus-Scanned": "ClamAV using ClamSMTP",
        "Subject": "[dpdk-dev] [PATCH v3 3/5] bus/fslmc: dynamic iommu mode detection",
        "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: Shreyansh Jain <shreyansh.jain@nxp.com>\n\nThis patch adds following:\n1. 'g_container' variable name is not right way to represent the\nFSLMC container. Renaming it to fslmc_container.\n2. dynamic selection of IOMMU mode based on run environment\n\nSigned-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>\n---\n drivers/bus/fslmc/fslmc_vfio.c | 38 +++++++++++++++++++++++-----------\n 1 file changed, 26 insertions(+), 12 deletions(-)",
    "diff": "diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c\nindex 44e4fa6e2..1383af4f1 100644\n--- a/drivers/bus/fslmc/fslmc_vfio.c\n+++ b/drivers/bus/fslmc/fslmc_vfio.c\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-2018 NXP\n+ *   Copyright 2016-2019 NXP\n  *\n  */\n \n@@ -49,7 +49,8 @@\n static struct fslmc_vfio_group vfio_group;\n static struct fslmc_vfio_container vfio_container;\n static int container_device_fd;\n-static char *g_container;\n+static char *fslmc_container;\n+static int fslmc_iommu_type;\n static uint32_t *msi_intr_vaddr;\n void *(*rte_mcp_ptr_list);\n \n@@ -71,7 +72,7 @@ fslmc_get_container_group(int *groupid)\n \tint ret;\n \tchar *container;\n \n-\tif (!g_container) {\n+\tif (!fslmc_container) {\n \t\tcontainer = getenv(\"DPRC\");\n \t\tif (container == NULL) {\n \t\t\tDPAA2_BUS_DEBUG(\"DPAA2: DPRC not available\");\n@@ -83,23 +84,26 @@ fslmc_get_container_group(int *groupid)\n \t\t\treturn -1;\n \t\t}\n \n-\t\tg_container = strdup(container);\n-\t\tif (!g_container) {\n+\t\tfslmc_container = strdup(container);\n+\t\tif (!fslmc_container) {\n \t\t\tDPAA2_BUS_ERR(\"Mem alloc failure; Container name\");\n \t\t\treturn -ENOMEM;\n \t\t}\n \t}\n \n+\tfslmc_iommu_type = (rte_vfio_noiommu_is_enabled() == 1) ?\n+\t\tRTE_VFIO_NOIOMMU : VFIO_TYPE1_IOMMU;\n+\n \t/* get group number */\n \tret = rte_vfio_get_group_num(SYSFS_FSL_MC_DEVICES,\n-\t\t\t\t     g_container, groupid);\n+\t\t\t\t     fslmc_container, groupid);\n \tif (ret <= 0) {\n-\t\tDPAA2_BUS_ERR(\"Unable to find %s IOMMU group\", g_container);\n+\t\tDPAA2_BUS_ERR(\"Unable to find %s IOMMU group\", fslmc_container);\n \t\treturn -1;\n \t}\n \n \tDPAA2_BUS_DEBUG(\"Container: %s has VFIO iommu group id = %d\",\n-\t\t\tg_container, *groupid);\n+\t\t\tfslmc_container, *groupid);\n \n \treturn 0;\n }\n@@ -132,7 +136,7 @@ vfio_connect_container(void)\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+\tif (ioctl(fd, VFIO_CHECK_EXTENSION, fslmc_iommu_type)) {\n \t\t/* Connect group to container */\n \t\tret = ioctl(vfio_group.fd, VFIO_GROUP_SET_CONTAINER, &fd);\n \t\tif (ret) {\n@@ -141,7 +145,7 @@ vfio_connect_container(void)\n \t\t\treturn -errno;\n \t\t}\n \n-\t\tret = ioctl(fd, VFIO_SET_IOMMU, VFIO_TYPE1_IOMMU);\n+\t\tret = ioctl(fd, VFIO_SET_IOMMU, fslmc_iommu_type);\n \t\tif (ret) {\n \t\t\tDPAA2_BUS_ERR(\"Failed to setup VFIO iommu\");\n \t\t\tclose(fd);\n@@ -261,6 +265,11 @@ fslmc_map_dma(uint64_t vaddr, rte_iova_t iovaddr __rte_unused, size_t len)\n \t};\n \tint ret;\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 \tdma_map.size = len;\n \tdma_map.vaddr = vaddr;\n \n@@ -300,6 +309,11 @@ fslmc_unmap_dma(uint64_t vaddr, uint64_t iovaddr __rte_unused, size_t len)\n \t};\n \tint ret;\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 \tdma_unmap.size = len;\n \tdma_unmap.iova = vaddr;\n \n@@ -819,10 +833,10 @@ fslmc_vfio_setup_group(void)\n \t}\n \n \t/* Get Device information */\n-\tret = ioctl(vfio_group.fd, VFIO_GROUP_GET_DEVICE_FD, g_container);\n+\tret = ioctl(vfio_group.fd, VFIO_GROUP_GET_DEVICE_FD, fslmc_container);\n \tif (ret < 0) {\n \t\tDPAA2_BUS_ERR(\"Error getting device %s fd from group %d\",\n-\t\t\t      g_container, vfio_group.groupid);\n+\t\t\t      fslmc_container, vfio_group.groupid);\n \t\tclose(vfio_group.fd);\n \t\trte_vfio_clear_group(vfio_group.fd);\n \t\treturn ret;\n",
    "prefixes": [
        "v3",
        "3/5"
    ]
}