From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45169C11F66 for ; Tue, 29 Jun 2021 03:29:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2108E61D22 for ; Tue, 29 Jun 2021 03:29:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231946AbhF2DcK (ORCPT ); Mon, 28 Jun 2021 23:32:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:40274 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231817AbhF2DcH (ORCPT ); Mon, 28 Jun 2021 23:32:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624937381; 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=2Pa1pOlVAvZjnb70QATIYkocaWNNRWiFDRdCDmMIsd8=; b=gDqfj9rX8rqZCojYY0oHCfBhS/e0zviI0vG5ixXtKXz9pa09e3jgiY93XCagKHEM9BwBvh LbJ+bSCFYjIsDMqIBjGafHHTTklf+NHwX4DKd4K9pdoePlVZeEqSngYs31FekOusBPMmV+ rYqOLxQs0cHhMLR5XvXT3HssUYfLrmY= Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-118-Iq61iBEONfumKUnGCdtwLg-1; Mon, 28 Jun 2021 23:29:39 -0400 X-MC-Unique: Iq61iBEONfumKUnGCdtwLg-1 Received: by mail-pf1-f200.google.com with SMTP id h6-20020a056a001a46b029030cacfca7bdso2634286pfv.13 for ; Mon, 28 Jun 2021 20:29:39 -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-transfer-encoding :content-language; bh=2Pa1pOlVAvZjnb70QATIYkocaWNNRWiFDRdCDmMIsd8=; b=DK9TNOuzVQ5NzcRaKPYK20rgg0VilzI97BUw+Q2MxTOpdx3hIETU1wk8cQ29PRM+WZ txKpLJDp+KT+SFSIkrz0pT0FURvE8D1Olf2kaVBspDm0WvlScRzfR3S7XxHEObuQN+CR l8CwqAI3LnVvhF9SKcBa5QJRyii4BouTRxG9PxXrX8TQwhsVyOXB4j6GCZL5baIEpZmH aSNZtreq1ob4swvcJorXPeDPKynwUPFaaLKLExcMPedrKQPVSMP9gv8ipYxFLRGXIkwa 09YuMhuDWIp3UKatzIm0bKN/7VStJYF4jibpBpcmHinLkwnYKE4Gz/aoyEVCfnfQLywV xlsA== X-Gm-Message-State: AOAM533pRTiFBQ7KhgSQJ41q/dhibEYMfYGarXrdNbxFB1OKSEiKQPF/ ND9vAEfOae5ZEHrMlXnmUWhRO19njJTMKDUl8LSN0j7lkYRjcW0SxTIvFTs59NqO10qmceEYysE wXl69KNhuNoT6GjUw X-Received: by 2002:a05:6a00:1742:b029:308:add4:e844 with SMTP id j2-20020a056a001742b0290308add4e844mr24162932pfc.18.1624937378555; Mon, 28 Jun 2021 20:29:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwry9N+QCFjvNGydIUFQnfZliYwOwU3q6M/FQals9i/JHLqA6RP5KnmC4UjhvxUQDox0iXaLQ== X-Received: by 2002:a05:6a00:1742:b029:308:add4:e844 with SMTP id j2-20020a056a001742b0290308add4e844mr24162907pfc.18.1624937378357; Mon, 28 Jun 2021 20:29:38 -0700 (PDT) Received: from wangxiaodeMacBook-Air.local ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id w21sm1920153pge.30.2021.06.28.20.29.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Jun 2021 20:29:37 -0700 (PDT) Subject: Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace To: Yongji Xie Cc: "Michael S. Tsirkin" , Stefan Hajnoczi , Stefano Garzarella , Parav Pandit , Christoph Hellwig , Christian Brauner , Randy Dunlap , Matthew Wilcox , Al Viro , Jens Axboe , bcrl@kvack.org, Jonathan Corbet , =?UTF-8?Q?Mika_Penttil=c3=a4?= , Dan Carpenter , joro@8bytes.org, Greg KH , songmuchun@bytedance.com, virtualization , netdev@vger.kernel.org, kvm , linux-fsdevel@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel References: <20210615141331.407-1-xieyongji@bytedance.com> <1bba439f-ffc8-c20e-e8a4-ac73e890c592@redhat.com> <0aeb7cb7-58e5-1a95-d830-68edd7e8ec2e@redhat.com> <48cab125-093b-2299-ff9c-3de8c7c5ed3d@redhat.com> From: Jason Wang Message-ID: Date: Tue, 29 Jun 2021 11:29:25 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 在 2021/6/29 上午10:26, Yongji Xie 写道: > On Mon, Jun 28, 2021 at 12:40 PM Jason Wang wrote: >> >> 在 2021/6/25 下午12:19, Yongji Xie 写道: >>>> 2b) for set_status(): simply relay the message to userspace, reply is no >>>> needed. Userspace will use a command to update the status when the >>>> datapath is stop. The the status could be fetched via get_stats(). >>>> >>>> 2b looks more spec complaint. >>>> >>> Looks good to me. And I think we can use the reply of the message to >>> update the status instead of introducing a new command. >>> >> Just notice this part in virtio_finalize_features(): >> >> virtio_add_status(dev, VIRTIO_CONFIG_S_FEATURES_OK); >> status = dev->config->get_status(dev); >> if (!(status & VIRTIO_CONFIG_S_FEATURES_OK)) { >> >> So we no reply doesn't work for FEATURES_OK. >> >> So my understanding is: >> >> 1) We must not use noreply for set_status() >> 2) We can use noreply for get_status(), but it requires a new ioctl to >> update the status. >> >> So it looks to me we need synchronize for both get_status() and >> set_status(). >> > We should not send messages to userspace in the FEATURES_OK case. So > the synchronization is not necessary. As discussed previously, there could be a device that mandates some features (VIRTIO_F_RING_PACKED). So it can choose to not accept FEATURES_OK is packed virtqueue is not negotiated. In this case we need to relay the message to userspace. Thanks > > Thanks, > Yongji >