Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4015083pxv; Mon, 28 Jun 2021 19:27:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwe5ysmY+26oV8YvMd3vVv4UTOyTEfPUIkGwn6DYiowmzJhKOVPCnaPdfer2a9d0AO2NSYb X-Received: by 2002:a6b:310b:: with SMTP id j11mr1948381ioa.151.1624933656468; Mon, 28 Jun 2021 19:27:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624933656; cv=none; d=google.com; s=arc-20160816; b=vcrvQ0nwqvM7+6btd8PXvNs9/Y8ceNL2/DrIPEVchdIU0bdJ/EsAH1ROHDnoiJw7y5 /mGDnsTR6Jyg/fBK54355lVCQwx827BC/bClWon3Ls1njFacJJjDeL2ujixWjZmMcAQg Vl8tzc1B55oeacnYiJsqzVTd+TvHI/VyZY11yQp3EB3envOlV7FYhy+eclNtvA2phTqO uIXHFDrS27Fje7JFn9EFYM7iJxv5lpvcvLWNVWq6LWS6DABHmFW0ai0dn8UGniDBmbX1 PTbURFd/luZ8IIJ+HWH/hxGXy+WaUx/D54mZFdtv7eIC62xDiKezssbAiNmHOagh8v8e 7Seg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=436iowW5G+3AhfaQeY6hf4XjL/XjrpmKBydXgJfyA5c=; b=DAoRmU5xnmca8hgcdtgyyu8IV3kRq0i5Qlb/9f66oPqfh/T8n4HrjSZW4tKlQnPLdM Kz75ZP7pzmhTG9JZJs0PETGWVYVJ5UYEMUkpJ7QEUWeDIajcC43mDtlpLdjooFC7qIcx YSlOcPSXLrYYDp4VqThrP93lPuIfKIwbG91RgicpjAcaGV2zcBuk6d59gVRr5WYk1fSu J2/lVEkJ7jQEIiu+zJktx91zrLvjmYqsVwTjaYgY1twwEKZ1UEHEOjvUcIvBTWydnJ07 sob1pEeTwRmSgPmfVYq3v5HDao4xogQpYV/Sg/ppiscglYHsoiA59qtOT/EH3dfcSP8+ b+bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=ZgaNzCWS; 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=bytedance.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f13si20114943ila.126.2021.06.28.19.27.23; Mon, 28 Jun 2021 19:27:36 -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=@bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=ZgaNzCWS; 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=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231194AbhF2C3U (ORCPT + 99 others); Mon, 28 Jun 2021 22:29:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231350AbhF2C3T (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 74C04C061766 for ; Mon, 28 Jun 2021 19:26:52 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id nd37so33557494ejc.3 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=ebwRKG27bSVxv6sdlroLHwrO6JTtbVxaSgbiOoxPCkEx6FSPfsIBnZ1gN3aGRtIrjY cI9GpxPvfOFhAz9cSRhhwu4SwcG60W9nN2XmihUdFw3Y124DAt2YigelmhS8WFB6Y2Jk BO2NFNEsOfrzirQgCbuknAaJiVJf4MYL9t9Amiocns6uc5TDySI8yeNnLEMnUDHzO5gJ RADicAnZJFKoEC5vT1b9IQKnHxRr31WqQAQ/qS5bnUoLCT2EBdF1zGC6fW9vdEoWhHuQ 525Um36nCVx+WBFrUvnXoEpP66tHc1a/gb0fD9J/zc5/olzbHrMVZav/k5jirMoSeKAx ZZpA== X-Gm-Message-State: AOAM531WBicSfADrbaESqkvevESyIyf8DfxkSAxf3xsfdVIM0WJFShwG PqmSzd7fzTSAdnlJp2aQractr2O2GgbFPmaJtRq0 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-kernel@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