Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/28131/?format=api
http://patches.dpdk.org/api/patches/28131/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20170831095023.21037-12-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": "<20170831095023.21037-12-maxime.coquelin@redhat.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20170831095023.21037-12-maxime.coquelin@redhat.com", "date": "2017-08-31T09:50:13", "name": "[dpdk-dev,11/21] vhost-user: handle IOTLB update and invalidate requests", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "5fe51bfeb9089030a87dbe45e25bcb91a25bcfac", "submitter": { "id": 512, "url": "http://patches.dpdk.org/api/people/512/?format=api", "name": "Maxime Coquelin", "email": "maxime.coquelin@redhat.com" }, "delegate": { "id": 355, "url": "http://patches.dpdk.org/api/users/355/?format=api", "username": "yliu", "first_name": "Yuanhan", "last_name": "Liu", "email": "yuanhan.liu@linux.intel.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20170831095023.21037-12-maxime.coquelin@redhat.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/28131/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/28131/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 64EDA7CC9;\n\tThu, 31 Aug 2017 11:51:57 +0200 (CEST)", "from mx1.redhat.com (mx1.redhat.com [209.132.183.28])\n\tby dpdk.org (Postfix) with ESMTP id E47372BF3\n\tfor <dev@dpdk.org>; Thu, 31 Aug 2017 11:51:54 +0200 (CEST)", "from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 445575F7B7;\n\tThu, 31 Aug 2017 09:51:54 +0000 (UTC)", "from localhost.localdomain (ovpn-112-32.ams2.redhat.com\n\t[10.36.112.32])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 4856977DCE;\n\tThu, 31 Aug 2017 09:51:51 +0000 (UTC)" ], "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com 445575F7B7", "Authentication-Results": [ "ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com", "ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=maxime.coquelin@redhat.com" ], "From": "Maxime Coquelin <maxime.coquelin@redhat.com>", "To": "dev@dpdk.org, yliu@fridaylinux.org, jfreiman@redhat.com,\n\ttiwei.bie@intel.com", "Cc": "mst@redhat.com, vkaplans@redhat.com, jasowang@redhat.com,\n\tMaxime Coquelin <maxime.coquelin@redhat.com>", "Date": "Thu, 31 Aug 2017 11:50:13 +0200", "Message-Id": "<20170831095023.21037-12-maxime.coquelin@redhat.com>", "In-Reply-To": "<20170831095023.21037-1-maxime.coquelin@redhat.com>", "References": "<20170831095023.21037-1-maxime.coquelin@redhat.com>", "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.12", "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.39]); Thu, 31 Aug 2017 09:51:54 +0000 (UTC)", "Subject": "[dpdk-dev] [PATCH 11/21] vhost-user: handle IOTLB update and\n\tinvalidate requests", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Vhost-user device IOTLB protocol extension introduces\nVHOST_USER_IOTLB message type. The associated payload is the\nvhost_iotlb_msg struct defined in Kernel, which in this was can\nbe either an IOTLB update or invalidate message.\n\nOn IOTLB update, the virtqueues get notified of a new entry.\n\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\n lib/librte_vhost/vhost_user.c | 43 +++++++++++++++++++++++++++++++++++++++++++\n lib/librte_vhost/vhost_user.h | 1 +\n 2 files changed, 44 insertions(+)", "diff": "diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c\nindex 8b4a2b358..1cabba73f 100644\n--- a/lib/librte_vhost/vhost_user.c\n+++ b/lib/librte_vhost/vhost_user.c\n@@ -48,6 +48,7 @@\n #include <rte_malloc.h>\n #include <rte_log.h>\n \n+#include \"iotlb.h\"\n #include \"vhost.h\"\n #include \"vhost_user.h\"\n \n@@ -77,6 +78,7 @@ static const char *vhost_message_str[VHOST_USER_MAX] = {\n \t[VHOST_USER_SEND_RARP] = \"VHOST_USER_SEND_RARP\",\n \t[VHOST_USER_NET_SET_MTU] = \"VHOST_USER_NET_SET_MTU\",\n \t[VHOST_USER_SET_SLAVE_REQ_FD] = \"VHOST_USER_SET_SLAVE_REQ_FD\",\n+\t[VHOST_USER_IOTLB_MSG] = \"VHOST_USER_IOTLB_MSG\",\n };\n \n static uint64_t\n@@ -867,6 +869,43 @@ vhost_user_set_req_fd(struct virtio_net *dev, struct VhostUserMsg *msg)\n \treturn 0;\n }\n \n+static int\n+vhost_user_iotlb_msg(struct virtio_net *dev, struct VhostUserMsg *msg)\n+{\n+\tstruct vhost_iotlb_msg *imsg = &msg->payload.iotlb;\n+\tuint16_t i;\n+\tuint64_t vva;\n+\n+\tswitch (imsg->type) {\n+\tcase VHOST_IOTLB_UPDATE:\n+\t\tvva = qva_to_vva(dev, imsg->uaddr);\n+\t\tif (!vva)\n+\t\t\treturn -1;\n+\n+\t\tfor (i = 0; i < dev->nr_vring; i++) {\n+\t\t\tstruct vhost_virtqueue *vq = dev->virtqueue[i];\n+\n+\t\t\tvhost_user_iotlb_cache_insert(vq, imsg->iova, vva,\n+\t\t\t\t\timsg->size, imsg->perm);\n+\t\t}\n+\t\tbreak;\n+\tcase VHOST_IOTLB_INVALIDATE:\n+\t\tfor (i = 0; i < dev->nr_vring; i++) {\n+\t\t\tstruct vhost_virtqueue *vq = dev->virtqueue[i];\n+\n+\t\t\tvhost_user_iotlb_cache_remove(vq, imsg->iova,\n+\t\t\t\t\timsg->size);\n+\t\t}\n+\t\tbreak;\n+\tdefault:\n+\t\tRTE_LOG(ERR, VHOST_CONFIG, \"Invalid IOTLB message type (%d)\\n\",\n+\t\t\t\timsg->type);\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n /* return bytes# of read on success or negative val on failure. */\n static int\n read_vhost_message(int sockfd, struct VhostUserMsg *msg)\n@@ -1100,6 +1139,10 @@ vhost_user_msg_handler(int vid, int fd)\n \t\tret = vhost_user_set_req_fd(dev, &msg);\n \t\tbreak;\n \n+\tcase VHOST_USER_IOTLB_MSG:\n+\t\tret = vhost_user_iotlb_msg(dev, &msg);\n+\t\tbreak;\n+\n \tdefault:\n \t\tret = -1;\n \t\tbreak;\ndiff --git a/lib/librte_vhost/vhost_user.h b/lib/librte_vhost/vhost_user.h\nindex 0b2aff14e..46c6ff956 100644\n--- a/lib/librte_vhost/vhost_user.h\n+++ b/lib/librte_vhost/vhost_user.h\n@@ -80,6 +80,7 @@ typedef enum VhostUserRequest {\n \tVHOST_USER_SEND_RARP = 19,\n \tVHOST_USER_NET_SET_MTU = 20,\n \tVHOST_USER_SET_SLAVE_REQ_FD = 21,\n+\tVHOST_USER_IOTLB_MSG = 22,\n \tVHOST_USER_MAX\n } VhostUserRequest;\n \n", "prefixes": [ "dpdk-dev", "11/21" ] }{ "id": 28131, "url": "