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=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 4FF08C11F64 for ; Tue, 29 Jun 2021 02:26:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 31CBA6191B for ; Tue, 29 Jun 2021 02:26:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231680AbhF2C3T (ORCPT ); Mon, 28 Jun 2021 22:29:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231194AbhF2C3T (ORCPT ); Mon, 28 Jun 2021 22:29:19 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73936C061574 for ; Mon, 28 Jun 2021 19:26:52 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id hz1so33482025ejc.1 for ; Mon, 28 Jun 2021 19:26:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=436iowW5G+3AhfaQeY6hf4XjL/XjrpmKBydXgJfyA5c=; b=ZgaNzCWSgvDCp3W0+7M7fWukxNa4zA3fTXV1kaarlE9zTzD1fKf8iVqwLsF89vugIC 9dcjxKh/qW9PROxd2BblzqndRgBWoyP5PWT7Ca0ICMXU2kOiD9nPC5NZCH7Nma3nK2os 2K/GV+jZyxe0vUCCbu/qFMoo7E6Bazc+6seVNiXIzEemn9BPky8X1/7asxp/mTgIzD1W CT63JHVJQej9lyEXcyVFIWegTp3xYHaOiWsZmD4lzu37ZCa2EQox0aV1EIgVm7S2D+fg fPQiuXCDISqeRNxnowY3Ocd+N0XVi3/L5afCqOsq3fxqaVRCugUmPevg2EzrnSIm+lMT GKVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=436iowW5G+3AhfaQeY6hf4XjL/XjrpmKBydXgJfyA5c=; b=nko70AnqNQGhpKQRGiaSDX1U2LzUm5xgIs3BYIWLeqszhSSuoXZuyzH2UQCRb8C8SW ZE91IFCg5ruuGt7XHpbHf7xi+gYjiKeYU7BzoRbSQFmK29oMuVu1sp9b/Mvcu9/PlcI8 hl+7RwHWL1D8yyG+bQxKXVWNro/5qS8K4cM7Wu9jITlVFbu7f/rI2hhP8vr3JwnoZZzY Yi62+mxYUDO1h2EUhvknOQlXjaaN4jvGYWVq7g5KW1dNdfrDJAqkotm3FtKHFgr1QULD SA5Ii6KGvzoIFVZC0R/Q9JjTllkeNF2ze+6d5XZ3HG8gRGPsbZ6k2dlVgYRVFKRpWqEq SHsw== X-Gm-Message-State: AOAM533aJH6nl3ToUCzjYLO6I7uMjXZVUJPyoA6E3ZfR1fosXyS7EY5p BMnLIaLkhCw9ZhnsiAnxavZWwCdhjpuf0Mg3rhV3 X-Google-Smtp-Source: ABdhPJxZ3odiQnt9cl8KrT87lSdpmglQti+N9ZByUxEwzMT+zjXAVbmRXZy8vuZGeYWwod7YWLY2hOoSJaOTu2UwbQo= X-Received: by 2002:a17:906:a28e:: with SMTP id i14mr26931454ejz.395.1624933611032; Mon, 28 Jun 2021 19:26:51 -0700 (PDT) MIME-Version: 1.0 References: <20210615141331.407-1-xieyongji@bytedance.com> <20210615141331.407-10-xieyongji@bytedance.com> <1bba439f-ffc8-c20e-e8a4-ac73e890c592@redhat.com> <0aeb7cb7-58e5-1a95-d830-68edd7e8ec2e@redhat.com> <48cab125-093b-2299-ff9c-3de8c7c5ed3d@redhat.com> In-Reply-To: From: Yongji Xie Date: Tue, 29 Jun 2021 10:26:40 +0800 Message-ID: Subject: Re: Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace To: Jason Wang 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Mon, Jun 28, 2021 at 12:40 PM Jason Wang wrote: > > > =E5=9C=A8 2021/6/25 =E4=B8=8B=E5=8D=8812:19, Yongji Xie =E5=86=99=E9=81= =93: > >> 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 =3D 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. Thanks, Yongji