Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/118027/?format=api
http://patches.dpdk.org/api/patches/118027/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20221012064007.56040-1-changpeng.liu@intel.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": "<20221012064007.56040-1-changpeng.liu@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20221012064007.56040-1-changpeng.liu@intel.com", "date": "2022-10-12T06:40:07", "name": "[v2] vhost: add new `rte_vhost_vring_call_nonblock` API", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "5deeeacd0d0840a474d31868ce94c99f07d3744a", "submitter": { "id": 565, "url": "http://patches.dpdk.org/api/people/565/?format=api", "name": "Liu, Changpeng", "email": "changpeng.liu@intel.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/20221012064007.56040-1-changpeng.liu@intel.com/mbox/", "series": [ { "id": 25162, "url": "http://patches.dpdk.org/api/series/25162/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=25162", "date": "2022-10-12T06:40:07", "name": "[v2] vhost: add new `rte_vhost_vring_call_nonblock` API", "version": 2, "mbox": "http://patches.dpdk.org/series/25162/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/118027/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/118027/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 A615EA00C2;\n\tWed, 12 Oct 2022 08:40:32 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 8BFCA42BF0;\n\tWed, 12 Oct 2022 08:40:32 +0200 (CEST)", "from mga06.intel.com (mga06b.intel.com [134.134.136.31])\n by mails.dpdk.org (Postfix) with ESMTP id 91FB540691\n for <dev@dpdk.org>; Wed, 12 Oct 2022 08:40:30 +0200 (CEST)", "from fmsmga007.fm.intel.com ([10.253.24.52])\n by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 11 Oct 2022 23:40:26 -0700", "from waikikibeach52.sh.intel.com ([10.67.111.175])\n by fmsmga007.fm.intel.com with ESMTP; 11 Oct 2022 23:40:24 -0700" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1665556830; x=1697092830;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=+xFdynqz83Ss/GhETjSvqz7G+uUiSWMOSZ/KcpTQ0pQ=;\n b=LEMBKRMeH3sdP9jNp+hD0w/JCVf3ez4p+9h7rBBalgsb8htPCalB6xwQ\n RFnTnDSNgiwgHtorWVXGPu9PfWm/BmBudEeZNcPrKgpEKx3TAR2j5kHZv\n w7X/+fmdHXKvF8GV0wrqz8uo3WMVDQPrwhYZeT0eh60BRYyerVy/kh0Sx\n x0IBYPcVnM3q8jln+Rn14l3ahHrylbuXMzCfIgNQZfBmyGTIPHyT3CK7u\n U++9FMm7wcLnB6xbyC7CZkbCfKDmToS2r28oANdrpkjTKf4fzUOYn8ZXf\n wEcQD6CJ0sruZdvF5f5u2Kl+fesxSPbGkv9B6JOLjSnkAcuG+OzamJQz7 g==;", "X-IronPort-AV": [ "E=McAfee;i=\"6500,9779,10497\"; a=\"366713836\"", "E=Sophos;i=\"5.95,178,1661842800\"; d=\"scan'208\";a=\"366713836\"", "E=McAfee;i=\"6500,9779,10497\"; a=\"628992818\"", "E=Sophos;i=\"5.95,178,1661842800\"; d=\"scan'208\";a=\"628992818\"" ], "X-ExtLoop1": "1", "From": "Changpeng Liu <changpeng.liu@intel.com>", "To": "dev@dpdk.org", "Cc": "Changpeng Liu <changpeng.liu@intel.com>,\n Maxime Coquelin <maxime.coquelin@redhat.com>,\n Chenbo Xia <chenbo.xia@intel.com>,\n David Marchand <david.marchand@redhat.com>", "Subject": "[PATCH v2] vhost: add new `rte_vhost_vring_call_nonblock` API", "Date": "Wed, 12 Oct 2022 14:40:07 +0800", "Message-Id": "<20221012064007.56040-1-changpeng.liu@intel.com>", "X-Mailer": "git-send-email 2.21.3", "In-Reply-To": "<20220906022225.17215-1-changpeng.liu@intel.com>", "References": "<20220906022225.17215-1-changpeng.liu@intel.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": "Vhost-user library locks all VQ's access lock when processing\nvring based messages, such as SET_VRING_KICK and SET_VRING_CALL,\nand the data processing thread may already be started, e.g: SPDK\nvhost-blk and vhost-scsi will start the data processing thread\nwhen one vring is ready, then deadlock may happen when SPDK is\nposting interrupts to VM. Here, we add a new API which allows\ncaller to try again later for this case.\n\nBugzilla ID: 1015\nFixes: c5736998305d (\"vhost: fix missing virtqueue lock protection\")\n\nSigned-off-by: Changpeng Liu <changpeng.liu@intel.com>\n---\n lib/vhost/rte_vhost.h | 15 +++++++++++++++\n lib/vhost/version.map | 3 +++\n lib/vhost/vhost.c | 30 ++++++++++++++++++++++++++++++\n 3 files changed, 48 insertions(+)", "diff": "diff --git a/lib/vhost/rte_vhost.h b/lib/vhost/rte_vhost.h\nindex bb7d86a432..d22b25cd4e 100644\n--- a/lib/vhost/rte_vhost.h\n+++ b/lib/vhost/rte_vhost.h\n@@ -909,6 +909,21 @@ rte_vhost_clr_inflight_desc_packed(int vid, uint16_t vring_idx,\n */\n int rte_vhost_vring_call(int vid, uint16_t vring_idx);\n \n+/**\n+ * Notify the guest that used descriptors have been added to the vring. This\n+ * function acts as a memory barrier. This function will return -EAGAIN when\n+ * vq's access lock is held by other thread, user should try again later.\n+ *\n+ * @param vid\n+ * vhost device ID\n+ * @param vring_idx\n+ * vring index\n+ * @return\n+ * 0 on success, -1 on failure, -EAGAIN for another retry\n+ */\n+__rte_experimental\n+int rte_vhost_vring_call_nonblock(int vid, uint16_t vring_idx);\n+\n /**\n * Get vhost RX queue avail count.\n *\ndiff --git a/lib/vhost/version.map b/lib/vhost/version.map\nindex 7a00b65740..c8c44b8326 100644\n--- a/lib/vhost/version.map\n+++ b/lib/vhost/version.map\n@@ -94,6 +94,9 @@ EXPERIMENTAL {\n \trte_vhost_async_try_dequeue_burst;\n \trte_vhost_driver_get_vdpa_dev_type;\n \trte_vhost_clear_queue;\n+\n+\t# added in 22.11\n+\trte_vhost_vring_call_nonblock;\n };\n \n INTERNAL {\ndiff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c\nindex 8740aa2788..ed6efb003f 100644\n--- a/lib/vhost/vhost.c\n+++ b/lib/vhost/vhost.c\n@@ -1317,6 +1317,36 @@ rte_vhost_vring_call(int vid, uint16_t vring_idx)\n \treturn 0;\n }\n \n+int\n+rte_vhost_vring_call_nonblock(int vid, uint16_t vring_idx)\n+{\n+\tstruct virtio_net *dev;\n+\tstruct vhost_virtqueue *vq;\n+\n+\tdev = get_device(vid);\n+\tif (!dev)\n+\t\treturn -1;\n+\n+\tif (vring_idx >= VHOST_MAX_VRING)\n+\t\treturn -1;\n+\n+\tvq = dev->virtqueue[vring_idx];\n+\tif (!vq)\n+\t\treturn -1;\n+\n+\tif (!rte_spinlock_trylock(&vq->access_lock))\n+\t\treturn -EAGAIN;\n+\n+\tif (vq_is_packed(dev))\n+\t\tvhost_vring_call_packed(dev, vq);\n+\telse\n+\t\tvhost_vring_call_split(dev, vq);\n+\n+\trte_spinlock_unlock(&vq->access_lock);\n+\n+\treturn 0;\n+}\n+\n uint16_t\n rte_vhost_avail_entries(int vid, uint16_t queue_id)\n {\n", "prefixes": [ "v2" ] }{ "id": 118027, "url": "