Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/7088/?format=api
https://patches.dpdk.org/api/patches/7088/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1442589061-19225-10-git-send-email-yuanhan.liu@linux.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": "<1442589061-19225-10-git-send-email-yuanhan.liu@linux.intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1442589061-19225-10-git-send-email-yuanhan.liu@linux.intel.com", "date": "2015-09-18T15:10:58", "name": "[dpdk-dev,v5,resend,09/12] vhost: add API bind a virtq to a specific core", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "b5d7eea9bf02265033c57fb9d01da5909036cf17", "submitter": { "id": 307, "url": "https://patches.dpdk.org/api/people/307/?format=api", "name": "Yuanhan Liu", "email": "yuanhan.liu@linux.intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1442589061-19225-10-git-send-email-yuanhan.liu@linux.intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/7088/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/7088/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id EF8718E86;\n\tFri, 18 Sep 2015 17:09:55 +0200 (CEST)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 9F8258E8D\n\tfor <dev@dpdk.org>; Fri, 18 Sep 2015 17:09:53 +0200 (CEST)", "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga102.fm.intel.com with ESMTP; 18 Sep 2015 08:09:53 -0700", "from yliu-dev.sh.intel.com ([10.239.66.60])\n\tby fmsmga001.fm.intel.com with ESMTP; 18 Sep 2015 08:09:51 -0700" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.17,553,1437462000\"; d=\"scan'208\";a=\"792565945\"", "From": "Yuanhan Liu <yuanhan.liu@linux.intel.com>", "To": "dev@dpdk.org", "Date": "Fri, 18 Sep 2015 23:10:58 +0800", "Message-Id": "<1442589061-19225-10-git-send-email-yuanhan.liu@linux.intel.com>", "X-Mailer": "git-send-email 1.9.0", "In-Reply-To": "<1442589061-19225-1-git-send-email-yuanhan.liu@linux.intel.com>", "References": "<1442589061-19225-1-git-send-email-yuanhan.liu@linux.intel.com>", "Cc": "\"Michael S. Tsirkin\" <mst@redhat.com>", "Subject": "[dpdk-dev] [PATCH v5 resend 09/12] vhost: add API bind a virtq to a\n\tspecific core", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "patches and discussions about DPDK <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "From: Changchun Ouyang <changchun.ouyang@intel.com>\n\nThe new API rte_vhost_core_id_set() is to bind a virtq to a specific\ncore, while the another API rte_vhost_core_id_get() is for getting\nthe bind core for a virtq.\n\nThe usage, which will be introduced soon, could be find at examles/vhost/main.c.\n\nSigned-off-by: Changchun Ouyang <changchun.ouyang@intel.com>\nSigned-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>\n---\n lib/librte_vhost/rte_vhost_version.map | 7 +++++++\n lib/librte_vhost/rte_virtio_net.h | 25 +++++++++++++++++++++++++\n lib/librte_vhost/virtio-net.c | 25 +++++++++++++++++++++++++\n 3 files changed, 57 insertions(+)", "diff": "diff --git a/lib/librte_vhost/rte_vhost_version.map b/lib/librte_vhost/rte_vhost_version.map\nindex 3d8709e..2ce141c 100644\n--- a/lib/librte_vhost/rte_vhost_version.map\n+++ b/lib/librte_vhost/rte_vhost_version.map\n@@ -18,5 +18,12 @@ DPDK_2.1 {\n \tglobal:\n \n \trte_vhost_driver_unregister;\n+} DPDK_2.0;\n+\n+\n+DPDK_2.2 {\n+\tglobal:\n \n+\trte_vhost_core_id_get;\n+\trte_vhost_core_id_set;\n } DPDK_2.0;\ndiff --git a/lib/librte_vhost/rte_virtio_net.h b/lib/librte_vhost/rte_virtio_net.h\nindex 08b69df..7785729 100644\n--- a/lib/librte_vhost/rte_virtio_net.h\n+++ b/lib/librte_vhost/rte_virtio_net.h\n@@ -90,6 +90,7 @@ struct vhost_virtqueue {\n \tint\t\t\tcallfd;\t\t\t/**< Used to notify the guest (trigger interrupt). */\n \tint\t\t\tkickfd;\t\t\t/**< Currently unused as polling mode is enabled. */\n \tint\t\t\tenabled;\n+\tuint32_t\t\tcore_id;\t\t/**< Data core that the vq is attached to */\n \tstruct buf_vector\tbuf_vec[BUF_VECTOR_MAX];\t/**< for scatter RX. */\n } __rte_cache_aligned;\n \n@@ -238,4 +239,28 @@ uint16_t rte_vhost_enqueue_burst(struct virtio_net *dev, uint16_t queue_id,\n uint16_t rte_vhost_dequeue_burst(struct virtio_net *dev, uint16_t queue_id,\n \tstruct rte_mempool *mbuf_pool, struct rte_mbuf **pkts, uint16_t count);\n \n+/**\n+ * This function get the data core id for queue pair in one vhost device.\n+ * @param dev\n+ * virtio-net device\n+ * @param queue_id\n+ * virtio queue index in mq case\n+ * @return\n+ * core id of queue pair of specified virtio device.\n+ */\n+uint16_t rte_vhost_core_id_get(volatile struct virtio_net *dev,\n+\t\t\t uint16_t queue_id);\n+\n+/**\n+ * This function set the data core id for queue pair in one vhost device.\n+ * @param dev\n+ * virtio-net device\n+ * @param queue_id\n+ * virtio queue index in mq case\n+ * @param core_id\n+ * data core id for virtio queue pair in mq case\n+ */\n+void rte_vhost_core_id_set(struct virtio_net *dev, uint16_t queue_id,\n+\t\t\t uint16_t core_id);\n+\n #endif /* _VIRTIO_NET_H_ */\ndiff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c\nindex 49840b5..33bdacd 100644\n--- a/lib/librte_vhost/virtio-net.c\n+++ b/lib/librte_vhost/virtio-net.c\n@@ -867,6 +867,31 @@ int rte_vhost_feature_enable(uint64_t feature_mask)\n \treturn -1;\n }\n \n+uint16_t\n+rte_vhost_core_id_get(volatile struct virtio_net *dev, uint16_t queue_id)\n+{\n+\tif (dev == NULL)\n+\t\treturn 0;\n+\n+\tif (dev->virtqueue == NULL || dev->virtqueue[queue_id] == NULL)\n+\t\treturn 0;\n+\n+\treturn dev->virtqueue[queue_id]->core_id;\n+}\n+\n+void\n+rte_vhost_core_id_set(struct virtio_net *dev, uint16_t queue_id,\n+\t\t uint16_t core_id)\n+{\n+\tif (dev == NULL)\n+\t\treturn;\n+\n+\tif (dev->virtqueue == NULL || dev->virtqueue[queue_id] == NULL)\n+\t\treturn;\n+\n+\tdev->virtqueue[queue_id]->core_id = core_id;\n+}\n+\n /*\n * Register ops so that we can add/remove device to data core.\n */\n", "prefixes": [ "dpdk-dev", "v5", "resend", "09/12" ] }{ "id": 7088, "url": "