From: Adrian Moreno <amorenoz@redhat.com>
To: "Xia, Chenbo" <chenbo.xia@intel.com>,
Maxime Coquelin <maxime.coquelin@redhat.com>,
"Wang, Yinan" <yinan.wang@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>
Cc: "Fu, Patrick" <patrick.fu@intel.com>,
"stable@dpdk.org" <stable@dpdk.org>,
"Wang, Zhihong" <zhihong.wang@intel.com>,
"Xu, Qian Q" <qian.q.xu@intel.com>
Subject: Re: [dpdk-dev] [PATCH v2 3/3] virtio-user: set status on virtio-user reconnect
Date: Thu, 22 Oct 2020 10:12:33 +0200 [thread overview]
Message-ID: <70fe89be-ca87-6af7-9f4f-b7c377d4b41c@redhat.com> (raw)
In-Reply-To: <MN2PR11MB4063448B032E6359925BB0F09C1D0@MN2PR11MB4063.namprd11.prod.outlook.com>
On 10/22/20 9:37 AM, Xia, Chenbo wrote:
> Hi Maxime,
>
>> -----Original Message-----
>> From: Maxime Coquelin <maxime.coquelin@redhat.com>
>> Sent: Thursday, October 22, 2020 3:14 PM
>> To: Wang, Yinan <yinan.wang@intel.com>; Adrian Moreno
>> <amorenoz@redhat.com>; dev@dpdk.org; Xia, Chenbo <chenbo.xia@intel.com>
>> Cc: Fu, Patrick <patrick.fu@intel.com>; stable@dpdk.org; Wang, Zhihong
>> <zhihong.wang@intel.com>; Xu, Qian Q <qian.q.xu@intel.com>
>> Subject: Re: [PATCH v2 3/3] virtio-user: set status on virtio-user
>> reconnect
>>
>> Hi Yinan,
>>
>> On 10/22/20 6:01 AM, Wang, Yinan wrote:
>>> Hi Maxime/ Adrian,
>>>
>>> Thanks for the patch. we can launch vhost-user with client mode with
>> this fix patch.
>>> But still fail to get throughput with basic vhost/virtio-user server
>> mode loopback test. This is another problem which introduced by
>> 57912824615fd7787a48a7b18e40661466.
>>> Bugzilla: https://bugs.dpdk.org/show_bug.cgi?id=541
>>
>> Thanks for reporting the issue, I will look at it this morning.
>>
>> BTW, this virtio-user server mode is broken by design, we should really
>> fix it.
>>
>> For example, it assumes features to be supported by the backend before
>> the negotiation took place:
>> https://git.dpdk.org/dpdk/tree/drivers/net/virtio/virtio_user/virtio_user_
>> dev.c#n513
>>
>> As part of my rework, I suggest we implement the same behaviour as QEMU
>> does, which will be reliable and consistent with QEMU. It means that if
>> server mode is enabled in device command-line, the driver waits until
>> the socket is ready.
>>
>> Chenbo, Adrian, what do you think?
>
> Yes! I totally agree and have the same opinion for a long time. As I remember, this
> feature assumption has caused problems before and I notice the new STATUS feature is
> also affected. It's good to make this consistent with QEMU 😊.
>
+1
In fact, I was looking into how to get rid of some error messages originated
during the initialization of the virtio-pci layer when the socket is still not
ready.
> Cheers,
> Chenbo
>
>>
>> Thanks,
>> Maxime
>>
>>> BR,
>>> Yinan
>>>> -----Original Message-----
>>>> From: Maxime Coquelin <maxime.coquelin@redhat.com>
>>>> Sent: 2020年10月21日 0:43
>>>> To: Adrian Moreno <amorenoz@redhat.com>; dev@dpdk.org
>>>> Cc: Wang, Yinan <yinan.wang@intel.com>; Fu, Patrick
>> <patrick.fu@intel.com>;
>>>> stable@dpdk.org; Xia, Chenbo <chenbo.xia@intel.com>; Wang, Zhihong
>>>> <zhihong.wang@intel.com>
>>>> Subject: Re: [PATCH v2 3/3] virtio-user: set status on virtio-user
>> reconnect
>>>>
>>>>
>>>>
>>>> On 10/20/20 5:20 PM, Adrian Moreno wrote:
>>>>> Newer vhost-user backends will rely on SET_STATUS to start the device
>>>>> so this required to support them.
>>>>>
>>>>> Fixes: 57912824615f ("net/virtio-user: support vhost status setting")
>>>>> Cc: maxime.coquelin@redhat.com
>>>>> Cc: stable@dpdk.org
>>>>>
>>>>> Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
>>>>> ---
>>>>> drivers/net/virtio/virtio_user_ethdev.c | 14 ++++++++++++--
>>>>> 1 file changed, 12 insertions(+), 2 deletions(-)
>>>>>
>>>>> diff --git a/drivers/net/virtio/virtio_user_ethdev.c
>>>> b/drivers/net/virtio/virtio_user_ethdev.c
>>>>> index e870fb2ff..d8bea4537 100644
>>>>> --- a/drivers/net/virtio/virtio_user_ethdev.c
>>>>> +++ b/drivers/net/virtio/virtio_user_ethdev.c
>>>>> @@ -78,6 +78,13 @@ virtio_user_server_reconnect(struct virtio_user_dev
>>>> *dev)
>>>>> return -1;
>>>>>
>>>>> dev->vhostfd = connectfd;
>>>>> +
>>>>> + vtpci_reset(hw);
>>>>> +
>>>>> + vtpci_set_status(hw, VIRTIO_CONFIG_STATUS_ACK);
>>>>> +
>>>>> + vtpci_set_status(hw, VIRTIO_CONFIG_STATUS_DRIVER);
>>>>> +
>>>>> if (dev->ops->send_request(dev, VHOST_USER_GET_FEATURES,
>>>>> &dev->device_features) < 0) {
>>>>> PMD_INIT_LOG(ERR, "get_features failed: %s",
>>>>> @@ -111,6 +118,8 @@ virtio_user_server_reconnect(struct
>> virtio_user_dev
>>>> *dev)
>>>>>
>>>>> dev->features &= dev->device_features;
>>>>>
>>>>> + vtpci_set_status(hw, VIRTIO_CONFIG_STATUS_FEATURES_OK);
>>>>> +
>>>>> /* For packed ring, resetting queues is required in reconnection. */
>>>>> if (vtpci_packed_queue(hw) &&
>>>>> (vtpci_get_status(hw) & VIRTIO_CONFIG_STATUS_DRIVER_OK)) {
>>>>> @@ -119,8 +128,9 @@ virtio_user_server_reconnect(struct
>> virtio_user_dev
>>>> *dev)
>>>>> virtio_user_reset_queues_packed(eth_dev);
>>>>> }
>>>>>
>>>>> - ret = virtio_user_start_device(dev);
>>>>> - if (ret < 0)
>>>>> + /* Start the device */
>>>>> + vtpci_set_status(hw, VIRTIO_CONFIG_STATUS_DRIVER_OK);
>>>>> + if (!dev->started)
>>>>> return -1;
>>>>>
>>>>> if (dev->queue_pairs > 1) {
>>>>>
>>>>
>>>> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>>>>
>>>> Thanks,
>>>> Maxime
>>>
>
--
Adrián Moreno
next prev parent reply other threads:[~2020-10-22 8:12 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-20 15:20 [dpdk-dev] [PATCH v2 0/3] virtio-user: fix virtio-user server mode Adrian Moreno
2020-10-20 15:20 ` [dpdk-dev] [PATCH v2 1/3] virtio-user: fix backend selection if stat fails Adrian Moreno
2020-10-20 15:26 ` Maxime Coquelin
2020-10-20 16:52 ` Kevin Traynor
2020-10-20 15:20 ` [dpdk-dev] [PATCH v2 2/3] virtio_user: don't set/get_status until FEATURES_OK Adrian Moreno
2020-10-20 16:17 ` Maxime Coquelin
2020-10-20 15:20 ` [dpdk-dev] [PATCH v2 3/3] virtio-user: set status on virtio-user reconnect Adrian Moreno
2020-10-20 16:42 ` Maxime Coquelin
2020-10-22 4:01 ` Wang, Yinan
2020-10-22 7:13 ` Maxime Coquelin
2020-10-22 7:37 ` Xia, Chenbo
2020-10-22 8:12 ` Adrian Moreno [this message]
2020-10-22 8:32 ` Maxime Coquelin
2020-10-23 5:21 ` Jiang, YuX
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=70fe89be-ca87-6af7-9f4f-b7c377d4b41c@redhat.com \
--to=amorenoz@redhat.com \
--cc=chenbo.xia@intel.com \
--cc=dev@dpdk.org \
--cc=maxime.coquelin@redhat.com \
--cc=patrick.fu@intel.com \
--cc=qian.q.xu@intel.com \
--cc=stable@dpdk.org \
--cc=yinan.wang@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).