get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 63847,
    "url": "http://patches.dpdk.org/api/patches/63847/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20191213141322.32730-4-maxime.coquelin@redhat.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": "<20191213141322.32730-4-maxime.coquelin@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191213141322.32730-4-maxime.coquelin@redhat.com",
    "date": "2019-12-13T14:13:21",
    "name": "[3/4] bus/vdev: add DMA mapping supprt",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "0364be7beee86106d16048f3fed2c3bd5088b95f",
    "submitter": {
        "id": 512,
        "url": "http://patches.dpdk.org/api/people/512/?format=api",
        "name": "Maxime Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20191213141322.32730-4-maxime.coquelin@redhat.com/mbox/",
    "series": [
        {
            "id": 7824,
            "url": "http://patches.dpdk.org/api/series/7824/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=7824",
            "date": "2019-12-13T14:13:18",
            "name": "Add external contiguous memory support to Virtio-user",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/7824/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/63847/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/63847/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 30834A04F1;\n\tFri, 13 Dec 2019 15:14:04 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id A17331BFAC;\n\tFri, 13 Dec 2019 15:13:43 +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 9197B1BF9C\n for <dev@dpdk.org>; Fri, 13 Dec 2019 15:13:40 +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-41-N6tHRgGRM9ykrDrNo0QXWQ-1; Fri, 13 Dec 2019 09:13:38 -0500",
            "from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com\n [10.5.11.12])\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 55DC4800D5B;\n Fri, 13 Dec 2019 14:13:37 +0000 (UTC)",
            "from localhost.localdomain (ovpn-112-19.ams2.redhat.com\n [10.36.112.19])\n by smtp.corp.redhat.com (Postfix) with ESMTP id B196360C05;\n Fri, 13 Dec 2019 14:13:35 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1576246419;\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=9f1DhzMsFTQb2Ey43L2zkluCSwQM0Tjn5LgKUdvc5wQ=;\n b=D+aSRzZO6mpaWFt2YwGBj0Nc4AWMp0NBdxPgtPXoMMEQwS9XpF+PYi2gZ+EOFZcnn5kIeJ\n IrqVYuzT4tI+x27LCUPtr04g4KEpM+dPEqyzzKKKv7lrgAWUEJmEr0ZjhJalJU998zhnzN\n xzqezE2o35RWLmKzQgzRzvVXIFXAWKc=",
        "From": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "To": "dev@dpdk.org, tiwei.bie@intel.com, zhihong.wang@intel.com,\n anatoly.burakov@intel.com",
        "Cc": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "Date": "Fri, 13 Dec 2019 15:13:21 +0100",
        "Message-Id": "<20191213141322.32730-4-maxime.coquelin@redhat.com>",
        "In-Reply-To": "<20191213141322.32730-1-maxime.coquelin@redhat.com>",
        "References": "<20191213141322.32730-1-maxime.coquelin@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.12",
        "X-MC-Unique": "N6tHRgGRM9ykrDrNo0QXWQ-1",
        "X-Mimecast-Spam-Score": "0",
        "Content-Type": "text/plain; charset=US-ASCII",
        "Content-Transfer-Encoding": "quoted-printable",
        "Subject": "[dpdk-dev] [PATCH 3/4] bus/vdev: add DMA mapping supprt",
        "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": "This patch enables VDEVs to implement their own DMA map\nand unmap callbacks.\n\nIt will be used by Virtio-user PMD to support external\nmemory registered by applications like Seastar or VPP.\n\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\n drivers/bus/vdev/rte_bus_vdev.h | 24 ++++++++++++++++\n drivers/bus/vdev/vdev.c         | 50 +++++++++++++++++++++++++++++++++\n 2 files changed, 74 insertions(+)",
    "diff": "diff --git a/drivers/bus/vdev/rte_bus_vdev.h b/drivers/bus/vdev/rte_bus_vdev.h\nindex 2bc46530c9..6f920cb064 100644\n--- a/drivers/bus/vdev/rte_bus_vdev.h\n+++ b/drivers/bus/vdev/rte_bus_vdev.h\n@@ -53,6 +53,18 @@ rte_vdev_device_args(const struct rte_vdev_device *dev)\n /** Double linked list of virtual device drivers. */\n TAILQ_HEAD(vdev_driver_list, rte_vdev_driver);\n \n+/**\n+ * Virtual device DMA map function.\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+ * Virtual device DMA unmap function.\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  * Probe function called for each virtual device driver once.\n  */\n@@ -69,10 +81,22 @@ typedef int (rte_vdev_remove_t)(struct rte_vdev_device *dev);\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_dma_map_t *dma_map;   /**<Virtual device DMA map function. */\n+\trte_vdev_dma_unmap_t *dma_unmap;   /**<Virtual device DMA unmap function. */\n \trte_vdev_probe_t *probe;       /**< Virtual device probe function. */\n \trte_vdev_remove_t *remove;     /**< Virtual device remove function. */\n };\n \n+/**\n+ * @internal\n+ * Helper macro for drivers that need to convert to struct rte_vdev_driver.\n+ */\n+#define RTE_DRV_TO_VDRV(ptr) \\\n+\tcontainer_of(ptr, struct rte_vdev_driver, driver)\n+\n+#define RTE_DRV_TO_VDRV_CONST(ptr) \\\n+\tcontainer_of(ptr, const struct rte_vdev_driver, driver)\n+\n /**\n  * Register a virtual device driver.\n  *\ndiff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c\nindex a89ea23530..8bdca23448 100644\n--- a/drivers/bus/vdev/vdev.c\n+++ b/drivers/bus/vdev/vdev.c\n@@ -546,6 +546,54 @@ vdev_unplug(struct rte_device *dev)\n \treturn rte_vdev_uninit(dev->name);\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 *vdrv;\n+\n+\tif (!dev || !dev->driver) {\n+\t\trte_errno = EINVAL;\n+\t\treturn -1;\n+\t}\n+\n+\tvdrv = RTE_DRV_TO_VDRV_CONST(dev->driver);\n+\tif (!vdrv) {\n+\t\trte_errno = EINVAL;\n+\t\treturn -1;\n+\t}\n+\n+\tif (vdrv->dma_map)\n+\t\treturn vdrv->dma_map(vdev, addr, iova, len);\n+\n+\trte_errno = ENOTSUP;\n+\treturn -1;\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 *vdrv;\n+\n+\tif (!dev || !dev->driver) {\n+\t\trte_errno = EINVAL;\n+\t\treturn -1;\n+\t}\n+\n+\tvdrv = RTE_DRV_TO_VDRV_CONST(dev->driver);\n+\tif (!vdrv) {\n+\t\trte_errno = EINVAL;\n+\t\treturn -1;\n+\t}\n+\n+\tif (vdrv->dma_map)\n+\t\treturn vdrv->dma_unmap(vdev, addr, iova, len);\n+\n+\trte_errno = ENOTSUP;\n+\treturn -1;\n+}\n+\n static struct rte_bus rte_vdev_bus = {\n \t.scan = vdev_scan,\n \t.probe = vdev_probe,\n@@ -553,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": [
        "3/4"
    ]
}