Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4047283pxv; Mon, 28 Jun 2021 20:31:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwATV6EI7sOLppNazi1jsZ61rS59+tAq7guhsvWA74G0E5JJlAlmteoK14SY4rW9YT6Com4 X-Received: by 2002:a6b:7905:: with SMTP id i5mr2177452iop.175.1624937491561; Mon, 28 Jun 2021 20:31:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624937491; cv=none; d=google.com; s=arc-20160816; b=p/pE88xJGCr8r+KZQ8GDIaVwxElkuIbTWnbrTJ2rIa+MWKH7CzGD2yKQhAAMESZHxZ Do5O09puxJhcIUb4iLnZOE7zP7RiYz5zmYYeA6XGt39dzio7uwTash5vWKZq8g8q5MuJ fV8SKEMps86GK6atqOAdB1Ouy+HdfqhZ+z7yZxhKIDRf6sT7bCd318+sP11D5Z/Ivnyh 62FMzBVcqm9ZEhDUzocNdL467di+myJ7KWtoPlDowlabWS78ra6v2KzcOl6/jLafDn1l F5yTAGNDKZ3fck/FKrtCjlzZJ1o9hjviygbKlXhMqHEFnTRVjB2w7vOX/u3MmLbtvqET 0RVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=2Pa1pOlVAvZjnb70QATIYkocaWNNRWiFDRdCDmMIsd8=; b=fLsKFB0/QJu+4WSVxz+diToTzD4WC9RsSlGZkKxLNq0ZwBQ05UuRezZI5PcJ8G241N A6Pbk6jLXu2qVYRMihKgf9V+lLmfAvQTid4Qsy72xviJDWl6d1hNKt7L52NdIemQWzzm 6H+beCmuTSw3ERMiZV8ukW714ru3v+Tu4CVtmKUTITioXgeeFXUeigh7hvORPL7cfZMv Nhmdx+fp22TLGVJ9VVNa89OV4TANKMmenzU8pnSs8ezOgeRRqx0GTVAnq1ZvBLZ6GXzy LWz2z7h3iR2X/b7HI0mPDsC+ad563QDgDLmLYFuVWyjEWEffEe5dAy7/7EiLoKgy/Y14 sssA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gDqfj9rX; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w14si22855ilm.64.2021.06.28.20.31.19; Mon, 28 Jun 2021 20:31:31 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gDqfj9rX; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231799AbhF2DcJ (ORCPT + 99 others); Mon, 28 Jun 2021 23:32:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:49340 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231856AbhF2DcI (ORCPT ); Mon, 28 Jun 2021 23:32:08 -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-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-242-YHaZ-TnkOcmJozMFdTBo3A-1; Mon, 28 Jun 2021 23:29:39 -0400 X-MC-Unique: YHaZ-TnkOcmJozMFdTBo3A-1 Received: by mail-pj1-f71.google.com with SMTP id cp14-20020a17090afb8eb029017094b4d856so1311773pjb.7 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=IFh2KN07jA/Nn+39Ua6q8PbevPBvo/QSLPo1XRWcTy9GP1D/uqZAi9pVEYXQDJauRt uZ+cceJM5Kvyy/js0pAlj2JAyinOnErbVF4x+qy+8vviVs487A2DXIuJIzanYcwUpMNJ yo7IiFoq0WiUtozU5J93/OVuft48uBaVqjXBr6VUAD6RhlQjFVU7yHf1qrP0NfVXakcC 3RD4EFax6/dOZ3vNoV7qdojN/zL8HJXlHfEq+b1J+Gd+d6sX2YkI8kL3OXNDSBhBj2kS gqgguxwFa63R3fZAuleiONEY7PUh1AKZgMfEqFysDMbtlya5fqSzsR9IB4NQCQci/NJ5 L5nA== X-Gm-Message-State: AOAM532GDFFegMt7ta+O5T4URq561pS8ir1votrdCgmxIgK9QLQtqtnO Dd6+UzMnQS0lW7vFMa/BXYML/lK64bP7cE9DCsNZXXpLMY3aQh6fbdQKG9aJ4dLCFzr6AIfERSf aQuepT0ZIs3c3GdjDiXUcaVUNL6lXQhejmfXLtI1jkGroUEDfcXJJkoJJJURbwptz4PtFpbrETd RD X-Received: by 2002:a05:6a00:1742:b029:308:add4:e844 with SMTP id j2-20020a056a001742b0290308add4e844mr24162945pfc.18.1624937378638; Mon, 28 Jun 2021 20:29:38 -0700 (PDT) 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: linux-kernel@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 >