Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/96231/?format=api
http://patchwork.dpdk.org/api/patches/96231/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20210723080937.20256-4-cheng1.jiang@intel.com/", "project": { "id": 1, "url": "http://patchwork.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": "<20210723080937.20256-4-cheng1.jiang@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20210723080937.20256-4-cheng1.jiang@intel.com", "date": "2021-07-23T08:09:36", "name": "[v8,3/4] vhost: handle memory hotplug for async vhost", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "4dfdfaf8843da47c4b4cee04a0e009eb42e720d0", "submitter": { "id": 1530, "url": "http://patchwork.dpdk.org/api/people/1530/?format=api", "name": "Jiang, Cheng1", "email": "Cheng1.jiang@intel.com" }, "delegate": { "id": 2642, "url": "http://patchwork.dpdk.org/api/users/2642/?format=api", "username": "mcoquelin", "first_name": "Maxime", "last_name": "Coquelin", "email": "maxime.coquelin@redhat.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20210723080937.20256-4-cheng1.jiang@intel.com/mbox/", "series": [ { "id": 17963, "url": "http://patchwork.dpdk.org/api/series/17963/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=17963", "date": "2021-07-23T08:09:33", "name": "vhost: handle memory hotplug for async vhost", "version": 8, "mbox": "http://patchwork.dpdk.org/series/17963/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/96231/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/96231/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id E9E32A0C46;\n\tFri, 23 Jul 2021 10:27:21 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 329F3410E9;\n\tFri, 23 Jul 2021 10:27:10 +0200 (CEST)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n by mails.dpdk.org (Postfix) with ESMTP id 83981410E2\n for <dev@dpdk.org>; Fri, 23 Jul 2021 10:27:08 +0200 (CEST)", "from fmsmga003.fm.intel.com ([10.253.24.29])\n by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 23 Jul 2021 01:27:08 -0700", "from dpdk_jiangcheng.sh.intel.com ([10.67.119.149])\n by FMSMGA003.fm.intel.com with ESMTP; 23 Jul 2021 01:27:06 -0700" ], "X-IronPort-AV": [ "E=McAfee;i=\"6200,9189,10053\"; a=\"199042818\"", "E=Sophos;i=\"5.84,263,1620716400\"; d=\"scan'208\";a=\"199042818\"", "E=Sophos;i=\"5.84,263,1620716400\"; d=\"scan'208\";a=\"502430112\"" ], "X-ExtLoop1": "1", "From": "Cheng Jiang <cheng1.jiang@intel.com>", "To": "maxime.coquelin@redhat.com,\n\tChenbo.Xia@intel.com", "Cc": "dev@dpdk.org,\n\tjiayu.hu@intel.com,\n\tyvonnex.yang@intel.com", "Date": "Fri, 23 Jul 2021 08:09:36 +0000", "Message-Id": "<20210723080937.20256-4-cheng1.jiang@intel.com>", "X-Mailer": "git-send-email 2.29.2", "In-Reply-To": "<20210723080937.20256-1-cheng1.jiang@intel.com>", "References": "<20210602042802.31943-1-cheng1.jiang@intel.com>\n <20210723080937.20256-1-cheng1.jiang@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v8 3/4] vhost: handle memory hotplug for async\n vhost", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "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": "From: Jiayu Hu <jiayu.hu@intel.com>\n\nWhen the guest memory is hotplugged, the vhost application which\nenables DMA acceleration must stop DMA transfers before the vhost\nre-maps the guest memory.\n\nThis patch is to notify the vhost application of stopping DMA\ntransfers.\n\nSigned-off-by: Jiayu Hu <jiayu.hu@intel.com>\nReviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\n lib/vhost/vhost_user.c | 16 ++++++++++++++++\n 1 file changed, 16 insertions(+)", "diff": "diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c\nindex 31300e194f..433f412fa8 100644\n--- a/lib/vhost/vhost_user.c\n+++ b/lib/vhost/vhost_user.c\n@@ -1248,6 +1248,7 @@ vhost_user_set_mem_table(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \tint numa_node = SOCKET_ID_ANY;\n \tuint64_t mmap_offset;\n \tuint32_t i;\n+\tbool async_notify = false;\n \n \tif (validate_msg_fds(msg, memory->nregions) != 0)\n \t\treturn RTE_VHOST_MSG_RESULT_ERR;\n@@ -1275,6 +1276,16 @@ vhost_user_set_mem_table(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \t\t\t\tvdpa_dev->ops->dev_close(dev->vid);\n \t\t\tdev->flags &= ~VIRTIO_DEV_VDPA_CONFIGURED;\n \t\t}\n+\n+\t\t/* notify the vhost application to stop DMA transfers */\n+\t\tif (dev->async_copy && dev->notify_ops->vring_state_changed) {\n+\t\t\tfor (i = 0; i < dev->nr_vring; i++) {\n+\t\t\t\tdev->notify_ops->vring_state_changed(dev->vid,\n+\t\t\t\t\t\ti, 0);\n+\t\t\t}\n+\t\t\tasync_notify = true;\n+\t\t}\n+\n \t\tfree_mem_region(dev);\n \t\trte_free(dev->mem);\n \t\tdev->mem = NULL;\n@@ -1371,6 +1382,11 @@ vhost_user_set_mem_table(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \n \tdump_guest_pages(dev);\n \n+\tif (async_notify) {\n+\t\tfor (i = 0; i < dev->nr_vring; i++)\n+\t\t\tdev->notify_ops->vring_state_changed(dev->vid, i, 1);\n+\t}\n+\n \treturn RTE_VHOST_MSG_RESULT_OK;\n \n free_mem_table:\n", "prefixes": [ "v8", "3/4" ] }{ "id": 96231, "url": "