From patchwork Wed Aug 10 17:15:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eugenio Perez Martin X-Patchwork-Id: 12940827 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 C5023C00140 for ; Wed, 10 Aug 2022 17:15:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233406AbiHJRPd (ORCPT ); Wed, 10 Aug 2022 13:15:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233382AbiHJRPa (ORCPT ); Wed, 10 Aug 2022 13:15:30 -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 1CBDF61D9B for ; Wed, 10 Aug 2022 10:15:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660151728; 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=i3xMckH4pXPfYRScm/pgwCzvro6+t56bA2voo3F7GcY=; b=K3ASpx9aEOOEJtbNknGtyi1chVLHsXCv4cUuXyk0zG7eGubzV/ymYseE4nlraHkJDpBECj xppw5xfy25Eo0LbFgZWDmcfeNvtRD7bgmVATN6BQWyk2SvViYTaIG7DBGQlFmvT8kNAQsg Of/25ihfg+QJKvqCWwuglBqZUahwyWE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-649-QocaGs_zPLKxQQ1TirQ3-w-1; Wed, 10 Aug 2022 13:15:25 -0400 X-MC-Unique: QocaGs_zPLKxQQ1TirQ3-w-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9FF1C1824600; Wed, 10 Aug 2022 17:15:24 +0000 (UTC) Received: from eperezma.remote.csb (unknown [10.39.193.156]) by smtp.corp.redhat.com (Postfix) with ESMTP id C791E1415128; Wed, 10 Aug 2022 17:15:19 +0000 (UTC) From: =?utf-8?q?Eugenio_P=C3=A9rez?= To: kvm@vger.kernel.org, "Michael S. Tsirkin" , linux-kernel@vger.kernel.org, Jason Wang , virtualization@lists.linux-foundation.org, netdev@vger.kernel.org Cc: dinang@xilinx.com, martinpo@xilinx.com, Wu Zongyong , Piotr.Uminski@intel.com, gautam.dawar@amd.com, ecree.xilinx@gmail.com, martinh@xilinx.com, Stefano Garzarella , pabloc@xilinx.com, habetsm.xilinx@gmail.com, lvivier@redhat.com, Zhu Lingshan , tanuj.kamde@amd.com, Longpeng , lulu@redhat.com, hanand@xilinx.com, Parav Pandit , Si-Wei Liu , Eli Cohen , Xie Yongji , Zhang Min , Dan Carpenter , Christophe JAILLET Subject: [PATCH v7 1/4] vdpa: Add suspend operation Date: Wed, 10 Aug 2022 19:15:09 +0200 Message-Id: <20220810171512.2343333-2-eperezma@redhat.com> In-Reply-To: <20220810171512.2343333-1-eperezma@redhat.com> References: <20220810171512.2343333-1-eperezma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org This operation is optional: It it's not implemented, backend feature bit will not be exposed. Signed-off-by: Eugenio PĂ©rez Message-Id: <20220623160738.632852-2-eperezma@redhat.com> Signed-off-by: Michael S. Tsirkin --- 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 offset, void *buf, unsigned int len);