get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 63848,
    "url": "http://patches.dpdk.org/api/patches/63848/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20191213141322.32730-5-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-5-maxime.coquelin@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191213141322.32730-5-maxime.coquelin@redhat.com",
    "date": "2019-12-13T14:13:22",
    "name": "[4/4] net/virtio: add DMA mapping callback to virtio-user",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "58928c86e0458208130e43ea5177851d13522d9e",
    "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-5-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/63848/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/63848/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 8CE6DA04F1;\n\tFri, 13 Dec 2019 15:14:12 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 0C94D1BFB3;\n\tFri, 13 Dec 2019 15:13:45 +0100 (CET)",
            "from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com\n [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 3C0EC1BFA9\n for <dev@dpdk.org>; Fri, 13 Dec 2019 15:13: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-146-zTYvulwSMPmsvr-_Ourueg-1; Fri, 13 Dec 2019 09:13:40 -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 800EB18B62A0;\n Fri, 13 Dec 2019 14:13:39 +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 B021760C05;\n Fri, 13 Dec 2019 14:13:37 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1576246421;\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=oXqyoVNdKeqPMxeyIbjM1YEPLHWDRCeaFFL3jCsedLk=;\n b=cjhljLenS/iKz1Upm/fUriuFjQpSd89oxH7QsgiyP2ikXlhg6KOKRMTTwvW6W71lrYDdNs\n 7kDRZr2sc78LR9IiSEbz2wRbaC1LlvCo4NL0KDZ4FEIRdQOrkbWsHMT3ndc59Ex1g43kFq\n UwArmj5oVkeDo6wSGjivD7N5+KFbukY=",
        "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:22 +0100",
        "Message-Id": "<20191213141322.32730-5-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": "zTYvulwSMPmsvr-_Ourueg-1",
        "X-Mimecast-Spam-Score": "0",
        "Content-Type": "text/plain; charset=US-ASCII",
        "Content-Transfer-Encoding": "quoted-printable",
        "Subject": "[dpdk-dev] [PATCH 4/4] net/virtio: add DMA mapping callback to\n\tvirtio-user",
        "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": "Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\n .../net/virtio/virtio_user/virtio_user_dev.c  | 10 +---\n .../net/virtio/virtio_user/virtio_user_dev.h  |  3 +\n drivers/net/virtio/virtio_user_ethdev.c       | 58 +++++++++++++++++++\n 3 files changed, 63 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c\nindex ea016e85d8..c72a9543cd 100644\n--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c\n+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c\n@@ -313,21 +313,15 @@ virtio_user_fill_intr_handle(struct virtio_user_dev *dev)\n \treturn 0;\n }\n \n-static void\n+void\n virtio_user_mem_event_cb(enum rte_mem_event type __rte_unused,\n-\t\t\t const void *addr,\n+\t\t\t const void *addr __rte_unused,\n \t\t\t size_t len __rte_unused,\n \t\t\t void *arg)\n {\n \tstruct virtio_user_dev *dev = arg;\n-\tstruct rte_memseg_list *msl;\n \tuint16_t i;\n \n-\t/* ignore externally allocated memory */\n-\tmsl = rte_mem_virt2memseg_list(addr);\n-\tif (msl->external)\n-\t\treturn;\n-\n \tpthread_mutex_lock(&dev->mutex);\n \n \tif (dev->started == false)\ndiff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.h b/drivers/net/virtio/virtio_user/virtio_user_dev.h\nindex ad86837717..5a147c74f0 100644\n--- a/drivers/net/virtio/virtio_user/virtio_user_dev.h\n+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.h\n@@ -67,4 +67,7 @@ void virtio_user_handle_cq(struct virtio_user_dev *dev, uint16_t queue_idx);\n void virtio_user_handle_cq_packed(struct virtio_user_dev *dev,\n \t\t\t\t  uint16_t queue_idx);\n uint8_t virtio_user_handle_mq(struct virtio_user_dev *dev, uint16_t q_pairs);\n+void\n+virtio_user_mem_event_cb(enum rte_mem_event type,\n+\t\t\tconst void *addr, size_t len , void *arg);\n #endif\ndiff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c\nindex 3fc1725736..fd3ce2dfab 100644\n--- a/drivers/net/virtio/virtio_user_ethdev.c\n+++ b/drivers/net/virtio/virtio_user_ethdev.c\n@@ -385,6 +385,62 @@ const struct virtio_pci_ops virtio_user_ops = {\n \t.notify_queue\t= virtio_user_notify_queue,\n };\n \n+static int\n+virtio_user_dma_map(struct rte_vdev_device *vdev, void *addr,\n+\t\tuint64_t iova __rte_unused, size_t len)\n+{\n+\tconst char *name;\n+\tstruct rte_eth_dev *eth_dev;\n+\tstruct virtio_hw *hw;\n+\tstruct virtio_user_dev *dev;\n+\n+\tif (!vdev)\n+\t\treturn -EINVAL;\n+\n+\tname = rte_vdev_device_name(vdev);\n+\teth_dev = rte_eth_dev_allocated(name);\n+\tif (!eth_dev)\n+\t\treturn -ENODEV;\n+\n+\thw = eth_dev->data->dev_private;\n+\tdev = hw->virtio_user_dev;\n+\n+\tvirtio_user_mem_event_cb(RTE_MEM_EVENT_ALLOC,\n+\t\t\t\t\t\t addr,\n+\t\t\t\t\t\t len,\n+\t\t\t\t\t\t (void *)dev);\n+\n+\treturn 0;\n+}\n+\n+static int\n+virtio_user_dma_unmap(struct rte_vdev_device *vdev, void *addr,\n+\t\tuint64_t iova __rte_unused, size_t len)\n+{\n+\tconst char *name;\n+\tstruct rte_eth_dev *eth_dev;\n+\tstruct virtio_hw *hw;\n+\tstruct virtio_user_dev *dev;\n+\n+\tif (!vdev)\n+\t\treturn -EINVAL;\n+\n+\tname = rte_vdev_device_name(vdev);\n+\teth_dev = rte_eth_dev_allocated(name);\n+\tif (!eth_dev)\n+\t\treturn -ENODEV;\n+\n+\thw = eth_dev->data->dev_private;\n+\tdev = hw->virtio_user_dev;\n+\n+\tvirtio_user_mem_event_cb(RTE_MEM_EVENT_FREE,\n+\t\t\t\t\t\t addr,\n+\t\t\t\t\t\t len,\n+\t\t\t\t\t\t (void *)dev);\n+\n+\treturn 0;\n+}\n+\n static const char *valid_args[] = {\n #define VIRTIO_USER_ARG_QUEUES_NUM     \"queues\"\n \tVIRTIO_USER_ARG_QUEUES_NUM,\n@@ -717,6 +773,8 @@ virtio_user_pmd_remove(struct rte_vdev_device *vdev)\n }\n \n static struct rte_vdev_driver virtio_user_driver = {\n+\t.dma_map = virtio_user_dma_map,\n+\t.dma_unmap = virtio_user_dma_unmap,\n \t.probe = virtio_user_pmd_probe,\n \t.remove = virtio_user_pmd_remove,\n };\n",
    "prefixes": [
        "4/4"
    ]
}