From: Zhihong Wang <zhihong.wang@intel.com>
To: dev@dpdk.org
Cc: jianfeng.tan@intel.com, tiwei.bie@intel.com,
maxime.coquelin@redhat.com, yliu@fridaylinux.org,
cunming.liang@intel.com, xiao.w.wang@intel.com,
dan.daly@intel.com, Zhihong Wang <zhihong.wang@intel.com>
Subject: [PATCH 2/7] vhost: export vhost feature definitions
Date: Fri, 2 Feb 2018 18:28:52 -0500 [thread overview]
Message-ID: <1517614137-62926-3-git-send-email-zhihong.wang@intel.com> (raw)
In-Reply-To: <1517614137-62926-1-git-send-email-zhihong.wang@intel.com>
This patch exports vhost-user protocol features to support device driver
development.
Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
---
lib/librte_vhost/rte_vhost.h | 8 ++++++++
lib/librte_vhost/vhost.h | 4 +---
lib/librte_vhost/vhost_user.c | 9 +++++----
lib/librte_vhost/vhost_user.h | 20 +++++++-------------
4 files changed, 21 insertions(+), 20 deletions(-)
diff --git a/lib/librte_vhost/rte_vhost.h b/lib/librte_vhost/rte_vhost.h
index 12cf48f..6c92580 100644
--- a/lib/librte_vhost/rte_vhost.h
+++ b/lib/librte_vhost/rte_vhost.h
@@ -29,6 +29,14 @@ extern "C" {
#define RTE_VHOST_USER_DEQUEUE_ZERO_COPY (1ULL << 2)
#define RTE_VHOST_USER_IOMMU_SUPPORT (1ULL << 3)
+#define RTE_VHOST_USER_PROTOCOL_F_MQ 0
+#define RTE_VHOST_USER_PROTOCOL_F_LOG_SHMFD 1
+#define RTE_VHOST_USER_PROTOCOL_F_RARP 2
+#define RTE_VHOST_USER_PROTOCOL_F_REPLY_ACK 3
+#define RTE_VHOST_USER_PROTOCOL_F_NET_MTU 4
+#define RTE_VHOST_USER_PROTOCOL_F_SLAVE_REQ 5
+#define RTE_VHOST_USER_F_PROTOCOL_FEATURES 30
+
/**
* Information relating to memory regions including offsets to
* addresses in QEMUs memory file.
diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
index 646aad3..09a745d 100644
--- a/lib/librte_vhost/vhost.h
+++ b/lib/librte_vhost/vhost.h
@@ -172,8 +172,6 @@ struct vhost_msg {
#define VIRTIO_F_VERSION_1 32
#endif
-#define VHOST_USER_F_PROTOCOL_FEATURES 30
-
/* Features supported by this builtin vhost-user net driver. */
#define VIRTIO_NET_SUPPORTED_FEATURES ((1ULL << VIRTIO_NET_F_MRG_RXBUF) | \
(1ULL << VIRTIO_F_ANY_LAYOUT) | \
@@ -183,7 +181,7 @@ struct vhost_msg {
(1ULL << VIRTIO_NET_F_MQ) | \
(1ULL << VIRTIO_F_VERSION_1) | \
(1ULL << VHOST_F_LOG_ALL) | \
- (1ULL << VHOST_USER_F_PROTOCOL_FEATURES) | \
+ (1ULL << RTE_VHOST_USER_F_PROTOCOL_FEATURES) | \
(1ULL << VIRTIO_NET_F_GSO) | \
(1ULL << VIRTIO_NET_F_HOST_TSO4) | \
(1ULL << VIRTIO_NET_F_HOST_TSO6) | \
diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index 87ba267..b1762e6 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -510,7 +510,7 @@ vhost_user_set_vring_addr(struct virtio_net **pdev, VhostUserMsg *msg)
vring_invalidate(dev, vq);
if (vq->enabled && (dev->features &
- (1ULL << VHOST_USER_F_PROTOCOL_FEATURES))) {
+ (1ULL << RTE_VHOST_USER_F_PROTOCOL_FEATURES))) {
dev = translate_ring_addresses(dev, msg->payload.state.index);
if (!dev)
return -1;
@@ -847,11 +847,11 @@ vhost_user_set_vring_kick(struct virtio_net **pdev, struct VhostUserMsg *pmsg)
vq = dev->virtqueue[file.index];
/*
- * When VHOST_USER_F_PROTOCOL_FEATURES is not negotiated,
+ * When RTE_VHOST_USER_F_PROTOCOL_FEATURES is not negotiated,
* the ring starts already enabled. Otherwise, it is enabled via
* the SET_VRING_ENABLE message.
*/
- if (!(dev->features & (1ULL << VHOST_USER_F_PROTOCOL_FEATURES)))
+ if (!(dev->features & (1ULL << RTE_VHOST_USER_F_PROTOCOL_FEATURES)))
vq->enabled = 1;
if (vq->kickfd >= 0)
@@ -961,7 +961,8 @@ vhost_user_get_protocol_features(struct virtio_net *dev)
* Qemu versions (from v2.7.0 to v2.9.0).
*/
if (!(features & (1ULL << VIRTIO_F_IOMMU_PLATFORM)))
- protocol_features &= ~(1ULL << VHOST_USER_PROTOCOL_F_REPLY_ACK);
+ protocol_features &=
+ ~(1ULL << RTE_VHOST_USER_PROTOCOL_F_REPLY_ACK);
return protocol_features;
}
diff --git a/lib/librte_vhost/vhost_user.h b/lib/librte_vhost/vhost_user.h
index d4bd604..58e475d 100644
--- a/lib/librte_vhost/vhost_user.h
+++ b/lib/librte_vhost/vhost_user.h
@@ -14,19 +14,13 @@
#define VHOST_MEMORY_MAX_NREGIONS 8
-#define VHOST_USER_PROTOCOL_F_MQ 0
-#define VHOST_USER_PROTOCOL_F_LOG_SHMFD 1
-#define VHOST_USER_PROTOCOL_F_RARP 2
-#define VHOST_USER_PROTOCOL_F_REPLY_ACK 3
-#define VHOST_USER_PROTOCOL_F_NET_MTU 4
-#define VHOST_USER_PROTOCOL_F_SLAVE_REQ 5
-
-#define VHOST_USER_PROTOCOL_FEATURES ((1ULL << VHOST_USER_PROTOCOL_F_MQ) | \
- (1ULL << VHOST_USER_PROTOCOL_F_LOG_SHMFD) |\
- (1ULL << VHOST_USER_PROTOCOL_F_RARP) | \
- (1ULL << VHOST_USER_PROTOCOL_F_REPLY_ACK) | \
- (1ULL << VHOST_USER_PROTOCOL_F_NET_MTU) | \
- (1ULL << VHOST_USER_PROTOCOL_F_SLAVE_REQ))
+#define VHOST_USER_PROTOCOL_FEATURES \
+ ((1ULL << RTE_VHOST_USER_PROTOCOL_F_MQ) | \
+ (1ULL << RTE_VHOST_USER_PROTOCOL_F_LOG_SHMFD) |\
+ (1ULL << RTE_VHOST_USER_PROTOCOL_F_RARP) | \
+ (1ULL << RTE_VHOST_USER_PROTOCOL_F_REPLY_ACK) | \
+ (1ULL << RTE_VHOST_USER_PROTOCOL_F_NET_MTU) | \
+ (1ULL << RTE_VHOST_USER_PROTOCOL_F_SLAVE_REQ))
typedef enum VhostUserRequest {
VHOST_USER_NONE = 0,
--
2.7.5
next prev parent reply other threads:[~2018-02-02 11:33 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-02 23:28 [PATCH 0/7] vhost: support selective datapath Zhihong Wang
2018-02-02 23:28 ` [PATCH 1/7] vhost: make capabilities configurable Zhihong Wang
2018-02-06 10:19 ` Maxime Coquelin
2018-02-08 3:03 ` Wang, Zhihong
2018-02-02 23:28 ` Zhihong Wang [this message]
2018-02-02 23:28 ` [PATCH 3/7] vhost: support selective datapath Zhihong Wang
2018-02-02 23:28 ` [PATCH 4/7] vhost: add apis for datapath configuration Zhihong Wang
2018-02-02 23:28 ` [PATCH 5/7] vhost: adapt vhost lib for selective datapath Zhihong Wang
2018-02-02 23:28 ` [PATCH 6/7] vhost: get callfd before device setup Zhihong Wang
2018-02-02 23:28 ` [PATCH 7/7] vhost: export new apis Zhihong Wang
2018-02-13 9:21 ` [PATCH v2 0/6] vhost: support selective datapath Zhihong Wang
2018-02-13 9:21 ` [PATCH v2 1/6] vhost: export vhost feature definitions Zhihong Wang
2018-03-06 9:37 ` Tan, Jianfeng
2018-03-06 14:03 ` Maxime Coquelin
2018-03-15 10:58 ` Wang, Zhihong
2018-02-13 9:21 ` [PATCH v2 2/6] vhost: support selective datapath Zhihong Wang
2018-02-13 9:21 ` [PATCH v2 3/6] vhost: add apis for datapath configuration Zhihong Wang
2018-02-13 9:21 ` [PATCH v2 4/6] vhost: adapt vhost lib for selective datapath Zhihong Wang
2018-02-13 9:21 ` [PATCH v2 5/6] vhost: add apis for live migration Zhihong Wang
2018-02-13 9:21 ` [PATCH v2 6/6] vhost: export new apis Zhihong Wang
2018-03-06 9:51 ` Tan, Jianfeng
2018-03-15 10:55 ` Wang, Zhihong
2018-02-27 10:13 ` [PATCH v3 0/5] vhost: support selective datapath Zhihong Wang
2018-02-27 10:13 ` [PATCH v3 1/5] vhost: export vhost feature definitions Zhihong Wang
2018-02-27 10:13 ` [PATCH v3 2/5] vhost: support selective datapath Zhihong Wang
2018-03-21 21:05 ` Maxime Coquelin
2018-03-22 7:55 ` Wang, Zhihong
2018-03-22 8:31 ` Maxime Coquelin
2018-02-27 10:13 ` [PATCH v3 3/5] vhost: add apis for datapath configuration Zhihong Wang
2018-03-21 21:08 ` Maxime Coquelin
2018-03-22 8:22 ` Wang, Zhihong
2018-03-22 14:18 ` Maxime Coquelin
2018-03-23 10:35 ` Wang, Zhihong
2018-02-27 10:13 ` [PATCH v3 4/5] vhost: adapt vhost lib for selective datapath Zhihong Wang
2018-02-27 10:13 ` [PATCH v3 5/5] vhost: add apis for live migration Zhihong Wang
2018-03-29 12:15 ` [PATCH v3 0/5] vhost: support selective datapath Wodkowski, PawelX
2018-03-30 9:35 ` Wang, Zhihong
2018-03-10 10:01 ` [PATCH v4 " Zhihong Wang
2018-03-10 10:01 ` [PATCH v4 1/5] vhost: export vhost feature definitions Zhihong Wang
2018-03-31 5:56 ` Maxime Coquelin
2018-03-10 10:01 ` [PATCH v4 2/5] vhost: support selective datapath Zhihong Wang
2018-03-31 6:10 ` Maxime Coquelin
2018-04-02 1:58 ` Wang, Zhihong
2018-03-31 7:38 ` Maxime Coquelin
2018-04-02 2:03 ` Wang, Zhihong
2018-03-10 10:01 ` [PATCH v4 3/5] vhost: add apis for datapath configuration Zhihong Wang
2018-03-31 7:04 ` Maxime Coquelin
2018-04-02 2:01 ` Wang, Zhihong
2018-03-10 10:01 ` [PATCH v4 4/5] vhost: adapt vhost lib for selective datapath Zhihong Wang
2018-03-31 7:35 ` Maxime Coquelin
2018-04-02 11:52 ` Wang, Zhihong
2018-03-10 10:01 ` [PATCH v4 5/5] vhost: add apis for live migration Zhihong Wang
2018-03-31 7:39 ` Maxime Coquelin
2018-04-02 11:46 ` [PATCH v5 0/5] vhost: support selective datapath Zhihong Wang
2018-04-02 11:46 ` [PATCH v5 1/5] vhost: export vhost feature definitions Zhihong Wang
2018-04-02 11:46 ` [PATCH v5 2/5] vhost: support selective datapath Zhihong Wang
2018-04-03 8:02 ` Maxime Coquelin
2018-04-15 17:39 ` Thomas Monjalon
2018-04-16 7:26 ` Maxime Coquelin
2018-04-03 8:19 ` Maxime Coquelin
2018-04-03 14:35 ` Wang, Zhihong
2018-04-02 11:46 ` [PATCH v5 3/5] vhost: add apis for datapath configuration Zhihong Wang
2018-04-03 8:07 ` Maxime Coquelin
2018-04-02 11:46 ` [PATCH v5 4/5] vhost: adapt vhost lib for selective datapath Zhihong Wang
2018-04-03 8:05 ` Maxime Coquelin
2018-04-02 11:46 ` [PATCH v5 5/5] vhost: add apis for live migration Zhihong Wang
2018-04-03 8:27 ` [PATCH v5 0/5] vhost: support selective datapath Maxime Coquelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1517614137-62926-3-git-send-email-zhihong.wang@intel.com \
--to=zhihong.wang@intel.com \
--cc=cunming.liang@intel.com \
--cc=dan.daly@intel.com \
--cc=dev@dpdk.org \
--cc=jianfeng.tan@intel.com \
--cc=maxime.coquelin@redhat.com \
--cc=tiwei.bie@intel.com \
--cc=xiao.w.wang@intel.com \
--cc=yliu@fridaylinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).