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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88CB0C433EF for ; Fri, 8 Jul 2022 11:31:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238028AbiGHLbB (ORCPT ); Fri, 8 Jul 2022 07:31:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237996AbiGHLa6 (ORCPT ); Fri, 8 Jul 2022 07:30:58 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 039D2BCA8 for ; Fri, 8 Jul 2022 04:30:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657279857; 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=UAhm09EfssnFXCcdbsvbfvfsk3WrYS8DdytneLUevKI=; b=GT6aS34skfT8F5lPPnSnLGtlOYLicOddG/IZJTADFwrG+qUHbLMDQmw4AI9cn6B/HGJcEf yv9IZYeHPYLDsLYD80wnAhE+BgoQRVV5ZmlZIubIdjyayBx7qwF3Rel0i7yt6QTGOaV1WK ZfNsZvo6fLtIJOIWjQyR4ibq4MA8blM= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-319-hlUPzePNM3ecP4e_O2Ntpw-1; Fri, 08 Jul 2022 07:30:56 -0400 X-MC-Unique: hlUPzePNM3ecP4e_O2Ntpw-1 Received: by mail-qk1-f197.google.com with SMTP id f10-20020a05620a408a00b006b267fdf71fso18653871qko.6 for ; Fri, 08 Jul 2022 04:30:56 -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=UAhm09EfssnFXCcdbsvbfvfsk3WrYS8DdytneLUevKI=; b=2S23Ax9ZahLLcFkqXnrN8G5A2chpuaSwiOfx+F6X6/zUqK2ERRkwep+7ra2H98ICi8 DnVXyxgYrWEJuFFQ0hzB9mM7+Hhp+EReYX0HNm3D345aa/QgJPRzIFJ7hDFGh3ZCMq30 /VxVIzMXFXsBPg3bBIYjfLhFo0H9NqQ7nToO0vXRTTdQP+3lTMuof7q/e7qh1L3yoU2c N7FoeCS2yA9zCb9G49PQLK05Zx8PsB8Qnc/giEARouPCtW4ZQT7vB2pv1S7A9dSJ9vE7 hGOlJ6Vy8vs0GRxZDNDJKFXaoy3VxWtx76tnQ9AnthBdFln/H2Smqfq6z+tLkc8x18It UlXQ== X-Gm-Message-State: AJIora9U2fO2ijB+Aw3YmWlR8gq11/ij37ggvzZICjAwNxGwGAd48eii GiDI7on6dMknAwMFx5UV1Ck/Ia42otmd2/YT0epdLFo3uflKo771y0Kjjxl7HokmIAqEshYnXMH nuo1Xhwx/nvOvNr+ANEoyFj+P+EOagWBI9okclYHu X-Received: by 2002:a05:620a:1a28:b0:6b1:4d4d:c7c3 with SMTP id bk40-20020a05620a1a2800b006b14d4dc7c3mr1814596qkb.522.1657279855631; Fri, 08 Jul 2022 04:30:55 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v8+NK0ig5X6Bjadt6KK8FEJO3wlTzXuPkDiWOHFPeuAEaLG9/Cabys/udfnjWvsySslvzBdf92a3lY5t1vcR0= X-Received: by 2002:a05:620a:1a28:b0:6b1:4d4d:c7c3 with SMTP id bk40-20020a05620a1a2800b006b14d4dc7c3mr1814565qkb.522.1657279855371; Fri, 08 Jul 2022 04:30:55 -0700 (PDT) MIME-Version: 1.0 References: <20220623160738.632852-1-eperezma@redhat.com> <20220623160738.632852-2-eperezma@redhat.com> In-Reply-To: From: Eugenio Perez Martin Date: Fri, 8 Jul 2022 13:30:19 +0200 Message-ID: Subject: Re: [PATCH v6 1/4] vdpa: Add suspend operation To: Jason Wang 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 bi= t > > 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. Do you think it should be controlled in the vdpa frontend code? 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 (optional) > > + * @vdev: vdpa device > > + * Returns integer: success (0) or error (= < 0) > > * @get_config_size: Get the size of the configuration space= includes > > * fields that are conditional on feature = 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 offse= t, > > void *buf, unsigned int len); > > -- > > 2.31.1 > > >