From patchwork Sun Feb 20 09:57:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 12752652 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 02475C433EF for ; Sun, 20 Feb 2022 09:58:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243597AbiBTJ7N (ORCPT ); Sun, 20 Feb 2022 04:59:13 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:40744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243596AbiBTJ7L (ORCPT ); Sun, 20 Feb 2022 04:59:11 -0500 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam08on2059.outbound.protection.outlook.com [40.107.102.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A353154191; Sun, 20 Feb 2022 01:58:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=APyqsFSTRhoP/MMp11vcaLQZoFPojlzxzCsQWt16DGPYudEKY00ND1q5OmUVw9C0fNjsxaWA1RiQAp+SFA1I9EirBz6O/bFfw4GD4hK+Io5MwTzXHkW5sd6NPl6pF7SA9PxhHzcliB94ggIGu9kg9pWRcZ5v9h97/VPmvl0J7JvmfjWCKnKk2uWLFMDPVshHwuUBiVFstO5vDwbDG6USITpXNJSJCor2+AOcSleg9JsxFzqNLE8nauo55Wc/zN7CCgYKkHM2Z2Lj0Vx+nMdV7RW6tZkfUfJbGpma2+rNnsYoxmfFbjlFeAhEIPOXrAo3ZKawlDJ3AuuNegONNLjNsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sh+Wv4Rj0ROCI1moErIr+cKiO00G2TXSHsDSrJjkwxo=; b=JX1Vtz0muQgQlr2yl2fMQWVrxYmnaVZ+MH9wP/g06UHZbE38jZCXAQfv0KzO919HbKDOSIrb+HNTJ4aPyLMIoRTDLNdzAKa24DqpzhrbZxoEwPda6zEWcaVoZ0sjUUn2hH5w83sqVKKPCtWbFJmMEhr/OdaRn9u0S1hpDEMW0kgieDIf3F/KFnPiPVYkSMPkU8SyrVP2BaR+yUkdLt7JivT8QqzYW6UIVuQvI3wOOSbPa3LjyjSIiZcANZK8RrfzZoXdn/R1Elc0YzD1u94TrypXz+5tDty+pxD1mwf6Mhd4P2MHhEgmmgaWYItwDsrBF6IfRanOvmekVxgyge16Ig== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.236) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sh+Wv4Rj0ROCI1moErIr+cKiO00G2TXSHsDSrJjkwxo=; b=bJBdBTsZP43NBToEALcG59kzfqTWjjpo/949KsNMHUJfWbjDmpU0MVSaljC74wfOnOiifw5XpX4lZoGT0zd2P+Bn7w7KD6+vY8Ka8oes1J63AWP1sB6eqBVnycGOMD1/Afn4lGN0o/ZL4dMRb0PowVbJjDC4FeSgbFTgwgygv8KczA9Ym63bq8IDEp8kNJ2lEYLp72yH+C4z0msSP1325I5Xg7gscia1gWBQsUfTLZK/TFvr1ZKrMjQtJ1hQSDb8tsQHyB4I18R4E6b6vjNXqnoDEEHzsbKYQ9+DWr04LQB7Rxc96CUFYW9fvlf1NBtk0EVS/Kt3hizqnwqcKS8xew== Received: from CO2PR04CA0005.namprd04.prod.outlook.com (2603:10b6:102:1::15) by MW2PR12MB2570.namprd12.prod.outlook.com (2603:10b6:907:a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.24; Sun, 20 Feb 2022 09:58:47 +0000 Received: from CO1NAM11FT013.eop-nam11.prod.protection.outlook.com (2603:10b6:102:1:cafe::f5) by CO2PR04CA0005.outlook.office365.com (2603:10b6:102:1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.24 via Frontend Transport; Sun, 20 Feb 2022 09:58:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.236) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.236 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.236; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.236) by CO1NAM11FT013.mail.protection.outlook.com (10.13.174.227) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4995.15 via Frontend Transport; Sun, 20 Feb 2022 09:58:47 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Sun, 20 Feb 2022 09:58:46 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9; Sun, 20 Feb 2022 01:58:46 -0800 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server id 15.2.986.9 via Frontend Transport; Sun, 20 Feb 2022 01:58:41 -0800 From: Yishai Hadas To: , , , CC: , , , , , , , , , , , , Subject: [PATCH V8 mlx5-next 06/15] net/mlx5: Introduce migration bits and structures Date: Sun, 20 Feb 2022 11:57:07 +0200 Message-ID: <20220220095716.153757-7-yishaih@nvidia.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20220220095716.153757-1-yishaih@nvidia.com> References: <20220220095716.153757-1-yishaih@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 79393c18-6955-47e5-b98f-08d9f457969e X-MS-TrafficTypeDiagnostic: MW2PR12MB2570:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FqYgQ/Ymvs3ZTtqjb+HuUDnx/91FeQmCYMSZNBcbGd3SIfqNO1GUDvkiJpcSAGCPLxZ3FgcmhMRmTT8ymm58CPWdw39HO6O3f302AY6o09WNx6kyTEpgOHBJ600a4iz1hQ9rMmiVHZ4mJBewtluQ3jnLD0+WFCw7wwcuQ527/BnjQwvbwK9rputZjnZ8xdABkkDTM9+o9x7BOc7PFbPDLzqoxo4ousCnpsebIZwX0RRmUhbblueWVDXdH5ThSmUSOxCLtULhN/7fsCDx0/QQx3WhUROLYOSiu0fiYlBc16foRlT4jOSCR2sRKgUfJSEcZIM8GyPL5YXO0pa4JeoOzGIHlKG9Oannhklx/NyElkGfq7CaTPCcKb295m4a7qabPDlS2QT7iD/sQ2LzAQnBrERdlILvxfPTxaW3O0+CzJtMSqb09VOxhJb9KaglGevzz3TMpxaVADJTIXsDz7E0LUo/0+OXZ6aeW6bJyY0d+sZG08eQLLrxlPAy2f5neKQLiRSKUaLUWIlVAFgIblhVzE4f/aasM0Zs7hXk4kSkKDt0XwC0tSfKsQJ4eSut30O6+bP6Dm46aL1cjWwab2lChC+awT0M1mu3n5Dk1ZYrT1rF6lO+L4U7oamDJDfsz+TulD/m/ZmqiqvakgfePdEwm7ky6yFIWLAeUglQdfLWG1lbfqHlJN+BLRYelztq2w7N5eF8QVhHK2WJna3gDS6Vaw== X-Forefront-Antispam-Report: CIP:12.22.5.236;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:mail.nvidia.com;PTR:InfoNoRecords;CAT:NONE;SFS:(13230001)(4636009)(40470700004)(36840700001)(46966006)(316002)(2906002)(7696005)(86362001)(82310400004)(54906003)(336012)(110136005)(426003)(6636002)(6666004)(2616005)(47076005)(5660300002)(7416002)(40460700003)(8936002)(36860700001)(186003)(26005)(1076003)(81166007)(356005)(4326008)(83380400001)(70206006)(70586007)(8676002)(36756003)(508600001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Feb 2022 09:58:47.4858 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 79393c18-6955-47e5-b98f-08d9f457969e X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[12.22.5.236];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT013.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR12MB2570 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Introduce migration IFC related stuff to enable migration commands. Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky --- include/linux/mlx5/mlx5_ifc.h | 147 +++++++++++++++++++++++++++++++++- 1 file changed, 146 insertions(+), 1 deletion(-) diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index 598ac3bcc901..45891a75c5ca 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h @@ -127,6 +127,11 @@ enum { MLX5_CMD_OP_QUERY_SF_PARTITION = 0x111, MLX5_CMD_OP_ALLOC_SF = 0x113, MLX5_CMD_OP_DEALLOC_SF = 0x114, + MLX5_CMD_OP_SUSPEND_VHCA = 0x115, + MLX5_CMD_OP_RESUME_VHCA = 0x116, + MLX5_CMD_OP_QUERY_VHCA_MIGRATION_STATE = 0x117, + MLX5_CMD_OP_SAVE_VHCA_STATE = 0x118, + MLX5_CMD_OP_LOAD_VHCA_STATE = 0x119, MLX5_CMD_OP_CREATE_MKEY = 0x200, MLX5_CMD_OP_QUERY_MKEY = 0x201, MLX5_CMD_OP_DESTROY_MKEY = 0x202, @@ -1757,7 +1762,9 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 reserved_at_682[0x1]; u8 log_max_sf[0x5]; u8 apu[0x1]; - u8 reserved_at_689[0x7]; + u8 reserved_at_689[0x4]; + u8 migration[0x1]; + u8 reserved_at_68e[0x2]; u8 log_min_sf_size[0x8]; u8 max_num_sf_partitions[0x8]; @@ -11519,4 +11526,142 @@ enum { MLX5_MTT_PERM_RW = MLX5_MTT_PERM_READ | MLX5_MTT_PERM_WRITE, }; +enum { + MLX5_SUSPEND_VHCA_IN_OP_MOD_SUSPEND_MASTER = 0x0, + MLX5_SUSPEND_VHCA_IN_OP_MOD_SUSPEND_SLAVE = 0x1, +}; + +struct mlx5_ifc_suspend_vhca_in_bits { + u8 opcode[0x10]; + u8 uid[0x10]; + + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + + u8 reserved_at_40[0x10]; + u8 vhca_id[0x10]; + + u8 reserved_at_60[0x20]; +}; + +struct mlx5_ifc_suspend_vhca_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + + u8 syndrome[0x20]; + + u8 reserved_at_40[0x40]; +}; + +enum { + MLX5_RESUME_VHCA_IN_OP_MOD_RESUME_SLAVE = 0x0, + MLX5_RESUME_VHCA_IN_OP_MOD_RESUME_MASTER = 0x1, +}; + +struct mlx5_ifc_resume_vhca_in_bits { + u8 opcode[0x10]; + u8 uid[0x10]; + + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + + u8 reserved_at_40[0x10]; + u8 vhca_id[0x10]; + + u8 reserved_at_60[0x20]; +}; + +struct mlx5_ifc_resume_vhca_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + + u8 syndrome[0x20]; + + u8 reserved_at_40[0x40]; +}; + +struct mlx5_ifc_query_vhca_migration_state_in_bits { + u8 opcode[0x10]; + u8 uid[0x10]; + + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + + u8 reserved_at_40[0x10]; + u8 vhca_id[0x10]; + + u8 reserved_at_60[0x20]; +}; + +struct mlx5_ifc_query_vhca_migration_state_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + + u8 syndrome[0x20]; + + u8 reserved_at_40[0x40]; + + u8 required_umem_size[0x20]; + + u8 reserved_at_a0[0x160]; +}; + +struct mlx5_ifc_save_vhca_state_in_bits { + u8 opcode[0x10]; + u8 uid[0x10]; + + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + + u8 reserved_at_40[0x10]; + u8 vhca_id[0x10]; + + u8 reserved_at_60[0x20]; + + u8 va[0x40]; + + u8 mkey[0x20]; + + u8 size[0x20]; +}; + +struct mlx5_ifc_save_vhca_state_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + + u8 syndrome[0x20]; + + u8 actual_image_size[0x20]; + + u8 reserved_at_60[0x20]; +}; + +struct mlx5_ifc_load_vhca_state_in_bits { + u8 opcode[0x10]; + u8 uid[0x10]; + + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + + u8 reserved_at_40[0x10]; + u8 vhca_id[0x10]; + + u8 reserved_at_60[0x20]; + + u8 va[0x40]; + + u8 mkey[0x20]; + + u8 size[0x20]; +}; + +struct mlx5_ifc_load_vhca_state_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + + u8 syndrome[0x20]; + + u8 reserved_at_40[0x40]; +}; + #endif /* MLX5_IFC_H */