Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/66549/?format=api
http://patches.dpdk.org/api/patches/66549/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/158396391448.5601.14344561558422706517.stgit@gimli.home/", "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": "<158396391448.5601.14344561558422706517.stgit@gimli.home>", "list_archive_url": "https://inbox.dpdk.org/dev/158396391448.5601.14344561558422706517.stgit@gimli.home", "date": "2020-03-11T21:58:34", "name": "[v3,1/7] vfio: Include optional device match in vfio_device_ops callbacks", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": true, "hash": "4777847a0544f908a0783296cad1f345bfdc3554", "submitter": { "id": 391, "url": "http://patches.dpdk.org/api/people/391/?format=api", "name": "Alex Williamson", "email": "alex.williamson@redhat.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/158396391448.5601.14344561558422706517.stgit@gimli.home/mbox/", "series": [ { "id": 8887, "url": "http://patches.dpdk.org/api/series/8887/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8887", "date": "2020-03-11T21:58:25", "name": "vfio/pci: SR-IOV support", "version": 3, "mbox": "http://patches.dpdk.org/series/8887/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/66549/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/66549/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id BE42AA056D;\n\tWed, 11 Mar 2020 22:58:49 +0100 (CET)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 9EBDD1BFFE;\n\tWed, 11 Mar 2020 22:58:44 +0100 (CET)", "from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com\n [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id C0B981BFFC\n for <dev@dpdk.org>; Wed, 11 Mar 2020 22:58:42 +0100 (CET)", "from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com\n [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id\n us-mta-305-ywR8Vb8LMEGvUWxOGU69gg-1; Wed, 11 Mar 2020 17:58:40 -0400", "from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com\n [10.5.11.15])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8AF501088388;\n Wed, 11 Mar 2020 21:58:38 +0000 (UTC)", "from gimli.home (ovpn-116-28.phx2.redhat.com [10.3.116.28])\n by smtp.corp.redhat.com (Postfix) with ESMTP id DBC1E92972;\n Wed, 11 Mar 2020 21:58:34 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1583963922;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=/UO6irQAkGyQ/Cqy5oQ7oIcu+pBDHAQ9auYgdZN2lko=;\n b=VHCJIbvH5GE2PP35ApZadbTxqOQ7WYZriQe4Uw2SdgqOiG/6JiYuNjzrGOLotyKIs5xgNm\n MCkrjYeXJPjua3V/JrvP6MMZM8SryBUHXNIBx3WkZtb47IHn5KmHiEgeUivmaO4uau4q+j\n 8n98XIoEay3Jz6ep3JFMS/2z1pWGH/Q=", "X-MC-Unique": "ywR8Vb8LMEGvUWxOGU69gg-1", "From": "Alex Williamson <alex.williamson@redhat.com>", "To": "kvm@vger.kernel.org", "Cc": "linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, dev@dpdk.org,\n mtosatti@redhat.com, thomas@monjalon.net, bluca@debian.org,\n jerinjacobk@gmail.com, bruce.richardson@intel.com, cohuck@redhat.com,\n kevin.tian@intel.com", "Date": "Wed, 11 Mar 2020 15:58:34 -0600", "Message-ID": "<158396391448.5601.14344561558422706517.stgit@gimli.home>", "In-Reply-To": "<158396044753.5601.14804870681174789709.stgit@gimli.home>", "References": "<158396044753.5601.14804870681174789709.stgit@gimli.home>", "User-Agent": "StGit/0.19-dirty", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "7bit", "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.15", "Subject": "[dpdk-dev] [PATCH v3 1/7] vfio: Include optional device match in\n vfio_device_ops callbacks", "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 <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 <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Allow bus drivers to provide their own callback to match a device to\nthe user provided string.\n\nReviewed-by: Cornelia Huck <cohuck@redhat.com>\nSigned-off-by: Alex Williamson <alex.williamson@redhat.com>\n---\n drivers/vfio/vfio.c | 20 ++++++++++++++++----\n include/linux/vfio.h | 4 ++++\n 2 files changed, 20 insertions(+), 4 deletions(-)", "diff": "diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c\nindex c8482624ca34..0bd77d6ea691 100644\n--- a/drivers/vfio/vfio.c\n+++ b/drivers/vfio/vfio.c\n@@ -875,11 +875,23 @@ EXPORT_SYMBOL_GPL(vfio_device_get_from_dev);\n static struct vfio_device *vfio_device_get_from_name(struct vfio_group *group,\n \t\t\t\t\t\t char *buf)\n {\n-\tstruct vfio_device *it, *device = NULL;\n+\tstruct vfio_device *it, *device = ERR_PTR(-ENODEV);\n \n \tmutex_lock(&group->device_lock);\n \tlist_for_each_entry(it, &group->device_list, group_next) {\n-\t\tif (!strcmp(dev_name(it->dev), buf)) {\n+\t\tint ret;\n+\n+\t\tif (it->ops->match) {\n+\t\t\tret = it->ops->match(it->device_data, buf);\n+\t\t\tif (ret < 0) {\n+\t\t\t\tdevice = ERR_PTR(ret);\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t} else {\n+\t\t\tret = !strcmp(dev_name(it->dev), buf);\n+\t\t}\n+\n+\t\tif (ret) {\n \t\t\tdevice = it;\n \t\t\tvfio_device_get(device);\n \t\t\tbreak;\n@@ -1430,8 +1442,8 @@ static int vfio_group_get_device_fd(struct vfio_group *group, char *buf)\n \t\treturn -EPERM;\n \n \tdevice = vfio_device_get_from_name(group, buf);\n-\tif (!device)\n-\t\treturn -ENODEV;\n+\tif (IS_ERR(device))\n+\t\treturn PTR_ERR(device);\n \n \tret = device->ops->open(device->device_data);\n \tif (ret) {\ndiff --git a/include/linux/vfio.h b/include/linux/vfio.h\nindex e42a711a2800..029694b977f2 100644\n--- a/include/linux/vfio.h\n+++ b/include/linux/vfio.h\n@@ -26,6 +26,9 @@\n * operations documented below\n * @mmap: Perform mmap(2) on a region of the device file descriptor\n * @request: Request for the bus driver to release the device\n+ * @match: Optional device name match callback (return: 0 for no-match, >0 for\n+ * match, -errno for abort (ex. match with insufficient or incorrect\n+ * additional args)\n */\n struct vfio_device_ops {\n \tchar\t*name;\n@@ -39,6 +42,7 @@ struct vfio_device_ops {\n \t\t\t unsigned long arg);\n \tint\t(*mmap)(void *device_data, struct vm_area_struct *vma);\n \tvoid\t(*request)(void *device_data, unsigned int count);\n+\tint\t(*match)(void *device_data, char *buf);\n };\n \n extern struct iommu_group *vfio_iommu_group_get(struct device *dev);\n", "prefixes": [ "v3", "1/7" ] }{ "id": 66549, "url": "