From: "Tan, Jianfeng" <jianfeng.tan@intel.com>
To: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Cc: dev@dpdk.org, zhihong.wang@intel.com, lining18@jd.com
Subject: Re: [dpdk-dev] [PATCH 2/3] net/virtio_user: fix wrong sequence of messages
Date: Fri, 9 Sep 2016 13:50:16 +0800 [thread overview]
Message-ID: <1537a739-9805-cd51-cf0a-f32d608a97e0@intel.com> (raw)
In-Reply-To: <20160909041949.GP23158@yliu-dev.sh.intel.com>
On 9/9/2016 12:19 PM, Yuanhan Liu wrote:
>>
>>
>> Never mind, above fix on the vhost side will not take effect on existing
>> vpp-vhost implementations.
>>
>> Actually, I was talking about the DPDK vhost implementation :)
>>
>>
>> This patch is talking about vpp's native vhost implementation, not dpdk-vhost,
>> and not the way vpp uses dpdk-vhost.
> Yes, I know. What I meant is there was a "workaround" in DPDK vhost
> implementation, and since you bring this issue on the table again,
> it's a chance to think about how can we fix it.
>
> A rough idea come to my mind is we could check all the per-vring message
> at the begining of vhost_user_msg_handler() and allocate related vq when
> necessary (when it's the first vring message we got).
>
> Yeah, I know it's a bit ugly, but it at least gets rid of that "not-that-true"
> assumption.
Sounds workable. So we'd define those vq-specific msgs, like:
VHOST_USER_SET_VRING_NUM,
VHOST_USER_SET_VRING_ADDR,
VHOST_USER_SET_VRING_BASE,
VHOST_USER_GET_VRING_BASE(?),
VHOST_USER_SET_VRING_KICK,
VHOST_USER_SET_VRING_CALL,
VHOST_USER_SET_VRING_ENABLE,
>
>> Still not working. VPP needs SET_VRING_CALL to create vq firstly.
>>
>> Didn't get it. In the proposal, SET_FEATURES is sent before every other
>> messages, thus it should not cause the issue you described in this patch.
>>
>>
>> OK. Let me try to explain. We take three vhost implementations into
>> consideration: dpdk-2.2-vhost, dpdk-master-vhost, vpp-native-vhost.
>>
>> If set_feature before set_vring_call, dpdk-2.2-vhost will fail: inside
>> set_feature handler, assigning header length to VQs which will be created in
>> set_vring_call handler.
> Oh, right. That was an in-correct implementation.
>
>> So we need to keep set_vring_call firstly.
>> Then set_feature needs to be sent
>> before any other msgs, this is what vpp-native-vhost requires. In all, the
>> sequence is like this:
>> 1. set_vring_call,
>> 2. set_feature,
>> 3. other msgs
>>
>>
>> Besides, haven't we already sent SET_VRING_CALL before other messages
>> (well, execept the SET_FEATURES and SET_MEM_TABLE message)?
>>
>>
>> Yes, set_vring_call is already in the first place, but we need to plugin
>> set_feature between set_vring_call and other msgs. Previously, set_vring_call
>> and other msgs are together.
> Okay. Another thing I noticed is that virtio-user lacks some feature
> negotiations, like GET_FEATURES and GET_PROTOCOL_FEATURES. I think you
> might need add them back somewhen?
GET_FEATURES has been done in virtio_user_dev_init().
GET_PROTOCOL_FEATURES is not supported yet. I see those features in
PROTOCOL_FEATURES is for live migration (right?). Assuming that, anyone
using container/process now enables live migration so far? I don't think so.
Thanks,
Jianfeng
>
> --yliu
next prev parent reply other threads:[~2016-09-09 5:50 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-05 11:36 [dpdk-dev] [PATCH 0/3] fix virtio_user issues Jianfeng Tan
2016-08-05 11:36 ` [dpdk-dev] [PATCH 1/3] net/virtio_user: fix queue pair not enabled Jianfeng Tan
2016-09-06 6:30 ` Yuanhan Liu
2016-08-05 11:36 ` [dpdk-dev] [PATCH 2/3] net/virtio_user: fix wrong sequence of messages Jianfeng Tan
2016-08-05 16:36 ` Stephen Hemminger
2016-08-08 1:19 ` Tan, Jianfeng
2016-09-06 6:42 ` Yuanhan Liu
2016-09-06 7:54 ` Tan, Jianfeng
2016-09-06 8:20 ` Yuanhan Liu
2016-09-08 8:53 ` Tan, Jianfeng
2016-09-08 12:18 ` Yuanhan Liu
2016-09-09 3:59 ` Tan, Jianfeng
2016-09-09 4:19 ` Yuanhan Liu
2016-09-09 5:50 ` Tan, Jianfeng [this message]
2016-09-09 6:03 ` Yuanhan Liu
2016-09-09 6:24 ` Tan, Jianfeng
2016-09-09 6:31 ` Yuanhan Liu
2016-08-05 11:36 ` [dpdk-dev] [PATCH 3/3] net/virtio_user: fix dev not freed after init error Jianfeng Tan
2016-08-05 16:34 ` Stephen Hemminger
2016-08-08 1:07 ` Tan, Jianfeng
2016-08-29 7:01 ` [dpdk-dev] [PATCH 0/3] fix virtio_user issues Christian Ehrhardt
2016-09-27 19:11 ` [dpdk-dev] [PATCH v2 " Jianfeng Tan
2016-09-27 19:11 ` [dpdk-dev] [PATCH v2 1/3] net/virtio_user: fix queue pair not enabled Jianfeng Tan
2016-09-28 0:05 ` Yuanhan Liu
2016-09-27 19:11 ` [dpdk-dev] [PATCH v2 2/3] net/virtio_user: fix wrong sequence of messages Jianfeng Tan
2016-09-27 19:11 ` [dpdk-dev] [PATCH v2 3/3] net/virtio_user: fix dev not freed after init error Jianfeng Tan
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=1537a739-9805-cd51-cf0a-f32d608a97e0@intel.com \
--to=jianfeng.tan@intel.com \
--cc=dev@dpdk.org \
--cc=lining18@jd.com \
--cc=yuanhan.liu@linux.intel.com \
--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).