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 smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 62D7DC38A2D for ; Fri, 21 Oct 2022 23:49:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id E6DDA60E79; Fri, 21 Oct 2022 23:49:46 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org E6DDA60E79 Authentication-Results: smtp3.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=oracle.com header.i=@oracle.com header.a=rsa-sha256 header.s=corp-2022-7-12 header.b=o2H9wvmq X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZL_GogpzA6UA; Fri, 21 Oct 2022 23:49:46 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id 68AF760BB8; Fri, 21 Oct 2022 23:49:45 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 68AF760BB8 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 374B3C0077; Fri, 21 Oct 2022 23:49:45 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 10BA7C002D for ; Fri, 21 Oct 2022 23:49:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id DCCA441859 for ; Fri, 21 Oct 2022 23:49:43 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org DCCA441859 Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.a=rsa-sha256 header.s=corp-2022-7-12 header.b=o2H9wvmq X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HgJOXL83Tc_z for ; Fri, 21 Oct 2022 23:49:41 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 096344184D Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by smtp4.osuosl.org (Postfix) with ESMTPS id 096344184D for ; Fri, 21 Oct 2022 23:49:40 +0000 (UTC) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29LLDlEp001545; Fri, 21 Oct 2022 23:49:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2022-7-12; bh=V7U93o+Lc8e/VViolr2K02LD3zVGat6a0bv7jBQ/DuE=; b=o2H9wvmqrC/aVP5g+9PScLnhdqDsbhELElCpUQnUsrLFlUrzy0QZcnzFGY+1w+ElVLwC E1ZAtrJ8WG8oM254DY59E9TPrrp5gfnzF8NlPx0/z2jNzT6kuH91nlUnYOOZgSGYIWcl jdwLE1rhXXq9Q4Lh6+GDWm/YBVvYzqZP9ueZLnHmtzlY8xnloONdeFWzN4EDiBw73CWM v+hUXK4aph45cKwpHulKMEl4cCoq79cYCnKfanPJ5ikEFhIO5ZidZOLA4o6AkzNmylqE YvOeX8VLdW+F/ZRVpWEYq2yXDaG7gp/IzVxqgndlMQrYt2/GXTvCAXNW6TYcEJ3t9a1m zw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k9awwdmr4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Oct 2022 23:49:40 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 29LMgIQS007144; Fri, 21 Oct 2022 23:49:38 GMT Received: from ban25x6uut24.us.oracle.com (ban25x6uut24.us.oracle.com [10.153.73.24]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3k8hre9a3b-2; Fri, 21 Oct 2022 23:49:38 +0000 From: Si-Wei Liu To: mst@redhat.com, jasowang@redhat.com, parav@nvidia.com Subject: [PATCH v3 1/4] vdpa: save vdpa_dev_set_config in struct vdpa_device Date: Fri, 21 Oct 2022 15:43:54 -0700 Message-Id: <1666392237-4042-2-git-send-email-si-wei.liu@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1666392237-4042-1-git-send-email-si-wei.liu@oracle.com> References: <1666392237-4042-1-git-send-email-si-wei.liu@oracle.com> X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210210139 X-Proofpoint-GUID: lS0vrvi2FmUheEorsn-MXjEvqAy3rb5y X-Proofpoint-ORIG-GUID: lS0vrvi2FmUheEorsn-MXjEvqAy3rb5y Cc: linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" In order to allow live migration orchestration software to export the initial set of vdpa attributes with which the device was created, it will be useful if the vdpa tool can report the config on demand with simple query. This will ease the orchestration software implementation so that it doesn't have to keep track of vdpa config change, or have to persist vdpa attributes across failure and recovery, in fear of being killed due to accidental software error. This commit attempts to make struct vdpa_device contain the struct vdpa_dev_set_config, where all config attributes upon vdpa creation are carried over. Which will be used in subsequent commits. Signed-off-by: Si-Wei Liu --- include/linux/vdpa.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h index 6d0f5e4..9f519a3 100644 --- a/include/linux/vdpa.h +++ b/include/linux/vdpa.h @@ -58,6 +58,16 @@ struct vdpa_vq_state { }; }; +struct vdpa_dev_set_config { + u64 device_features; + struct { + u8 mac[ETH_ALEN]; + u16 mtu; + u16 max_vq_pairs; + } net; + u64 mask; +}; + struct vdpa_mgmt_dev; /** @@ -77,6 +87,8 @@ struct vdpa_vq_state { * @nvqs: maximum number of supported virtqueues * @mdev: management device pointer; caller must setup when registering device as part * of dev_add() mgmtdev ops callback before invoking _vdpa_register_device(). + * @init_cfg: initial device config on vdpa creation; useful when instantiating + * device with identical config is needed, e.g. migration. */ struct vdpa_device { struct device dev; @@ -91,6 +103,7 @@ struct vdpa_device { struct vdpa_mgmt_dev *mdev; unsigned int ngroups; unsigned int nas; + struct vdpa_dev_set_config init_cfg; }; /** @@ -103,16 +116,6 @@ struct vdpa_iova_range { u64 last; }; -struct vdpa_dev_set_config { - u64 device_features; - struct { - u8 mac[ETH_ALEN]; - u16 mtu; - u16 max_vq_pairs; - } net; - u64 mask; -}; - /** * Corresponding file area for device memory mapping * @file: vma->vm_file for the mapping -- 1.8.3.1 _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization 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 3232AC38A2D for ; Fri, 21 Oct 2022 23:49:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229887AbiJUXtz (ORCPT ); Fri, 21 Oct 2022 19:49:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229587AbiJUXtp (ORCPT ); Fri, 21 Oct 2022 19:49:45 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2E6A36BC6 for ; Fri, 21 Oct 2022 16:49:44 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29LLDlEp001545; Fri, 21 Oct 2022 23:49:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2022-7-12; bh=V7U93o+Lc8e/VViolr2K02LD3zVGat6a0bv7jBQ/DuE=; b=o2H9wvmqrC/aVP5g+9PScLnhdqDsbhELElCpUQnUsrLFlUrzy0QZcnzFGY+1w+ElVLwC E1ZAtrJ8WG8oM254DY59E9TPrrp5gfnzF8NlPx0/z2jNzT6kuH91nlUnYOOZgSGYIWcl jdwLE1rhXXq9Q4Lh6+GDWm/YBVvYzqZP9ueZLnHmtzlY8xnloONdeFWzN4EDiBw73CWM v+hUXK4aph45cKwpHulKMEl4cCoq79cYCnKfanPJ5ikEFhIO5ZidZOLA4o6AkzNmylqE YvOeX8VLdW+F/ZRVpWEYq2yXDaG7gp/IzVxqgndlMQrYt2/GXTvCAXNW6TYcEJ3t9a1m zw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k9awwdmr4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Oct 2022 23:49:40 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 29LMgIQS007144; Fri, 21 Oct 2022 23:49:38 GMT Received: from ban25x6uut24.us.oracle.com (ban25x6uut24.us.oracle.com [10.153.73.24]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3k8hre9a3b-2; Fri, 21 Oct 2022 23:49:38 +0000 From: Si-Wei Liu To: mst@redhat.com, jasowang@redhat.com, parav@nvidia.com Cc: virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/4] vdpa: save vdpa_dev_set_config in struct vdpa_device Date: Fri, 21 Oct 2022 15:43:54 -0700 Message-Id: <1666392237-4042-2-git-send-email-si-wei.liu@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1666392237-4042-1-git-send-email-si-wei.liu@oracle.com> References: <1666392237-4042-1-git-send-email-si-wei.liu@oracle.com> X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210210139 X-Proofpoint-GUID: lS0vrvi2FmUheEorsn-MXjEvqAy3rb5y X-Proofpoint-ORIG-GUID: lS0vrvi2FmUheEorsn-MXjEvqAy3rb5y Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In order to allow live migration orchestration software to export the initial set of vdpa attributes with which the device was created, it will be useful if the vdpa tool can report the config on demand with simple query. This will ease the orchestration software implementation so that it doesn't have to keep track of vdpa config change, or have to persist vdpa attributes across failure and recovery, in fear of being killed due to accidental software error. This commit attempts to make struct vdpa_device contain the struct vdpa_dev_set_config, where all config attributes upon vdpa creation are carried over. Which will be used in subsequent commits. Signed-off-by: Si-Wei Liu --- include/linux/vdpa.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h index 6d0f5e4..9f519a3 100644 --- a/include/linux/vdpa.h +++ b/include/linux/vdpa.h @@ -58,6 +58,16 @@ struct vdpa_vq_state { }; }; +struct vdpa_dev_set_config { + u64 device_features; + struct { + u8 mac[ETH_ALEN]; + u16 mtu; + u16 max_vq_pairs; + } net; + u64 mask; +}; + struct vdpa_mgmt_dev; /** @@ -77,6 +87,8 @@ struct vdpa_vq_state { * @nvqs: maximum number of supported virtqueues * @mdev: management device pointer; caller must setup when registering device as part * of dev_add() mgmtdev ops callback before invoking _vdpa_register_device(). + * @init_cfg: initial device config on vdpa creation; useful when instantiating + * device with identical config is needed, e.g. migration. */ struct vdpa_device { struct device dev; @@ -91,6 +103,7 @@ struct vdpa_device { struct vdpa_mgmt_dev *mdev; unsigned int ngroups; unsigned int nas; + struct vdpa_dev_set_config init_cfg; }; /** @@ -103,16 +116,6 @@ struct vdpa_iova_range { u64 last; }; -struct vdpa_dev_set_config { - u64 device_features; - struct { - u8 mac[ETH_ALEN]; - u16 mtu; - u16 max_vq_pairs; - } net; - u64 mask; -}; - /** * Corresponding file area for device memory mapping * @file: vma->vm_file for the mapping -- 1.8.3.1