get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 78841,
    "url": "https://patches.dpdk.org/api/patches/78841/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200925123113.68916-2-maxime.coquelin@redhat.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": "<20200925123113.68916-2-maxime.coquelin@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200925123113.68916-2-maxime.coquelin@redhat.com",
    "date": "2020-09-25T12:31:06",
    "name": "[v2,1/8] bus/vdev: add DMA mapping ops",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "9dbc5d6bab1361cada51c4acca7a2ec0c54c764e",
    "submitter": {
        "id": 512,
        "url": "https://patches.dpdk.org/api/people/512/?format=api",
        "name": "Maxime Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "delegate": {
        "id": 2642,
        "url": "https://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20200925123113.68916-2-maxime.coquelin@redhat.com/mbox/",
    "series": [
        {
            "id": 12512,
            "url": "https://patches.dpdk.org/api/series/12512/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=12512",
            "date": "2020-09-25T12:31:05",
            "name": "virtio-user: introduce vhost-vdpa backend",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/12512/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/78841/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/78841/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 A4B77A04C0;\n\tFri, 25 Sep 2020 14:31:34 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 9364A1E8DA;\n\tFri, 25 Sep 2020 14:31:30 +0200 (CEST)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [216.205.24.124])\n by dpdk.org (Postfix) with ESMTP id D7C081E8AB\n for <dev@dpdk.org>; Fri, 25 Sep 2020 14:31:26 +0200 (CEST)",
            "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-227-JgMPW_twOtuWWRXAjsiJtg-1; Fri, 25 Sep 2020 08:31:24 -0400",
            "from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com\n [10.5.11.11])\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 7D7418015F5;\n Fri, 25 Sep 2020 12:31:23 +0000 (UTC)",
            "from localhost.localdomain (unknown [10.36.110.9])\n by smtp.corp.redhat.com (Postfix) with ESMTP id B0FB678810;\n Fri, 25 Sep 2020 12:31:21 +0000 (UTC)"
        ],
        "Dkim-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1601037086;\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=+HGbrmuxnijcoYk0AEzzb1c75gJo6hjIov3N6BbbeFM=;\n b=UjoZJxJ+kIuEWqAru//y/K0Pg/tHXus1GNilUpxP1H+CHVTsjmhenQ3/i7DEsV+uIm7Tsc\n FPDy4o0tmnXKTDpP4f7FKxpZ8XF3tEdrTtN+m0L5LWWLYgVed9iSoxzxmsP1tKo36jisWx\n SxZfs54Ulsgupd4Zm4XR2sXB+cnaghQ=",
        "X-MC-Unique": "JgMPW_twOtuWWRXAjsiJtg-1",
        "From": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "To": "dev@dpdk.org, chenbo.xia@intel.com, patrick.fu@intel.com,\n amorenoz@redhat.com",
        "Cc": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "Date": "Fri, 25 Sep 2020 14:31:06 +0200",
        "Message-Id": "<20200925123113.68916-2-maxime.coquelin@redhat.com>",
        "In-Reply-To": "<20200925123113.68916-1-maxime.coquelin@redhat.com>",
        "References": "<20200925123113.68916-1-maxime.coquelin@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.11",
        "Authentication-Results": "relay.mimecast.com;\n auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain; charset=\"US-ASCII\"",
        "Subject": "[dpdk-dev] [PATCH v2 1/8] bus/vdev: add DMA mapping ops",
        "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": "Add DMA map/unmap operation callbacks to the vdev bus, which\ncould be used by DMA capable vdev drivers.\n\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\n drivers/bus/vdev/rte_bus_vdev.h | 46 +++++++++++++++++++++++++++--\n drivers/bus/vdev/vdev.c         | 52 +++++++++++++++++++++++++++++++++\n 2 files changed, 95 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/drivers/bus/vdev/rte_bus_vdev.h b/drivers/bus/vdev/rte_bus_vdev.h\nindex 78a032cea8..d14eeb41b0 100644\n--- a/drivers/bus/vdev/rte_bus_vdev.h\n+++ b/drivers/bus/vdev/rte_bus_vdev.h\n@@ -63,14 +63,54 @@ typedef int (rte_vdev_probe_t)(struct rte_vdev_device *dev);\n  */\n typedef int (rte_vdev_remove_t)(struct rte_vdev_device *dev);\n \n+/**\n+ * Driver-specific DMA mapping. After a successful call the device\n+ * will be able to read/write from/to this segment.\n+ *\n+ * @param dev\n+ *   Pointer to the Virtual device.\n+ * @param addr\n+ *   Starting virtual address of memory to be mapped.\n+ * @param iova\n+ *   Starting IOVA address of memory to be mapped.\n+ * @param len\n+ *   Length of memory segment being mapped.\n+ * @return\n+ *   - 0 On success.\n+ *   - Negative value and rte_errno is set otherwise.\n+ */\n+typedef int (rte_vdev_dma_map_t)(struct rte_vdev_device *dev, void *addr,\n+\t\t\t    uint64_t iova, size_t len);\n+\n+/**\n+ * Driver-specific DMA un-mapping. After a successful call the device\n+ * will not be able to read/write from/to this segment.\n+ *\n+ * @param dev\n+ *   Pointer to the Virtual device.\n+ * @param addr\n+ *   Starting virtual address of memory to be unmapped.\n+ * @param iova\n+ *   Starting IOVA address of memory to be unmapped.\n+ * @param len\n+ *   Length of memory segment being unmapped.\n+ * @return\n+ *   - 0 On success.\n+ *   - Negative value and rte_errno is set otherwise.\n+ */\n+typedef int (rte_vdev_dma_unmap_t)(struct rte_vdev_device *dev, void *addr,\n+\t\t\t      uint64_t iova, size_t len);\n+\n /**\n  * A virtual device driver abstraction.\n  */\n struct rte_vdev_driver {\n \tTAILQ_ENTRY(rte_vdev_driver) next; /**< Next in list. */\n-\tstruct rte_driver driver;      /**< Inherited general driver. */\n-\trte_vdev_probe_t *probe;       /**< Virtual device probe function. */\n-\trte_vdev_remove_t *remove;     /**< Virtual device remove function. */\n+\tstruct rte_driver driver;        /**< Inherited general driver. */\n+\trte_vdev_probe_t *probe;         /**< Virtual device probe function. */\n+\trte_vdev_remove_t *remove;       /**< Virtual device remove function. */\n+\trte_vdev_dma_map_t *dma_map;     /**< Virtual device DMA map function. */\n+\trte_vdev_dma_unmap_t *dma_unmap; /**< Virtual device DMA unmap function. */\n };\n \n /**\ndiff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c\nindex d746149a2e..0e94ea9d26 100644\n--- a/drivers/bus/vdev/vdev.c\n+++ b/drivers/bus/vdev/vdev.c\n@@ -134,6 +134,56 @@ vdev_parse(const char *name, void *addr)\n \treturn driver == NULL;\n }\n \n+static int\n+vdev_dma_map(struct rte_device *dev, void *addr, uint64_t iova, size_t len)\n+{\n+\tstruct rte_vdev_device *vdev = RTE_DEV_TO_VDEV(dev);\n+\tconst struct rte_vdev_driver *driver;\n+\n+\tif (!vdev) {\n+\t\trte_errno = EINVAL;\n+\t\treturn -1;\n+\t}\n+\n+\tif (!vdev->device.driver) {\n+\t\tVDEV_LOG(DEBUG, \"no driver attach to device %s\", dev->name);\n+\t\treturn 1;\n+\t}\n+\n+\tdriver = container_of(vdev->device.driver, const struct rte_vdev_driver,\n+\t\t\tdriver);\n+\n+\tif (driver->dma_map)\n+\t\treturn driver->dma_map(vdev, addr, iova, len);\n+\n+\treturn 0;\n+}\n+\n+static int\n+vdev_dma_unmap(struct rte_device *dev, void *addr, uint64_t iova, size_t len)\n+{\n+\tstruct rte_vdev_device *vdev = RTE_DEV_TO_VDEV(dev);\n+\tconst struct rte_vdev_driver *driver;\n+\n+\tif (!vdev) {\n+\t\trte_errno = EINVAL;\n+\t\treturn -1;\n+\t}\n+\n+\tif (!vdev->device.driver) {\n+\t\tVDEV_LOG(DEBUG, \"no driver attach to device %s\", dev->name);\n+\t\treturn 1;\n+\t}\n+\n+\tdriver = container_of(vdev->device.driver, const struct rte_vdev_driver,\n+\t\t\tdriver);\n+\n+\tif (driver->dma_unmap)\n+\t\treturn driver->dma_unmap(vdev, addr, iova, len);\n+\n+\treturn 0;\n+}\n+\n static int\n vdev_probe_all_drivers(struct rte_vdev_device *dev)\n {\n@@ -551,6 +601,8 @@ static struct rte_bus rte_vdev_bus = {\n \t.plug = vdev_plug,\n \t.unplug = vdev_unplug,\n \t.parse = vdev_parse,\n+\t.dma_map = vdev_dma_map,\n+\t.dma_unmap = vdev_dma_unmap,\n \t.dev_iterate = rte_vdev_dev_iterate,\n };\n \n",
    "prefixes": [
        "v2",
        "1/8"
    ]
}