Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/78842/?format=api
https://patches.dpdk.org/api/patches/78842/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200925123113.68916-3-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-3-maxime.coquelin@redhat.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200925123113.68916-3-maxime.coquelin@redhat.com", "date": "2020-09-25T12:31:07", "name": "[v2,2/8] net/virtio: introduce DMA ops", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "5e2d28ee28238006b4154f996f9a345de634e846", "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-3-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/78842/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/78842/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 B9843A04C0;\n\tFri, 25 Sep 2020 14:31:46 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 30BD41E92A;\n\tFri, 25 Sep 2020 14:31:36 +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 3607F1E8DA\n for <dev@dpdk.org>; Fri, 25 Sep 2020 14:31:30 +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-79-02EWsqg8Nt2iMzJVoiLODg-1; Fri, 25 Sep 2020 08:31:28 -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 ED0552FD04;\n Fri, 25 Sep 2020 12:31:26 +0000 (UTC)", "from localhost.localdomain (unknown [10.36.110.9])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 09FBF78830;\n Fri, 25 Sep 2020 12:31:23 +0000 (UTC)" ], "Dkim-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1601037089;\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=/IhmGc9dU+vaCiLlIQxDt2xa/0Qdv9Xi7Kbn0qhVSpo=;\n b=aL4g7XBqOcr5TfVgwiXX6jk1tJIrMaOaokYaIz1gRHHs1zFYww2OOJIozZYRwqr5kJuyss\n a6DPGCViLGvSvZzZ6tIb77hIy6QnZMt3G+lePZ1WK8iqJJgsB2CJqXktsVg/SpA9TCm1bn\n V2ochDultomErkRjMcD3H2zm583PIj8=", "X-MC-Unique": "02EWsqg8Nt2iMzJVoiLODg-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:07 +0200", "Message-Id": "<20200925123113.68916-3-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 2/8] net/virtio: introduce DMA 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 callbacks to the virtio_user pmd, which could\nbe leveraged by vdev bus driver to map memory for backend\ndevices with DMA capability.\n\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\n drivers/net/virtio/virtio_user/vhost.h | 4 ++\n drivers/net/virtio/virtio_user_ethdev.c | 54 +++++++++++++++++++++++++\n 2 files changed, 58 insertions(+)", "diff": "diff --git a/drivers/net/virtio/virtio_user/vhost.h b/drivers/net/virtio/virtio_user/vhost.h\nindex 8f49ef4574..2e71995a79 100644\n--- a/drivers/net/virtio/virtio_user/vhost.h\n+++ b/drivers/net/virtio/virtio_user/vhost.h\n@@ -105,6 +105,10 @@ struct virtio_user_backend_ops {\n \tint (*enable_qp)(struct virtio_user_dev *dev,\n \t\t\t uint16_t pair_idx,\n \t\t\t int enable);\n+\tint (*dma_map)(struct virtio_user_dev *dev, void *addr,\n+\t\t\t\t uint64_t iova, size_t len);\n+\tint (*dma_unmap)(struct virtio_user_dev *dev, void *addr,\n+\t\t\t\t uint64_t iova, size_t len);\n };\n \n extern struct virtio_user_backend_ops virtio_ops_user;\ndiff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c\nindex 87f6cb6950..60d17af888 100644\n--- a/drivers/net/virtio/virtio_user_ethdev.c\n+++ b/drivers/net/virtio/virtio_user_ethdev.c\n@@ -818,9 +818,63 @@ virtio_user_pmd_remove(struct rte_vdev_device *vdev)\n \treturn 0;\n }\n \n+static int virtio_user_pmd_dma_map(struct rte_vdev_device *vdev, void *addr,\n+\t\tuint64_t iova, size_t len)\n+{\n+\tconst char *name;\n+\tstruct rte_eth_dev *eth_dev;\n+\tstruct virtio_user_dev *dev;\n+\tstruct virtio_hw *hw;\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+\t/* Port has already been released by close. */\n+\tif (!eth_dev)\n+\t\treturn 0;\n+\n+\thw = (struct virtio_hw *)eth_dev->data->dev_private;\n+\tdev = hw->virtio_user_dev;\n+\n+\tif (dev->ops->dma_map)\n+\t\treturn dev->ops->dma_map(dev, addr, iova, len);\n+\n+\treturn 0;\n+}\n+\n+static int virtio_user_pmd_dma_unmap(struct rte_vdev_device *vdev, void *addr,\n+\t\tuint64_t iova, size_t len)\n+{\n+\tconst char *name;\n+\tstruct rte_eth_dev *eth_dev;\n+\tstruct virtio_user_dev *dev;\n+\tstruct virtio_hw *hw;\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+\t/* Port has already been released by close. */\n+\tif (!eth_dev)\n+\t\treturn 0;\n+\n+\thw = (struct virtio_hw *)eth_dev->data->dev_private;\n+\tdev = hw->virtio_user_dev;\n+\n+\tif (dev->ops->dma_unmap)\n+\t\treturn dev->ops->dma_unmap(dev, addr, iova, len);\n+\n+\treturn 0;\n+}\n+\n static struct rte_vdev_driver virtio_user_driver = {\n \t.probe = virtio_user_pmd_probe,\n \t.remove = virtio_user_pmd_remove,\n+\t.dma_map = virtio_user_pmd_dma_map,\n+\t.dma_unmap = virtio_user_pmd_dma_unmap,\n };\n \n RTE_PMD_REGISTER_VDEV(net_virtio_user, virtio_user_driver);\n", "prefixes": [ "v2", "2/8" ] }{ "id": 78842, "url": "