Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4105025imw; Tue, 12 Jul 2022 01:45:01 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sGjIqVLPEE0ZXQG+De5bM4RNToSH9FXzrRlVp3XKqbPYdX2JP4PZDzdODmb1z7k+8tVzwI X-Received: by 2002:a17:906:d550:b0:723:5c2c:8a71 with SMTP id cr16-20020a170906d55000b007235c2c8a71mr22360183ejc.254.1657615501303; Tue, 12 Jul 2022 01:45:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657615501; cv=none; d=google.com; s=arc-20160816; b=JAd5anQS6aNQsiCvSQxV7Tu5ClaskQJcN1yu3deYTc91xqNTxOVkdfWDIYs/ByJ8Ty pkF/RWs0go3WigWYHAPc0WwkvVls2qfQVW/HEKHOKCMxf+DBOLbwJGczk8R+Z7noeu2f aEOrhkbDlnSq39TmaYVQ9HGCYfhMJVcX1DWnfGE3u7rw/BI/z17TMcCXvURD49Dyl5LJ t/smS01YpVJFw6GS5Ra6nEcV0CEWqf3Q9sD85St989BSqEb5nsuvPNzhTHQ1vM3/buCa I7ncEzi9hS9fLs3MikHf3NmqAx3140k7iRzjZ7rP8RTCakJFx9mEVHi8CMumnxR96xQF z1Dw== 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=Zk3S2xAdR/7hGTN3JMUGrzoWncg4Rn0Aa+mjreKRU3I=; b=mFCge/FKSLbJCqNTzmA2H7HlAP54BZhpojLkx0MpZj2J1r86y3LOMW+8o4Vaxl1UqR nUGl0lOyRVbaToW/RuLjoLPkO6tt83hQFz9RvT6wD+9FvIsSeZtpEIncwputzlqm7jlA mX5E1Z6/shUbKbz1L4xmfOxhAAmFz5HtMc7OO8H6d4/jPY8nR59PkD33IEKxsoyS88SV ux5AVqJE42HUZ5jLt/rHFr5/XFWbmEnbUqKCdPatdlqGZBTl3VrOA1/y3Rw3SzjFGmyc E5OHTbL3r/K93CC/XkhaIgVJb2+s0g+NMcitevk4pZRlfji1pKPEKpShreU0veUKFeDt Om0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HuMngzBq; 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 w11-20020a056402268b00b0043ad6a701f0si7848510edd.398.2022.07.12.01.44.35; Tue, 12 Jul 2022 01:45:01 -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=HuMngzBq; 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 S231524AbiGLIEl (ORCPT + 99 others); Tue, 12 Jul 2022 04:04:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232223AbiGLIEj (ORCPT ); Tue, 12 Jul 2022 04:04:39 -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 D3B9ADF1C for ; Tue, 12 Jul 2022 01:04:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657613078; 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=Zk3S2xAdR/7hGTN3JMUGrzoWncg4Rn0Aa+mjreKRU3I=; b=HuMngzBqIr7YYIof3MhLPUox8wKJrS2lB18nGQ1I6/b0IXA+uMn1+foZo6BGReKKsad4Ft al/Vr5vpVKh4AkbDXeAHQ0heHl0e7377k6Jq9J+h00Y6Lz25qQXw5uqMkCkOU06VG5InEK I0TpQT4wgP7Pg6rNJVzw57TbkXNLRTs= Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-20-gytXheyKOiC9OcUYr-eSSw-1; Tue, 12 Jul 2022 04:04:36 -0400 X-MC-Unique: gytXheyKOiC9OcUYr-eSSw-1 Received: by mail-lj1-f197.google.com with SMTP id x21-20020a2e7c15000000b0025d5f706f66so1257147ljc.5 for ; Tue, 12 Jul 2022 01:04:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Zk3S2xAdR/7hGTN3JMUGrzoWncg4Rn0Aa+mjreKRU3I=; b=Eey/LZxpvp+1b9+eke26u0ZkSR8cxblV8AkUXF1xfqKe5Xi9fwDUeNCpSPBzF7AJM2 XSzWhJQLpSEnxz50gy5zHKv35LHuE3ffeO2NndHcTzIY+nWo24KQidyoomfU5wMt9U3y q6vCFTzAUIEf87scWaoCkiqn6CqTx5gLGkfN+oXeCM3SRwkQi/wsy8fufpioAC2QCyGO GPYpXe9YFMqSmy0swZ/yrt7LeiVKQgeDLrElF6mlhKzOt5rmqVsxZwTbQYVwJQS5GulG SECNOTlFAmxCA6HjB32F8dX72u/G09gn640IoexHf3zL+ZumRfoB1FPnd3TuI6Exs3l4 TTVQ== X-Gm-Message-State: AJIora+zCF8bir+CLXo1cDfzfQWlVqrQxr8uXD08a2l6ImN3LdoeTdsV 5R3/SDPa6TbPpUtztnsY3OxjWjbCv1KIlaH24CrWwZFkgB862PsgIDWccrnYIwlyAXrTXYQZrOH hTIu5YJNiQpeLhkGc2DkD6KxVsI9xetC5V/EWiMcl X-Received: by 2002:a05:6512:3b8e:b0:481:1a75:452 with SMTP id g14-20020a0565123b8e00b004811a750452mr15293723lfv.238.1657613075127; Tue, 12 Jul 2022 01:04:35 -0700 (PDT) X-Received: by 2002:a05:6512:3b8e:b0:481:1a75:452 with SMTP id g14-20020a0565123b8e00b004811a750452mr15293702lfv.238.1657613074923; Tue, 12 Jul 2022 01:04:34 -0700 (PDT) MIME-Version: 1.0 References: <20220623160738.632852-1-eperezma@redhat.com> <20220623160738.632852-2-eperezma@redhat.com> In-Reply-To: From: Jason Wang Date: Tue, 12 Jul 2022 16:04:23 +0800 Message-ID: Subject: Re: [PATCH v6 1/4] vdpa: Add suspend operation To: Eugenio Perez Martin Cc: netdev , linux-kernel , virtualization , kvm , "Michael S. Tsirkin" , Parav Pandit , Christophe JAILLET , Cindy Lu , "Kamde, Tanuj" , Si-Wei Liu , "Uminski, Piotr" , habetsm.xilinx@gmail.com, "Dawar, Gautam" , Pablo Cascon Katchadourian , Zhu Lingshan , Laurent Vivier , Longpeng , Dinan Gunawardena , Martin Petrus Hubertus Habets , Martin Porter , Eli Cohen , ecree.xilinx@gmail.com, Wu Zongyong , Stefano Garzarella , Dan Carpenter , Harpreet Singh Anand , Xie Yongji , Zhang Min Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Fri, Jul 8, 2022 at 7:31 PM Eugenio Perez Martin w= rote: > > On Wed, Jun 29, 2022 at 6:10 AM Jason Wang wrote: > > > > On Fri, Jun 24, 2022 at 12:07 AM Eugenio P=C3=A9rez wrote: > > > > > > This operation is optional: It it's not implemented, backend feature = bit > > > will not be exposed. > > > > A question, do we allow suspending a device without DRIVER_OK? > > > > That should be invalid. In particular, vdpa_sim will resume in that > case, but I guess it would depend on the device. Yes, and that will match our virtio spec patch (STOP bit). > > Do you think it should be controlled in the vdpa frontend code? The vdpa bus should validate this at least. Thanks > > Thanks! > > > Thanks > > > > > > > > Signed-off-by: Eugenio P=C3=A9rez > > > --- > > > include/linux/vdpa.h | 4 ++++ > > > 1 file changed, 4 insertions(+) > > > > > > diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h > > > index 7b4a13d3bd91..d282f464d2f1 100644 > > > --- a/include/linux/vdpa.h > > > +++ b/include/linux/vdpa.h > > > @@ -218,6 +218,9 @@ struct vdpa_map_file { > > > * @reset: Reset device > > > * @vdev: vdpa device > > > * Returns integer: success (0) or error= (< 0) > > > + * @suspend: Suspend or resume the device (optiona= l) > > > + * @vdev: vdpa device > > > + * Returns integer: success (0) or error= (< 0) > > > * @get_config_size: Get the size of the configuration spa= ce includes > > > * fields that are conditional on featur= e bits. > > > * @vdev: vdpa device > > > @@ -319,6 +322,7 @@ struct vdpa_config_ops { > > > u8 (*get_status)(struct vdpa_device *vdev); > > > void (*set_status)(struct vdpa_device *vdev, u8 status); > > > int (*reset)(struct vdpa_device *vdev); > > > + int (*suspend)(struct vdpa_device *vdev); > > > size_t (*get_config_size)(struct vdpa_device *vdev); > > > void (*get_config)(struct vdpa_device *vdev, unsigned int off= set, > > > void *buf, unsigned int len); > > > -- > > > 2.31.1 > > > > > >