get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 10057,
    "url": "https://patches.dpdk.org/api/patches/10057/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20160122172159.5655.55830.stgit@gimli.home/",
    "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": "<20160122172159.5655.55830.stgit@gimli.home>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20160122172159.5655.55830.stgit@gimli.home",
    "date": "2016-01-22T17:23:31",
    "name": "[dpdk-dev] vfio/noiommu: Don't use iommu_present() to track fake groups",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": true,
    "hash": "2573d0153664ead6c8a9204e83c7433ffe6eafc8",
    "submitter": {
        "id": 391,
        "url": "https://patches.dpdk.org/api/people/391/?format=api",
        "name": "Alex Williamson",
        "email": "alex.williamson@redhat.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20160122172159.5655.55830.stgit@gimli.home/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/10057/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/10057/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 D426491A0;\n\tFri, 22 Jan 2016 18:23:33 +0100 (CET)",
            "from mx1.redhat.com (mx1.redhat.com [209.132.183.28])\n\tby dpdk.org (Postfix) with ESMTP id 00962919D\n\tfor <dev@dpdk.org>; Fri, 22 Jan 2016 18:23:32 +0100 (CET)",
            "from int-mx14.intmail.prod.int.phx2.redhat.com\n\t(int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27])\n\tby mx1.redhat.com (Postfix) with ESMTPS id 6A9F13B75A;\n\tFri, 22 Jan 2016 17:23:32 +0000 (UTC)",
            "from gimli.home (ovpn-113-148.phx2.redhat.com [10.3.113.148])\n\tby int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with\n\tESMTP id u0MHNVqV025742; Fri, 22 Jan 2016 12:23:31 -0500"
        ],
        "From": "Alex Williamson <alex.williamson@redhat.com>",
        "To": "alex.williamson@redhat.com",
        "Date": "Fri, 22 Jan 2016 10:23:31 -0700",
        "Message-ID": "<20160122172159.5655.55830.stgit@gimli.home>",
        "User-Agent": "StGit/0.17.1-dirty",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "7bit",
        "X-Scanned-By": "MIMEDefang 2.68 on 10.5.11.27",
        "Cc": "kvm@vger.kernel.org, aik@ozlabs.ru, linux-kernel@vger.kernel.org,\n\tdev@dpdk.org",
        "Subject": "[dpdk-dev] [PATCH] vfio/noiommu: Don't use iommu_present() to track\n\tfake groups",
        "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": "Using iommu_present() to determine whether an IOMMU group is real or\nfake has some problems.  First, apparently Power systems don't\nregister an IOMMU on the device bus, so the groups and containers get\nmarked as noiommu and then won't bind to their actual IOMMU driver.\nSecond, I expect we'll run into the same issue as we try to support\nvGPUs through vfio, since they're likely to emulate this behavior of\ncreating an IOMMU group on a virtual device and then providing a vfio\nIOMMU backend tailored to the sort of isolation they provide, which\nwon't necessarily be fully compatible with the IOMMU API.\n\nThe solution here is to use the existing iommudata interface to IOMMU\ngroups, which allows us to easily identify the fake groups we've\ncreated for noiommu purposes.  The iommudata we set is purely\narbitrary since we're only comparing the address, so we use the\naddress of the noiommu switch itself.\n\nReported-by: Alexey Kardashevskiy <aik@ozlabs.ru>\nFixes: 03a76b60f8ba (\"vfio: Include No-IOMMU mode\")\nSigned-off-by: Alex Williamson <alex.williamson@redhat.com>\n---\n\nCopying some DPDK folks and would appreciate validation that this\nstill works for the intended no-iommu use case.  Thanks!\n\n drivers/vfio/vfio.c |   24 ++++++++++--------------\n 1 file changed, 10 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c\nindex 82f25cc..ecca316 100644\n--- a/drivers/vfio/vfio.c\n+++ b/drivers/vfio/vfio.c\n@@ -123,8 +123,8 @@ struct iommu_group *vfio_iommu_group_get(struct device *dev)\n \t/*\n \t * With noiommu enabled, an IOMMU group will be created for a device\n \t * that doesn't already have one and doesn't have an iommu_ops on their\n-\t * bus.  We use iommu_present() again in the main code to detect these\n-\t * fake groups.\n+\t * bus.  We set iommudata simply to be able to identify these groups\n+\t * as special use and for reclamation later.\n \t */\n \tif (group || !noiommu || iommu_present(dev->bus))\n \t\treturn group;\n@@ -134,6 +134,7 @@ struct iommu_group *vfio_iommu_group_get(struct device *dev)\n \t\treturn NULL;\n \n \tiommu_group_set_name(group, \"vfio-noiommu\");\n+\tiommu_group_set_iommudata(group, &noiommu, NULL);\n \tret = iommu_group_add_device(group, dev);\n \tiommu_group_put(group);\n \tif (ret)\n@@ -158,7 +159,7 @@ EXPORT_SYMBOL_GPL(vfio_iommu_group_get);\n void vfio_iommu_group_put(struct iommu_group *group, struct device *dev)\n {\n #ifdef CONFIG_VFIO_NOIOMMU\n-\tif (!iommu_present(dev->bus))\n+\tif (iommu_group_get_iommudata(group) == &noiommu)\n \t\tiommu_group_remove_device(dev);\n #endif\n \n@@ -190,16 +191,10 @@ static long vfio_noiommu_ioctl(void *iommu_data,\n \treturn -ENOTTY;\n }\n \n-static int vfio_iommu_present(struct device *dev, void *unused)\n-{\n-\treturn iommu_present(dev->bus) ? 1 : 0;\n-}\n-\n static int vfio_noiommu_attach_group(void *iommu_data,\n \t\t\t\t     struct iommu_group *iommu_group)\n {\n-\treturn iommu_group_for_each_dev(iommu_group, NULL,\n-\t\t\t\t\tvfio_iommu_present) ? -EINVAL : 0;\n+\treturn iommu_group_get_iommudata(iommu_group) == &noiommu ? 0 : -EINVAL;\n }\n \n static void vfio_noiommu_detach_group(void *iommu_data,\n@@ -323,8 +318,7 @@ static void vfio_group_unlock_and_free(struct vfio_group *group)\n /**\n  * Group objects - create, release, get, put, search\n  */\n-static struct vfio_group *vfio_create_group(struct iommu_group *iommu_group,\n-\t\t\t\t\t    bool iommu_present)\n+static struct vfio_group *vfio_create_group(struct iommu_group *iommu_group)\n {\n \tstruct vfio_group *group, *tmp;\n \tstruct device *dev;\n@@ -342,7 +336,9 @@ static struct vfio_group *vfio_create_group(struct iommu_group *iommu_group,\n \tatomic_set(&group->container_users, 0);\n \tatomic_set(&group->opened, 0);\n \tgroup->iommu_group = iommu_group;\n-\tgroup->noiommu = !iommu_present;\n+#ifdef CONFIG_VFIO_NOIOMMU\n+\tgroup->noiommu = (iommu_group_get_iommudata(iommu_group) == &noiommu);\n+#endif\n \n \tgroup->nb.notifier_call = vfio_iommu_group_notifier;\n \n@@ -767,7 +763,7 @@ int vfio_add_group_dev(struct device *dev,\n \n \tgroup = vfio_group_get_from_iommu(iommu_group);\n \tif (!group) {\n-\t\tgroup = vfio_create_group(iommu_group, iommu_present(dev->bus));\n+\t\tgroup = vfio_create_group(iommu_group);\n \t\tif (IS_ERR(group)) {\n \t\t\tiommu_group_put(iommu_group);\n \t\t\treturn PTR_ERR(group);\n",
    "prefixes": [
        "dpdk-dev"
    ]
}