Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/96186/?format=api
http://patchwork.dpdk.org/api/patches/96186/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20210722040907.20468-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": "<20210722040907.20468-4-cheng1.jiang@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20210722040907.20468-4-cheng1.jiang@intel.com", "date": "2021-07-22T04:09:05", "name": "[v7,3/5] vhost: handle memory hotplug for async vhost", "commit_ref": null, "pull_url": null, "state": "superseded", "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/20210722040907.20468-4-cheng1.jiang@intel.com/mbox/", "series": [ { "id": 17945, "url": "http://patchwork.dpdk.org/api/series/17945/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=17945", "date": "2021-07-22T04:09:02", "name": "vhost: handle memory hotplug for async vhost", "version": 7, "mbox": "http://patchwork.dpdk.org/series/17945/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/96186/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/96186/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 EE598A0C45;\n\tThu, 22 Jul 2021 06:26:43 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 045CD410F8;\n\tThu, 22 Jul 2021 06:26:32 +0200 (CEST)", "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n by mails.dpdk.org (Postfix) with ESMTP id 5650C410F1\n for <dev@dpdk.org>; Thu, 22 Jul 2021 06:26:30 +0200 (CEST)", "from fmsmga006.fm.intel.com ([10.253.24.20])\n by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 21 Jul 2021 21:26:30 -0700", "from dpdk_jiangcheng.sh.intel.com ([10.67.119.149])\n by fmsmga006.fm.intel.com with ESMTP; 21 Jul 2021 21:26:28 -0700" ], "X-IronPort-AV": [ "E=McAfee;i=\"6200,9189,10052\"; a=\"209664606\"", "E=Sophos;i=\"5.84,259,1620716400\"; d=\"scan'208\";a=\"209664606\"", "E=Sophos;i=\"5.84,259,1620716400\"; d=\"scan'208\";a=\"658668671\"" ], "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": "Thu, 22 Jul 2021 04:09:05 +0000", "Message-Id": "<20210722040907.20468-4-cheng1.jiang@intel.com>", "X-Mailer": "git-send-email 2.29.2", "In-Reply-To": "<20210722040907.20468-1-cheng1.jiang@intel.com>", "References": "<20210602042802.31943-1-cheng1.jiang@intel.com>\n <20210722040907.20468-1-cheng1.jiang@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v7 3/5] 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": [ "v7", "3/5" ] }{ "id": 96186, "url": "