Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5360972pxj; Tue, 22 Jun 2021 22:51:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/rXrG4np4h+bz96UtSJAposyViXTtKc5xUkrZmz2pOTPbZhr9QIYFH8Wg3HLac3UbNu40 X-Received: by 2002:a05:6638:379d:: with SMTP id w29mr7471992jal.2.1624427464821; Tue, 22 Jun 2021 22:51:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624427464; cv=none; d=google.com; s=arc-20160816; b=jVayXNgGi2CXtS/MnZ+gkPSmJS6w5v6lM2TtZyGSn0kQYRcONGxC/R18uVAgTyGb6M BuN6+cJ7/1xIv5C7NoT55f8/ssEc8dIMzct4ju2uKho2Pk058rG/kIU44Q2+6b+jLT4j InQTsUQ0bMholO1YHs93CCHqfobZyuRUEAocyIjpxJXD7I2vtKoemJHjxejvtrZcnvRo ux1NUZQyBqEthNHgiULKjpi6J+Zt5fpQj6d2FyZ1xtnDrt5hKbl3btWso01blHvAL5+D eiH3Yx6tz3mwsVqb6EftCaUZmc8mmEGiCCanEb+0jEvQJjsEMng6OyhLJLpKq4rpHkV/ CdAQ== 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=4GiuBeValxmP+XXrOzcRmIGN8AohLiEvZ/1N4xkfEsc=; b=nUngLvR1rkN/J6UwY8+mR+8Z0sgIHGOqMiEU/zQ8+qPRG3z6X3iZXK/kOaHWFX1xLn OA86nh/z39XAf2d3IIiKvAqdzKGB/26g5AYQ39IXgrVD0ygVgxEnfySJvHMvJmF6GGeA RsJ7L1Q8RYZ5goNv76JxqBfhP/ptUKXZXWsEbvjejFxZ6U4LoG5OjoRHVPPVKRJ2TZbs de+iBpMMy0hS0QNvtp5tNIoXR5oWfQ/K1LXPl5w/YtnKLTbAeueoaZrc4QLRJhWopDBk cKauzUeyngDFNayDvi4HMquL1/8Zwd/5amyNZXr/ajfY6hazGW1GfJzULpqvym0yktDT TerA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=1ojgGgah; 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 187si24165532iow.86.2021.06.22.22.50.52; Tue, 22 Jun 2021 22:51:04 -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=1ojgGgah; 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 S229924AbhFWFwb (ORCPT + 99 others); Wed, 23 Jun 2021 01:52:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229833AbhFWFwa (ORCPT ); Wed, 23 Jun 2021 01:52:30 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9AE3C06175F for ; Tue, 22 Jun 2021 22:50:12 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id ot9so1066259ejb.8 for ; Tue, 22 Jun 2021 22:50:12 -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=4GiuBeValxmP+XXrOzcRmIGN8AohLiEvZ/1N4xkfEsc=; b=1ojgGgahexzFXE9RdNLyeoPjvzgy1FuMSknCgn9K5GwXoXKChPXHlt8RFqJU6xJGuF Cgrqzm5EDspyu9pceCZQxvmPvCVRPYcOLwyyVOaWAFc+/73Sd1ei8PUVLb3hMJg85yGd OoiS+Tom58BzQ4gVjO0sTB3pg1TBBl4FTS0KCFKWgNCJHr3b6clNKWi9sch5PBKWSbC5 hdgylXBSI1fEHL65mcL5+HqoUj0DqlN+Vgg5BbVMgsnjT5z5R29YjArWCkkrPQkSQcTP G0euaC5g3D/chfHTH21pgGDle3JiDm7q2fqGYTk+72WN78OHY9b3+JAT5mbt83TyJaUN rngA== 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=4GiuBeValxmP+XXrOzcRmIGN8AohLiEvZ/1N4xkfEsc=; b=fsGDRAhSyvBkg4rK8huwmxMPczpZFY9/n/Xq5aZ7S8YwvfapxvRlOKrQ074M8k0DC5 /iWx8xYrAElxBXT6aTywBI0u4Phvoep2v5AlbfytDPDZpe9z9jrUxMNBmbPMH9P/oUc7 qipoV9VBLDvKReC0Qep6zskmFIC+0K59BO+it1tROljogCwo8Tt2CDvwc+LxukqKYDHa a/JmNDUC+d+YYjVGDEIQ6Cje7S6UAEOLxvt/J9slsMt3t1ym1XtoHcRdk3kIEy2DpWCr /SG6J/u36K7X5tm+TOnCH4G/Xg4UFF42t/oRy8zbepBgT/jzV2EB3tkPQ4H7H2EuIXr+ 5rCw== X-Gm-Message-State: AOAM530jHCKLhjq2saZ52fNt3MLMUzMP0eF7BuFbUMo0EWSDzauRBVQb KNqlARWV/v7xTkU44sPUNfqe9SKPmFFbZaj8/mH5 X-Received: by 2002:a17:906:9a4f:: with SMTP id aj15mr7921850ejc.197.1624427411326; Tue, 22 Jun 2021 22:50:11 -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> In-Reply-To: From: Yongji Xie Date: Wed, 23 Jun 2021 13:50:00 +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 Wed, Jun 23, 2021 at 11:31 AM Jason Wang wrote: > > > =E5=9C=A8 2021/6/22 =E4=B8=8B=E5=8D=884:14, Yongji Xie =E5=86=99=E9=81=93= : > > On Tue, Jun 22, 2021 at 3:50 PM Jason Wang wrote: > >> > >> =E5=9C=A8 2021/6/22 =E4=B8=8B=E5=8D=883:22, Yongji Xie =E5=86=99=E9=81= =93: > >>>> We need fix a way to propagate the error to the userspace. > >>>> > >>>> E.g if we want to stop the deivce, we will delay the status reset un= til > >>>> we get respose from the userspace? > >>>> > >>> I didn't get how to delay the status reset. And should it be a DoS > >>> that we want to fix if the userspace doesn't give a response forever? > >> > >> You're right. So let's make set_status() can fail first, then propagat= e > >> its failure via VHOST_VDPA_SET_STATUS. > >> > > OK. So we only need to propagate the failure in the vhost-vdpa case, ri= ght? > > > I think not, we need to deal with the reset for virtio as well: > > E.g in register_virtio_devices(), we have: > > /* We always start by resetting the device, in case a previous > * driver messed it up. This also tests that code path a > little. */ > dev->config->reset(dev); > > We probably need to make reset can fail and then fail the > register_virtio_device() as well. > OK, looks like virtio_add_status() and virtio_device_ready()[1] should be also modified if we need to propagate the failure in the virtio-vdpa case. Or do we only need to care about the reset case? [1] https://lore.kernel.org/lkml/20210517093428.670-1-xieyongji@bytedance.c= om/ Thanks, Yongji