From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 35240A04DD for ; Thu, 22 Oct 2020 10:12:49 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BFE94A901; Thu, 22 Oct 2020 10:12:47 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by dpdk.org (Postfix) with ESMTP id 45F35A901 for ; Thu, 22 Oct 2020 10:12:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603354364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=X6hFZ/MSNrV4fLxYxjwGzTN3EwD414p7zIxbeYeI1Zc=; b=IuOV0ApZOEq6Zf6svnKyvbzLkRGPvrJayO+zIaKA2fuYgEz1xKibNv5IoPdz8lAEINgXwp DscuTVx9g26rw9d92FFgaUyN/P70Sh25WVICRmP60Gb3DjfnqmxjCbkUMqd0A0KBPj8Um+ SxK3F56AH9LkmFjVttc8R3TYx/D8770= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-80-Mk0n4vc1OcCNP8o3HQfBhw-1; Thu, 22 Oct 2020 04:12:36 -0400 X-MC-Unique: Mk0n4vc1OcCNP8o3HQfBhw-1 Received: by mail-wm1-f71.google.com with SMTP id o15so317129wmh.1 for ; Thu, 22 Oct 2020 01:12:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=X6hFZ/MSNrV4fLxYxjwGzTN3EwD414p7zIxbeYeI1Zc=; b=SsjfACcvuvMCPASLwbTsJbNS9mLoaXkyFDMgsdt3crFmU4wiQbtpRrqpIt8jLoJJYT mgay9DtDGYtkhCJ+MT4kHsCWMM9+01OVmFgk8AliSfslWRj/XAYnk8wsuO+NnfRTaghe PBQ1rVRR2XzvOziDXY5eYOlY0CfO57mD+BCdXotbdW1e6mCb/9uRJbfakTuD9cXLFdnc 9Ezfv3jLgz1Iv1TrNrI8nZNeC5d+8yFVoYXfDzNMLIRIIg0ulfsIcwh3hm7uA1acbzwb bn2JguY8vGqq8fucrHfNWp0JTa05lEokTZsSDz/d6g2E51mjRQDTRf73sl97qIgWvB5x I9TQ== X-Gm-Message-State: AOAM530fLVOfJekJBaADTWcyujB5MC96q8Eg2P6rh2NVNr/c5FxH9hfh br8P8MljlEIhzXWXOQsaKmDtzJUyTD7oR6wPmjkl9ly4vWFCjWQ87D4NKRE4hIZXQK28WhviAlV 2/AsXEAs= X-Received: by 2002:a5d:6247:: with SMTP id m7mr1383025wrv.34.1603354355707; Thu, 22 Oct 2020 01:12:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxU9ECjHyobzsJLPT+ufSYnLJhb75AHGQUUwh3XP1oAlhATsZWrVbVydZmmkZcLLFN0f67u+g== X-Received: by 2002:a5d:6247:: with SMTP id m7mr1382999wrv.34.1603354355452; Thu, 22 Oct 2020 01:12:35 -0700 (PDT) Received: from amorenoz.users.ipa.redhat.com ([94.73.56.18]) by smtp.gmail.com with ESMTPSA id d129sm1576322wmf.19.2020.10.22.01.12.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Oct 2020 01:12:34 -0700 (PDT) To: "Xia, Chenbo" , Maxime Coquelin , "Wang, Yinan" , "dev@dpdk.org" Cc: "Fu, Patrick" , "stable@dpdk.org" , "Wang, Zhihong" , "Xu, Qian Q" References: <20201020152052.389446-1-amorenoz@redhat.com> <20201020152052.389446-4-amorenoz@redhat.com> <282c116e-0f8a-754e-f3fd-8eb256d68246@redhat.com> <59a07add-84e4-b111-4fc0-f8a491fe86b0@redhat.com> From: Adrian Moreno Message-ID: <70fe89be-ca87-6af7-9f4f-b7c377d4b41c@redhat.com> Date: Thu, 22 Oct 2020 10:12:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=amorenoz@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-stable] [PATCH v2 3/3] virtio-user: set status on virtio-user reconnect X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On 10/22/20 9:37 AM, Xia, Chenbo wrote: > Hi Maxime, > >> -----Original Message----- >> From: Maxime Coquelin >> Sent: Thursday, October 22, 2020 3:14 PM >> To: Wang, Yinan ; Adrian Moreno >> ; dev@dpdk.org; Xia, Chenbo >> Cc: Fu, Patrick ; stable@dpdk.org; Wang, Zhihong >> ; Xu, Qian Q >> 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 >>>> Sent: 2020年10月21日 0:43 >>>> To: Adrian Moreno ; dev@dpdk.org >>>> Cc: Wang, Yinan ; Fu, Patrick >> ; >>>> stable@dpdk.org; Xia, Chenbo ; Wang, Zhihong >>>> >>>> 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 >>>>> --- >>>>> 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 >>>> >>>> Thanks, >>>> Maxime >>> > -- Adrián Moreno