From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: "Tan, Jianfeng" <jianfeng.tan@intel.com>,
"Wang, Zhihong" <zhihong.wang@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>
Cc: "Bie, Tiwei" <tiwei.bie@intel.com>,
"yliu@fridaylinux.org" <yliu@fridaylinux.org>,
"Liang, Cunming" <cunming.liang@intel.com>,
"Wang, Xiao W" <xiao.w.wang@intel.com>,
"Daly, Dan" <dan.daly@intel.com>
Subject: Re: [dpdk-dev] [PATCH v2 1/6] vhost: export vhost feature definitions
Date: Tue, 6 Mar 2018 15:03:00 +0100 [thread overview]
Message-ID: <fedfb5d6-fdd9-72ba-54bf-68783114a006@redhat.com> (raw)
In-Reply-To: <ED26CBA2FAD1BF48A8719AEF02201E3651463B51@SHSMSX103.ccr.corp.intel.com>
On 03/06/2018 10:37 AM, Tan, Jianfeng wrote:
>
>
>> -----Original Message-----
>> From: Wang, Zhihong
>> Sent: Tuesday, February 13, 2018 5:21 PM
>> To: dev@dpdk.org
>> Cc: Tan, Jianfeng; Bie, Tiwei; maxime.coquelin@redhat.com;
>> yliu@fridaylinux.org; Liang, Cunming; Wang, Xiao W; Daly, Dan; Wang,
>> Zhihong
>> Subject: [PATCH v2 1/6] vhost: export vhost feature definitions
>>
>> 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 d33206997..b05162366 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
>
> Instead of adding a "RTE_" prefix. I prefer to define it like this:
> #ifndef VHOST_USER_PROTOCOL_F_MQ
> #define VHOST_USER_PROTOCOL_F_MQ 0
> #endif
>
> Similar to other macros.
I agree, it is better to keep same naming as in the spec IMHO.
>> +#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
Please put the above declaration separately, it could be misleading,
making to think it is a vhost-user protocol feature whereas it is a
Virtio feature.
>> +
>> /**
>> * 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 58aec2e0d..a0b0520e2 100644
>> --- a/lib/librte_vhost/vhost.h
>> +++ b/lib/librte_vhost/vhost.h
>> @@ -174,8 +174,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) | \
>> @@ -185,7 +183,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 5c5361066..c93e48e4d 100644
>> --- a/lib/librte_vhost/vhost_user.c
>> +++ b/lib/librte_vhost/vhost_user.c
>> @@ -527,7 +527,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.addr.index);
>> if (!dev)
>> return -1;
>> @@ -897,11 +897,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)
>> @@ -1012,7 +1012,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);
>>
>> msg->payload.u64 = protocol_features;
>> msg->size = sizeof(msg->payload.u64);
>> diff --git a/lib/librte_vhost/vhost_user.h b/lib/librte_vhost/vhost_user.h
>> index 0fafbe6e0..066e772dd 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.13.6
>
next prev parent reply other threads:[~2018-03-06 14:03 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-02 23:28 [dpdk-dev] [PATCH 0/7] vhost: support selective datapath Zhihong Wang
2018-02-02 23:28 ` [dpdk-dev] [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 ` [dpdk-dev] [PATCH 2/7] vhost: export vhost feature definitions Zhihong Wang
2018-02-02 23:28 ` [dpdk-dev] [PATCH 3/7] vhost: support selective datapath Zhihong Wang
2018-02-02 23:28 ` [dpdk-dev] [PATCH 4/7] vhost: add apis for datapath configuration Zhihong Wang
2018-02-02 23:28 ` [dpdk-dev] [PATCH 5/7] vhost: adapt vhost lib for selective datapath Zhihong Wang
2018-02-02 23:28 ` [dpdk-dev] [PATCH 6/7] vhost: get callfd before device setup Zhihong Wang
2018-02-02 23:28 ` [dpdk-dev] [PATCH 7/7] vhost: export new apis Zhihong Wang
2018-03-05 9:20 ` [dpdk-dev] [PATCH v2 0/6] vhost: support selective datapath Zhihong Wang
2018-03-05 9:20 ` [dpdk-dev] [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 [this message]
2018-03-15 10:58 ` Wang, Zhihong
2018-03-05 9:20 ` [dpdk-dev] [PATCH v2 2/6] vhost: support selective datapath Zhihong Wang
2018-03-05 9:20 ` [dpdk-dev] [PATCH v2 3/6] vhost: add apis for datapath configuration Zhihong Wang
2018-03-05 9:20 ` [dpdk-dev] [PATCH v2 5/6] vhost: add apis for live migration Zhihong Wang
2018-03-05 9:20 ` [dpdk-dev] [PATCH v2 4/6] vhost: adapt vhost lib for selective datapath Zhihong Wang
2018-03-05 9:20 ` [dpdk-dev] [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-03-19 10:12 ` [dpdk-dev] [PATCH v3 0/5] vhost: support selective datapath Zhihong Wang
2018-03-19 10:12 ` [dpdk-dev] [PATCH v3 1/5] vhost: export vhost feature definitions Zhihong Wang
2018-03-19 10:12 ` [dpdk-dev] [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-03-19 10:12 ` [dpdk-dev] [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-03-19 10:12 ` [dpdk-dev] [PATCH v3 4/5] vhost: adapt vhost lib for selective datapath Zhihong Wang
2018-03-19 10:13 ` [dpdk-dev] [PATCH v3 5/5] vhost: add apis for live migration Zhihong Wang
2018-03-29 12:15 ` [dpdk-dev] [PATCH v3 0/5] vhost: support selective datapath Wodkowski, PawelX
2018-03-30 9:35 ` Wang, Zhihong
2018-03-30 10:00 ` [dpdk-dev] [PATCH v4 " Zhihong Wang
2018-03-30 10:00 ` [dpdk-dev] [PATCH v4 1/5] vhost: export vhost feature definitions Zhihong Wang
2018-03-31 5:56 ` Maxime Coquelin
2018-03-30 10:01 ` [dpdk-dev] [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-30 10:01 ` [dpdk-dev] [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-30 10:01 ` [dpdk-dev] [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-30 10:01 ` [dpdk-dev] [PATCH v4 5/5] vhost: add apis for live migration Zhihong Wang
2018-03-31 7:39 ` Maxime Coquelin
2018-04-02 11:46 ` [dpdk-dev] [PATCH v5 0/5] vhost: support selective datapath Zhihong Wang
2018-04-02 11:46 ` [dpdk-dev] [PATCH v5 1/5] vhost: export vhost feature definitions Zhihong Wang
2018-04-02 11:46 ` [dpdk-dev] [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 ` [dpdk-dev] [PATCH v5 3/5] vhost: add apis for datapath configuration Zhihong Wang
2018-04-03 8:07 ` Maxime Coquelin
2018-04-02 11:46 ` [dpdk-dev] [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 ` [dpdk-dev] [PATCH v5 5/5] vhost: add apis for live migration Zhihong Wang
2018-04-03 8:27 ` [dpdk-dev] [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=fedfb5d6-fdd9-72ba-54bf-68783114a006@redhat.com \
--to=maxime.coquelin@redhat.com \
--cc=cunming.liang@intel.com \
--cc=dan.daly@intel.com \
--cc=dev@dpdk.org \
--cc=jianfeng.tan@intel.com \
--cc=tiwei.bie@intel.com \
--cc=xiao.w.wang@intel.com \
--cc=yliu@fridaylinux.org \
--cc=zhihong.wang@intel.com \
/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).