Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5065296pxv; Tue, 20 Jul 2021 18:31:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoUR/Io6G9xaWhRYZJjS60SklnehOkmVq54KfWBTGFL4FE4aNqc32WogYnKf8ZfN3Woo8h X-Received: by 2002:a92:d152:: with SMTP id t18mr21799658ilg.34.1626831095588; Tue, 20 Jul 2021 18:31:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626831095; cv=none; d=google.com; s=arc-20160816; b=1CqZLC6JLRKU1zxJDk5GeUieol1QQvpd/OwHgU3keKFucFqEyZjcE9GzAaLQ7Gdeuf oeDrcAgs1M4x7RQk3eWZ4AnaitT/ibLggukiSjW0q7nW4fIl7fdelYicAlfbWcPWhuf2 /KMSmCnZW8y1Nw1FhCzja09nNt0a9/gaUtMNooSugEKbqnzV/5uqe4x5pMGyEruZYgJ3 z6TXDs2CFmHAF5txoKzMRGFrjmyOQn9CUgHXM7MPcDaJyQ9gqr6RNac8u5/EKdsTYtKQ DEFZQ7WKnv3og2K/hk2dSf1GYdaYZ5tmLuBU3NGd+SxqHxXt3KaPSv+JMpm7Db5KNWOi XEXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=Egx4SRLtwsV3EQkhTzFl92az3tA+ZthD/Yii/zggMgY=; b=Vd6jvcaQ3ScEGRHRcyKsPvbQwmGM6VDPEDtnN2z/ppIfOL8QBwa8Dr3uH8MiW+PxoT qoWlgfhk/JuX1Ffj6cJ1mh4MkWMWrAebappRpaUcaKzIPeYIM1wNWfW54MmwlLg45TJ4 /Tk/FJ+EBiMikAUe50ETSZzZ2ZAqfPSFgpRubE5eeos4rV6fakTmFKycIkT50ZMq/z6Q 3BsQgAuTM+hVNkcv93BAnvJ/ChlkgnZvaFxUQyf8y9WQJEoHXhA2AzpKIyD4Vlw/uVOk aMFIW9lx8qyCC7ilUihErUdK9eaO20NnCAfd6kO7ikXk7QqSswdY6lQ19Mct8bXQ3k7V 8y6w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w3si17159250iol.91.2021.07.20.18.31.24; Tue, 20 Jul 2021 18:31:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229912AbhGUAuB (ORCPT + 99 others); Tue, 20 Jul 2021 20:50:01 -0400 Received: from out30-54.freemail.mail.aliyun.com ([115.124.30.54]:40950 "EHLO out30-54.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229668AbhGUAt6 (ORCPT ); Tue, 20 Jul 2021 20:49:58 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R421e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04395;MF=xianting.tian@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0UgSrlgR_1626831028; Received: from B-LB6YLVDL-0141.local(mailfrom:xianting.tian@linux.alibaba.com fp:SMTPD_---0UgSrlgR_1626831028) by smtp.aliyun-inc.com(127.0.0.1); Wed, 21 Jul 2021 09:30:33 +0800 Subject: Re: [PATCH v2] vsock/virtio: set vsock frontend ready in virtio_vsock_probe() To: Stefan Hajnoczi Cc: sgarzare@redhat.com, davem@davemloft.net, kuba@kernel.org, jasowang@redhat.com, kvm@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210720071337.1995-1-xianting.tian@linux.alibaba.com> From: Xianting Tian Message-ID: Date: Wed, 21 Jul 2021 09:30:28 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Got it. thanks for the comments, 在 2021/7/20 下午9:12, Stefan Hajnoczi 写道: > On Tue, Jul 20, 2021 at 07:05:39PM +0800, Xianting Tian wrote: >> 在 2021/7/20 下午6:23, Stefan Hajnoczi 写道: >>> On Tue, Jul 20, 2021 at 03:13:37PM +0800, Xianting Tian wrote: >>>> Add the missed virtio_device_ready() to set vsock frontend ready. >>>> >>>> Signed-off-by: Xianting Tian >>>> --- >>>> net/vmw_vsock/virtio_transport.c | 2 ++ >>>> 1 file changed, 2 insertions(+) >>> Please include a changelog when you send v2, v3, etc patches. >> OK, thanks. >>>> diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c >>>> index e0c2c992a..dc834b8fd 100644 >>>> --- a/net/vmw_vsock/virtio_transport.c >>>> +++ b/net/vmw_vsock/virtio_transport.c >>>> @@ -639,6 +639,8 @@ static int virtio_vsock_probe(struct virtio_device *vdev) >>>> mutex_unlock(&the_virtio_vsock_mutex); >>>> + virtio_device_ready(vdev); >>> Why is this patch necessary? >> Sorry, I didn't notice the check in virtio_dev_probe(), >> >> As Jason comment,  I alsoe think we need to be consistent: switch to use >> virtio_device_ready() for all the drivers. What's opinion about this? > According to the documentation the virtio_device_read() API is optional: > > /** > * virtio_device_ready - enable vq use in probe function > * @vdev: the device > * > * Driver must call this to use vqs in the probe function. > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > * > * Note: vqs are enabled automatically after probe returns. > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > */ > > Many drivers do not use vqs during the ->probe() function. They don't > need to call virtio_device_ready(). That's why the virtio_vsock driver > doesn't call it. > > But if a ->probe() function needs to send virtqueue buffers, e.g. to > query the device or activate some device feature, then the driver will > need to call it explicitly. > > The documentation is clear and this design is less error-prone than > relying on all drivers to call it manually. I suggest leaving things > unchanged. > > Stefan