Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2895789ioo; Tue, 24 May 2022 08:17:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzphtieJZBViXUp8Wl7xv6izvZqt5EejEJIUUtCubKdGJsEQGGg0k4cMyyQsJmUHQEA5dy/ X-Received: by 2002:a17:907:7e93:b0:6fe:e76b:1a4 with SMTP id qb19-20020a1709077e9300b006fee76b01a4mr9376743ejc.427.1653405427362; Tue, 24 May 2022 08:17:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653405427; cv=none; d=google.com; s=arc-20160816; b=adSHI2d/teGVZlh0uwKqIDB+vdLovh9X2h90r1hY9YeRgCpp4XYqh/aztNx2+c9Bdr t9TWpM+T3l0eSDtAtTtT+3Ciq64mzkRIRHvrTSQwbm0kMl1Nndt7IQZ3w8GFuSEHHvwQ MfOo77O+qfxx96tHEE8qKa/vTnqC1di329W0rXT1tfFKgrn1ACrGWdyv2PytvD5WAItZ dC1KnJI7FUq0aRn4ZUd8NakTTTovkxZVdB9t/vgn9G9aMJn2wRhJau0tPw41Yv3Vw79u oIGVlu/Aj9TTaJDFLgli+GrTymjOH6i3Tkpb76I00GCjceq37YG6o+UgHQHYQw/fU5lI pSDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=4Jg/VQp3/7T8NXHS/IRW4J+wxsI4fOnWx/NzDoP4bWw=; b=NNry/dcmR7egFAx2A4a3oN483k8ia23urbKSk/SFK9sO2N2ao2/1/MD9DORntAgN37 Mx4v+ehk/LmC573Oi8WHQmqbydSdo70A80+dNX6iYT0VqrQBnkija53gmoMAobE+weVC mRP0F6KiwEBlCP/CZUh7gFeRHT3xPDhGrFYOjNabkQYHBfUQ4sUoozWWgPtlydlFo8kv lbvKovyfEQCdmuxAXZdrpVoDQi46wxYcaU3Sm1jFt9sJcNr57Fu5sVhvmMAmg5vEbYB5 c5z2vrI9cBY9hvJu9J3/fBSdiL84/95RYA9DyREMT93DqLD+7lCVz3tgJwsNG0FP4O5A JFRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Xvo8VQy8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gl1-20020a1709073c8100b006fe9a0289d5si16486339ejc.885.2022.05.24.08.16.39; Tue, 24 May 2022 08:17:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Xvo8VQy8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S234480AbiEXHJQ (ORCPT + 99 others); Tue, 24 May 2022 03:09:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234453AbiEXHJO (ORCPT ); Tue, 24 May 2022 03:09:14 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2F2BC85ED2 for ; Tue, 24 May 2022 00:09:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653376153; 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=4Jg/VQp3/7T8NXHS/IRW4J+wxsI4fOnWx/NzDoP4bWw=; b=Xvo8VQy8os2gj/QGJ1mq6DDqrGJ1m47J4afzzKhWMnsVPhBI4ZLUT/Cfo8ewJfRKtsPmvk 6DGdPdb2PYaBlwI53HutalWaCMoGPRrgUl9XwiLG1w0FGhWZWiEnGpL8cOQuhWxqJ5CkgK 0WBc886IjtyK+WvYi2OEQzOXvXhPPD0= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-140-OwdW4ptpPgaWSBcYtJaRRw-1; Tue, 24 May 2022 03:09:12 -0400 X-MC-Unique: OwdW4ptpPgaWSBcYtJaRRw-1 Received: by mail-qv1-f72.google.com with SMTP id kk13-20020a056214508d00b004622b4b8762so4698696qvb.4 for ; Tue, 24 May 2022 00:09:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=4Jg/VQp3/7T8NXHS/IRW4J+wxsI4fOnWx/NzDoP4bWw=; b=cAm4bB9DuBD8Ddne7Zc6My+KFX+Z6pWNmZX8rJD24O//3qXGuvM80SWWAZ++gmwc4c yUN33L0CsJzY//msHXl62AsVIfA+Bv/HazYKtAsDKaINOvDRf8dymLusWkrKViu88jzL K8tISnDQXrhbj695U5hL4CszuZz//6/h9eM0VzGBEVzZBcWiVtRhKGMknoXIBg/jfRnX RAq8kPHvzbYiG5YX5srTtrimQCVXDxdSj+NVx1QrwFuT0IDq/gyla08ANnNZHBnpzzkF vfG1cDQ+AJWPlXe8JN4ENW9trfAMEFq8SsdhLCajsnn/Utfctx+oxtGAE6v//4YQSoJ7 z5cQ== X-Gm-Message-State: AOAM530ArUGH+rEM6YqpENau0mAbiH+gTWfldWxJrMO0vnSKhswdb1oy 8+85FwWpXOJzfVLZ6UBBmF0J4vDmzl1IiqbvV68Su84IXZRC6rvo/7R8Ivszb7a5oXPmCPBvtmu WS0MiXXFUXz/uru93kkFrpgce X-Received: by 2002:a05:6214:194e:b0:45a:d8e3:2d3f with SMTP id q14-20020a056214194e00b0045ad8e32d3fmr19980103qvk.59.1653376151730; Tue, 24 May 2022 00:09:11 -0700 (PDT) X-Received: by 2002:a05:6214:194e:b0:45a:d8e3:2d3f with SMTP id q14-20020a056214194e00b0045ad8e32d3fmr19980097qvk.59.1653376151522; Tue, 24 May 2022 00:09:11 -0700 (PDT) Received: from sgarzare-redhat (host-87-12-25-16.business.telecomitalia.it. [87.12.25.16]) by smtp.gmail.com with ESMTPSA id bs40-20020a05620a472800b006a34918ea64sm6589755qkb.98.2022.05.24.00.09.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 May 2022 00:09:10 -0700 (PDT) Date: Tue, 24 May 2022 09:09:00 +0200 From: Stefano Garzarella To: Eugenio Perez Martin Cc: Si-Wei Liu , virtualization , Jason Wang , kvm list , "Michael S. Tsirkin" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Longpeng , Zhu Lingshan , Martin Petrus Hubertus Habets , Harpreet Singh Anand , dinang@xilinx.com, Eli Cohen , Laurent Vivier , pabloc@xilinx.com, "Dawar, Gautam" , Xie Yongji , habetsm.xilinx@gmail.com, Christophe JAILLET , tanuj.kamde@amd.com, Wu Zongyong , martinpo@xilinx.com, Cindy Lu , ecree.xilinx@gmail.com, Parav Pandit , Dan Carpenter , Zhang Min Subject: Re: [PATCH 1/4] vdpa: Add stop operation Message-ID: <20220524070900.ak7a5frwtezjhhrq@sgarzare-redhat> References: <20220520172325.980884-1-eperezma@redhat.com> <20220520172325.980884-2-eperezma@redhat.com> <79089dc4-07c4-369b-826c-1c6e12edcaff@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 23, 2022 at 09:20:14PM +0200, Eugenio Perez Martin wrote: >On Sat, May 21, 2022 at 12:13 PM Si-Wei Liu wrote: >> >> >> >> On 5/20/2022 10:23 AM, Eugenio P?rez wrote: >> > This operation is optional: It it's not implemented, backend feature bit >> > will not be exposed. >> > >> > Signed-off-by: Eugenio P?rez >> > --- >> > include/linux/vdpa.h | 6 ++++++ >> > 1 file changed, 6 insertions(+) >> > >> > diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h >> > index 15af802d41c4..ddfebc4e1e01 100644 >> > --- a/include/linux/vdpa.h >> > +++ b/include/linux/vdpa.h >> > @@ -215,6 +215,11 @@ struct vdpa_map_file { >> > * @reset: Reset device >> > * @vdev: vdpa device >> > * Returns integer: success (0) or error (< 0) >> > + * @stop: Stop or resume the device (optional, but it must >> > + * be implemented if require device stop) >> > + * @vdev: vdpa device >> > + * @stop: stop (true), not stop (false) >> > + * Returns integer: success (0) or error (< 0) >> Is this uAPI meant to address all use cases described in the full blown >> _F_STOP virtio spec proposal, such as: >> >> --------------%<-------------- >> >> ...... the device MUST finish any in flight >> operations after the driver writes STOP. Depending on the device, it >> can do it >> in many ways as long as the driver can recover its normal operation >> if it >> resumes the device without the need of resetting it: >> >> - Drain and wait for the completion of all pending requests until a >> convenient avail descriptor. Ignore any other posterior descriptor. >> - Return a device-specific failure for these descriptors, so the driver >> can choose to retry or to cancel them. >> - Mark them as done even if they are not, if the kind of device can >> assume to lose them. >> --------------%<-------------- >> > >Right, this is totally underspecified in this series. > >I'll expand on it in the next version, but that text proposed to >virtio-comment was complicated and misleading. I find better to get >the previous version description. Would the next description work? > >``` >After the return of ioctl, the device MUST finish any pending operations like >in flight requests. It must also preserve all the necessary state (the >virtqueue vring base plus the possible device specific states) that is required >for restoring in the future. For block devices wait for all in-flight requests could take several time. Could this be a problem if the caller gets stuck on this ioctl? If it could be a problem, maybe we should use an eventfd to signal that the device is successfully stopped. Thanks, Stefano