Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/58706/?format=api
https://patches.dpdk.org/api/patches/58706/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1567740051-367172-1-git-send-email-andy.pei@intel.com/", "project": { "id": 1, "url": "https://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": "<1567740051-367172-1-git-send-email-andy.pei@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1567740051-367172-1-git-send-email-andy.pei@intel.com", "date": "2019-09-06T03:20:48", "name": "[1/4] vhost: introduce new API to get the active vring number", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "97544552540fb919b9071fb7ab65f7631dadb626", "submitter": { "id": 1185, "url": "https://patches.dpdk.org/api/people/1185/?format=api", "name": "Pei, Andy", "email": "andy.pei@intel.com" }, "delegate": { "id": 2642, "url": "https://patches.dpdk.org/api/users/2642/?format=api", "username": "mcoquelin", "first_name": "Maxime", "last_name": "Coquelin", "email": "maxime.coquelin@redhat.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1567740051-367172-1-git-send-email-andy.pei@intel.com/mbox/", "series": [ { "id": 6271, "url": "https://patches.dpdk.org/api/series/6271/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=6271", "date": "2019-09-06T03:20:48", "name": "[1/4] vhost: introduce new API to get the active vring number", "version": 1, "mbox": "https://patches.dpdk.org/series/6271/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/58706/comments/", "check": "fail", "checks": "https://patches.dpdk.org/api/patches/58706/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 0B6A81F0D4;\n\tFri, 6 Sep 2019 05:33:33 +0200 (CEST)", "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n\tby dpdk.org (Postfix) with ESMTP id 2A3051F0B2\n\tfor <dev@dpdk.org>; Fri, 6 Sep 2019 05:33:30 +0200 (CEST)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t05 Sep 2019 20:33:29 -0700", "from dpdk-dipei.sh.intel.com ([10.67.110.224])\n\tby fmsmga005.fm.intel.com with ESMTP; 05 Sep 2019 20:33:28 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.64,472,1559545200\"; d=\"scan'208\";a=\"383123521\"", "From": "Andy Pei <andy.pei@intel.com>", "To": "dev@dpdk.org", "Cc": "rosen.xu@intel.com, xiaolong.ye@intel.com, tiwei.bie@intel.com,\n\txiao.w.wang@intel.com", "Date": "Fri, 6 Sep 2019 11:20:48 +0800", "Message-Id": "<1567740051-367172-1-git-send-email-andy.pei@intel.com>", "X-Mailer": "git-send-email 1.8.3.1", "Subject": "[dpdk-dev] [PATCH 1/4] vhost: introduce new API to get the active\n\tvring number", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "It's useful for hardware vhost backend (like vDPA devices) to set\nmultiqueue configuration accordingly.\n\nSigned-off-by: Xiaolong Ye <xiaolong.ye@intel.com>\nSigned-off-by: Andy Pei <andy.pei@intel.com>\n---\n lib/librte_vhost/rte_vhost.h | 12 ++++++++++++\n lib/librte_vhost/vhost.c | 19 +++++++++++++++++++\n 2 files changed, 31 insertions(+)", "diff": "diff --git a/lib/librte_vhost/rte_vhost.h b/lib/librte_vhost/rte_vhost.h\nindex 7fb1729..28811b0 100644\n--- a/lib/librte_vhost/rte_vhost.h\n+++ b/lib/librte_vhost/rte_vhost.h\n@@ -525,6 +525,18 @@ int rte_vhost_driver_callback_register(const char *path,\n uint16_t rte_vhost_get_vring_num(int vid);\n \n /**\n+ * Get the number of active vrings of the device.\n+ *\n+ * @param vid\n+ * vhost device ID\n+ *\n+ * @return\n+ * The number of active vrings, 0 on failure\n+ */\n+uint16_t\n+rte_vhost_get_active_vring_num(int vid);\n+\n+/**\n * Get the virtio net device's ifname, which is the vhost-user socket\n * file path.\n *\ndiff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c\nindex 981837b..c714818 100644\n--- a/lib/librte_vhost/vhost.c\n+++ b/lib/librte_vhost/vhost.c\n@@ -674,6 +674,25 @@\n \treturn dev->nr_vring;\n }\n \n+uint16_t\n+rte_vhost_get_active_vring_num(int vid)\n+{\n+\tstruct virtio_net *dev = get_device(vid);\n+\tstruct vhost_virtqueue *vq;\n+\tuint16_t qid;\n+\n+\tif (dev == NULL)\n+\t\treturn 0;\n+\n+\tfor (qid = 0; qid < dev->nr_vring; qid++) {\n+\t\tvq = dev->virtqueue[qid];\n+\t\tif (!vq->enabled)\n+\t\t\tbreak;\n+\t}\n+\n+\treturn qid;\n+}\n+\n int\n rte_vhost_get_ifname(int vid, char *buf, size_t len)\n {\n", "prefixes": [ "1/4" ] }{ "id": 58706, "url": "