Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/115830/?format=api
http://patches.dpdk.org/api/patches/115830/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/eabadfac7953da66bc10ffb8284b490d09bb7ec7.1662347861.git.kangjie.xu@linux.alibaba.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": "<eabadfac7953da66bc10ffb8284b490d09bb7ec7.1662347861.git.kangjie.xu@linux.alibaba.com>", "list_archive_url": "https://inbox.dpdk.org/dev/eabadfac7953da66bc10ffb8284b490d09bb7ec7.1662347861.git.kangjie.xu@linux.alibaba.com", "date": "2022-09-05T03:48:05", "name": "[v2,2/2] vhost: introduce VHOST_USER_RESET_VRING", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "df4bb1cdc5d76d53f9871683b738895e7553d855", "submitter": { "id": 2778, "url": "http://patches.dpdk.org/api/people/2778/?format=api", "name": "Kangjie Xu", "email": "kangjie.xu@linux.alibaba.com" }, "delegate": { "id": 2642, "url": "http://patches.dpdk.org/api/users/2642/?format=api", "username": "mcoquelin", "first_name": "Maxime", "last_name": "Coquelin", "email": "maxime.coquelin@redhat.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/eabadfac7953da66bc10ffb8284b490d09bb7ec7.1662347861.git.kangjie.xu@linux.alibaba.com/mbox/", "series": [ { "id": 24529, "url": "http://patches.dpdk.org/api/series/24529/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=24529", "date": "2022-09-05T03:48:03", "name": "vhost: support VIRTIO_F_RING_RESET for vhost-user", "version": 2, "mbox": "http://patches.dpdk.org/series/24529/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/115830/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/115830/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 B4682A0556;\n\tMon, 5 Sep 2022 05:48:17 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A960D40E5A;\n\tMon, 5 Sep 2022 05:48:12 +0200 (CEST)", "from out30-43.freemail.mail.aliyun.com\n (out30-43.freemail.mail.aliyun.com [115.124.30.43])\n by mails.dpdk.org (Postfix) with ESMTP id 91A34400D4\n for <dev@dpdk.org>; Mon, 5 Sep 2022 05:48:10 +0200 (CEST)", "from localhost(mailfrom:kangjie.xu@linux.alibaba.com\n fp:SMTPD_---0VOK6FgW_1662349687) by smtp.aliyun-inc.com;\n Mon, 05 Sep 2022 11:48:08 +0800" ], "X-Alimail-AntiSpam": "AC=PASS; BC=-1|-1; BR=01201311R121e4; CH=green;\n DM=||false|;\n DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=ay29a033018045168;\n MF=kangjie.xu@linux.alibaba.com; NM=1; PH=DS; RN=7; SR=0;\n TI=SMTPD_---0VOK6FgW_1662349687;", "From": "Kangjie Xu <kangjie.xu@linux.alibaba.com>", "To": "maxime.coquelin@redhat.com,\n\tchenbo.xia@intel.com", "Cc": "dev@dpdk.org, xuanzhuo@linux.alibaba.com, hengqi@linux.alibaba.com,\n jasonwang@redhat.com, mst@redhat.com", "Subject": "[PATCH v2 2/2] vhost: introduce VHOST_USER_RESET_VRING", "Date": "Mon, 5 Sep 2022 11:48:05 +0800", "Message-Id": "\n <eabadfac7953da66bc10ffb8284b490d09bb7ec7.1662347861.git.kangjie.xu@linux.alibaba.com>", "X-Mailer": "git-send-email 2.32.0", "In-Reply-To": "<cover.1662347861.git.kangjie.xu@linux.alibaba.com>", "References": "<cover.1662347861.git.kangjie.xu@linux.alibaba.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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" }, "content": "To support the reset operation for an individual virtqueue, we\nintroduce a new message VHOST_USER_RESET_VRING. When the feature\nVIRTIO_F_RING_RESET feature has been successfully negotiated, This\nmessage is submitted by the front-end to reset an individual\nvirtqueue to initial states in the back-end. The reply is needed\nto ensure that the reset operation is complete.\n\nSigned-off-by: Kangjie Xu <kangjie.xu@linux.alibaba.com>\nSigned-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>\n---\n lib/vhost/vhost.c | 2 +-\n lib/vhost/vhost.h | 1 +\n lib/vhost/vhost_user.c | 27 ++++++++++++++++++++++++++-\n lib/vhost/vhost_user.h | 1 +\n 4 files changed, 29 insertions(+), 2 deletions(-)", "diff": "diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c\nindex 60cb05a0ff..215a1ca355 100644\n--- a/lib/vhost/vhost.c\n+++ b/lib/vhost/vhost.c\n@@ -610,7 +610,7 @@ init_vring_queue(struct virtio_net *dev, uint32_t vring_idx)\n \tvhost_user_iotlb_init(dev, vring_idx);\n }\n \n-static void\n+void\n reset_vring_queue(struct virtio_net *dev, uint32_t vring_idx)\n {\n \tstruct vhost_virtqueue *vq;\ndiff --git a/lib/vhost/vhost.h b/lib/vhost/vhost.h\nindex 76461a3406..eccb52842d 100644\n--- a/lib/vhost/vhost.h\n+++ b/lib/vhost/vhost.h\n@@ -791,6 +791,7 @@ get_device(int vid)\n \n int vhost_new_device(void);\n void cleanup_device(struct virtio_net *dev, int destroy);\n+void reset_vring_queue(struct virtio_net *dev, uint32_t vring_idx);\n void reset_device(struct virtio_net *dev);\n void vhost_destroy_device(int);\n void vhost_destroy_device_notify(struct virtio_net *dev);\ndiff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c\nindex 4ad28bac45..5f7743d9d9 100644\n--- a/lib/vhost/vhost_user.c\n+++ b/lib/vhost/vhost_user.c\n@@ -2771,6 +2771,30 @@ vhost_user_set_status(struct virtio_net **pdev,\n \treturn RTE_VHOST_MSG_RESULT_OK;\n }\n \n+static int\n+vhost_user_reset_vring(struct virtio_net **pdev,\n+\t\t\tstruct vhu_msg_context *ctx __rte_unused,\n+\t\t\tint main_fd __rte_unused)\n+{\n+\tstruct virtio_net *dev = *pdev;\n+\tint index = (int)ctx->msg.payload.state.index;\n+\n+\tVHOST_LOG_CONFIG(dev->ifname, INFO, \"reset queue: queue idx: %d\\n\", index);\n+\n+\tif (!(dev->features & (1ULL << VIRTIO_F_RING_RESET))) {\n+\t\treturn RTE_VHOST_MSG_RESULT_ERR;\n+\t}\n+\n+\tdev->virtqueue[index]->enabled = false;\n+\treset_vring_queue(dev, index);\n+\n+\tctx->msg.payload.state.num = 0;\n+\tctx->msg.size = sizeof(ctx->msg.payload.u64);\n+\tctx->fd_num = 0;\n+\n+\treturn RTE_VHOST_MSG_RESULT_REPLY;\n+}\n+\n #define VHOST_MESSAGE_HANDLERS \\\n VHOST_MESSAGE_HANDLER(VHOST_USER_NONE, NULL, false) \\\n VHOST_MESSAGE_HANDLER(VHOST_USER_GET_FEATURES, vhost_user_get_features, false) \\\n@@ -2803,7 +2827,8 @@ VHOST_MESSAGE_HANDLER(VHOST_USER_POSTCOPY_END, vhost_user_postcopy_end, false) \\\n VHOST_MESSAGE_HANDLER(VHOST_USER_GET_INFLIGHT_FD, vhost_user_get_inflight_fd, false) \\\n VHOST_MESSAGE_HANDLER(VHOST_USER_SET_INFLIGHT_FD, vhost_user_set_inflight_fd, true) \\\n VHOST_MESSAGE_HANDLER(VHOST_USER_SET_STATUS, vhost_user_set_status, false) \\\n-VHOST_MESSAGE_HANDLER(VHOST_USER_GET_STATUS, vhost_user_get_status, false)\n+VHOST_MESSAGE_HANDLER(VHOST_USER_GET_STATUS, vhost_user_get_status, false) \\\n+VHOST_MESSAGE_HANDLER(VHOST_USER_RESET_VRING, vhost_user_reset_vring, false)\n \n #define VHOST_MESSAGE_HANDLER(id, handler, accepts_fd) \\\n \t[id] = { #id, handler, accepts_fd },\ndiff --git a/lib/vhost/vhost_user.h b/lib/vhost/vhost_user.h\nindex 8ecca68597..51cb2fc74a 100644\n--- a/lib/vhost/vhost_user.h\n+++ b/lib/vhost/vhost_user.h\n@@ -60,6 +60,7 @@ typedef enum VhostUserRequest {\n \tVHOST_USER_SET_INFLIGHT_FD = 32,\n \tVHOST_USER_SET_STATUS = 39,\n \tVHOST_USER_GET_STATUS = 40,\n+\tVHOST_USER_RESET_VRING = 41\n } VhostUserRequest;\n \n typedef enum VhostUserSlaveRequest {\n", "prefixes": [ "v2", "2/2" ] }{ "id": 115830, "url": "