Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/7068/?format=api
http://patches.dpdk.org/api/patches/7068/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1442588473-13122-2-git-send-email-yuanhan.liu@linux.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": "<1442588473-13122-2-git-send-email-yuanhan.liu@linux.intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1442588473-13122-2-git-send-email-yuanhan.liu@linux.intel.com", "date": "2015-09-18T15:01:02", "name": "[dpdk-dev,v5,01/12] vhost-user: add protocol features support", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "cb2bfd306d6ca79d48501b153a3fe3c57ffcade7", "submitter": { "id": 307, "url": "http://patches.dpdk.org/api/people/307/?format=api", "name": "Yuanhan Liu", "email": "yuanhan.liu@linux.intel.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1442588473-13122-2-git-send-email-yuanhan.liu@linux.intel.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/7068/comments/", "check": "pending", "checks": "http://patches.dpdk.org/api/patches/7068/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 B2A1E5A36;\n\tFri, 18 Sep 2015 16:59:54 +0200 (CEST)", "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id 0DD38CF9\n\tfor <dev@dpdk.org>; Fri, 18 Sep 2015 16:59:51 +0200 (CEST)", "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby orsmga102.jf.intel.com with ESMTP; 18 Sep 2015 07:59:50 -0700", "from yliu-dev.sh.intel.com ([10.239.66.60])\n\tby orsmga003.jf.intel.com with ESMTP; 18 Sep 2015 07:59:49 -0700" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.17,553,1437462000\"; d=\"scan'208\";a=\"647571700\"", "From": "Yuanhan Liu <yuanhan.liu@linux.intel.com>", "To": "dev@dpdk.org", "Date": "Fri, 18 Sep 2015 23:01:02 +0800", "Message-Id": "<1442588473-13122-2-git-send-email-yuanhan.liu@linux.intel.com>", "X-Mailer": "git-send-email 1.9.0", "In-Reply-To": "<1442588473-13122-1-git-send-email-yuanhan.liu@linux.intel.com>", "References": "<1442588473-13122-1-git-send-email-yuanhan.liu@linux.intel.com>", "Cc": "\"Michael S. Tsirkin\" <mst@redhat.com>, hangchun.ouyang@hotmail.com", "Subject": "[dpdk-dev] [PATCH v5 01/12] vhost-user: add protocol features\n\tsupport", "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": "The two protocol features messages are introduced by qemu vhost\nmaintainer(Michael) for extendting vhost-user interface. Here is\nan excerpta from the vhost-user spec:\n\n Any protocol extensions are gated by protocol feature bits,\n which allows full backwards compatibility on both master\n and slave.\n\nThe vhost-user multiple queue features will be treated as a vhost-user\nextension, hence, we have to implement the two messages first.\n\nVHOST_USER_PROTOCOL_FEATURES is initated to 0, as we don't support\nany yet.\n\nSigned-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>\n---\n lib/librte_vhost/rte_virtio_net.h | 1 +\n lib/librte_vhost/vhost_user/vhost-net-user.c | 13 ++++++++++++-\n lib/librte_vhost/vhost_user/vhost-net-user.h | 2 ++\n lib/librte_vhost/vhost_user/virtio-net-user.c | 13 +++++++++++++\n lib/librte_vhost/vhost_user/virtio-net-user.h | 5 +++++\n lib/librte_vhost/virtio-net.c | 5 ++++-\n 6 files changed, 37 insertions(+), 2 deletions(-)", "diff": "diff --git a/lib/librte_vhost/rte_virtio_net.h b/lib/librte_vhost/rte_virtio_net.h\nindex a037c15..e3a21e5 100644\n--- a/lib/librte_vhost/rte_virtio_net.h\n+++ b/lib/librte_vhost/rte_virtio_net.h\n@@ -99,6 +99,7 @@ struct virtio_net {\n \tstruct vhost_virtqueue\t*virtqueue[VIRTIO_QNUM];\t/**< Contains all virtqueue information. */\n \tstruct virtio_memory\t*mem;\t\t/**< QEMU memory and memory region information. */\n \tuint64_t\t\tfeatures;\t/**< Negotiated feature set. */\n+\tuint64_t\t\tprotocol_features;\t/**< Negotiated protocol feature set. */\n \tuint64_t\t\tdevice_fh;\t/**< device identifier. */\n \tuint32_t\t\tflags;\t\t/**< Device flags. Only used to check if device is running on data core. */\n #define IF_NAME_SZ (PATH_MAX > IFNAMSIZ ? PATH_MAX : IFNAMSIZ)\ndiff --git a/lib/librte_vhost/vhost_user/vhost-net-user.c b/lib/librte_vhost/vhost_user/vhost-net-user.c\nindex d1f8877..bc2ad24 100644\n--- a/lib/librte_vhost/vhost_user/vhost-net-user.c\n+++ b/lib/librte_vhost/vhost_user/vhost-net-user.c\n@@ -95,7 +95,9 @@ static const char *vhost_message_str[VHOST_USER_MAX] = {\n \t[VHOST_USER_GET_VRING_BASE] = \"VHOST_USER_GET_VRING_BASE\",\n \t[VHOST_USER_SET_VRING_KICK] = \"VHOST_USER_SET_VRING_KICK\",\n \t[VHOST_USER_SET_VRING_CALL] = \"VHOST_USER_SET_VRING_CALL\",\n-\t[VHOST_USER_SET_VRING_ERR] = \"VHOST_USER_SET_VRING_ERR\"\n+\t[VHOST_USER_SET_VRING_ERR] = \"VHOST_USER_SET_VRING_ERR\",\n+\t[VHOST_USER_GET_PROTOCOL_FEATURES] = \"VHOST_USER_GET_PROTOCOL_FEATURES\",\n+\t[VHOST_USER_SET_PROTOCOL_FEATURES] = \"VHOST_USER_SET_PROTOCOL_FEATURES\",\n };\n \n /**\n@@ -363,6 +365,15 @@ vserver_message_handler(int connfd, void *dat, int *remove)\n \t\tops->set_features(ctx, &features);\n \t\tbreak;\n \n+\tcase VHOST_USER_GET_PROTOCOL_FEATURES:\n+\t\tmsg.payload.u64 = VHOST_USER_PROTOCOL_FEATURES;\n+\t\tmsg.size = sizeof(msg.payload.u64);\n+\t\tsend_vhost_message(connfd, &msg);\n+\t\tbreak;\n+\tcase VHOST_USER_SET_PROTOCOL_FEATURES:\n+\t\tuser_set_protocol_features(ctx, msg.payload.u64);\n+\t\tbreak;\n+\n \tcase VHOST_USER_SET_OWNER:\n \t\tops->set_owner(ctx);\n \t\tbreak;\ndiff --git a/lib/librte_vhost/vhost_user/vhost-net-user.h b/lib/librte_vhost/vhost_user/vhost-net-user.h\nindex 2e72f3c..4490d23 100644\n--- a/lib/librte_vhost/vhost_user/vhost-net-user.h\n+++ b/lib/librte_vhost/vhost_user/vhost-net-user.h\n@@ -63,6 +63,8 @@ typedef enum VhostUserRequest {\n \tVHOST_USER_SET_VRING_KICK = 12,\n \tVHOST_USER_SET_VRING_CALL = 13,\n \tVHOST_USER_SET_VRING_ERR = 14,\n+\tVHOST_USER_GET_PROTOCOL_FEATURES = 15,\n+\tVHOST_USER_SET_PROTOCOL_FEATURES = 16,\n \tVHOST_USER_MAX\n } VhostUserRequest;\n \ndiff --git a/lib/librte_vhost/vhost_user/virtio-net-user.c b/lib/librte_vhost/vhost_user/virtio-net-user.c\nindex 4689927..360254e 100644\n--- a/lib/librte_vhost/vhost_user/virtio-net-user.c\n+++ b/lib/librte_vhost/vhost_user/virtio-net-user.c\n@@ -316,3 +316,16 @@ user_destroy_device(struct vhost_device_ctx ctx)\n \t\tdev->mem = NULL;\n \t}\n }\n+\n+void\n+user_set_protocol_features(struct vhost_device_ctx ctx,\n+\t\t\t uint64_t protocol_features)\n+{\n+\tstruct virtio_net *dev;\n+\n+\tdev = get_device(ctx);\n+\tif (dev == NULL || protocol_features & ~VHOST_USER_PROTOCOL_FEATURES)\n+\t\treturn;\n+\n+\tdev->protocol_features = protocol_features;\n+}\ndiff --git a/lib/librte_vhost/vhost_user/virtio-net-user.h b/lib/librte_vhost/vhost_user/virtio-net-user.h\nindex df24860..e7a6ff4 100644\n--- a/lib/librte_vhost/vhost_user/virtio-net-user.h\n+++ b/lib/librte_vhost/vhost_user/virtio-net-user.h\n@@ -37,12 +37,17 @@\n #include \"vhost-net.h\"\n #include \"vhost-net-user.h\"\n \n+#define VHOST_USER_PROTOCOL_FEATURES\t0ULL\n+\n int user_set_mem_table(struct vhost_device_ctx, struct VhostUserMsg *);\n \n void user_set_vring_call(struct vhost_device_ctx, struct VhostUserMsg *);\n \n void user_set_vring_kick(struct vhost_device_ctx, struct VhostUserMsg *);\n \n+void user_set_protocol_features(struct vhost_device_ctx ctx,\n+\t\t\t\tuint64_t protocol_features);\n+\n int user_get_vring_base(struct vhost_device_ctx, struct vhost_vring_state *);\n \n void user_destroy_device(struct vhost_device_ctx);\ndiff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c\nindex d0f1764..deac6b9 100644\n--- a/lib/librte_vhost/virtio-net.c\n+++ b/lib/librte_vhost/virtio-net.c\n@@ -67,11 +67,14 @@ struct virtio_net_device_ops const *notify_ops;\n /* root address of the linked list of managed virtio devices */\n static struct virtio_net_config_ll *ll_root;\n \n+#define VHOST_USER_F_PROTOCOL_FEATURES\t30\n+\n /* Features supported by this lib. */\n #define VHOST_SUPPORTED_FEATURES ((1ULL << VIRTIO_NET_F_MRG_RXBUF) | \\\n \t\t\t\t(1ULL << VIRTIO_NET_F_CTRL_VQ) | \\\n \t\t\t\t(1ULL << VIRTIO_NET_F_CTRL_RX) | \\\n-\t\t\t\t(1ULL << VHOST_F_LOG_ALL))\n+\t\t\t\t(1ULL << VHOST_F_LOG_ALL) | \\\n+\t\t\t\t(1ULL << VHOST_USER_F_PROTOCOL_FEATURES))\n static uint64_t VHOST_FEATURES = VHOST_SUPPORTED_FEATURES;\n \n \n", "prefixes": [ "dpdk-dev", "v5", "01/12" ] }{ "id": 7068, "url": "