From patchwork Wed Oct 13 09:47:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 12555325 X-Patchwork-Delegate: bhelgaas@google.com 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75BD0C433EF for ; Wed, 13 Oct 2021 09:49:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5494060F4A for ; Wed, 13 Oct 2021 09:49:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239207AbhJMJvj (ORCPT ); Wed, 13 Oct 2021 05:51:39 -0400 Received: from mail-bn8nam11on2063.outbound.protection.outlook.com ([40.107.236.63]:19392 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239189AbhJMJu7 (ORCPT ); Wed, 13 Oct 2021 05:50:59 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ECPoXST55l+Y8WAxSoh/mXlJkwNIguRc1XJCBOH4WWTI5oSiO3LpoE+cft/HBkXB1/d5HZAgjsJuNv9oLp97UxidADv2dyElLs73Ir7aqa/Uy0jXvuWeSv/uUyYURMxQhSWKz/sI4ABYygUv4k54oHdwz+DfzsmW6kH+3oJvwQHmML3blGXq+KAaofXVsodvJ67FTObGkL8slUJaKTLOOmRUpJEsvd0ATENUkw5atrciAum5uqVZXvA3Dldvg9UnF44AlEkFDc/v7uZ1VwaJVKKmwOeOmdxVQkZ/JgJ8/9CNi9FIA/YXhuyuWAgOA8HRWuGRT8b8+1/2LvuevRy0Tg== 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=R7DbtBQIcZF4LUA2VaUaiDzMK1m8SVbr7xND56mts4w=; b=IpvpOHZfrnRUfbxVwkr0LV1vy7Q0WZektc9FyrBmbv+U8aAXfJCJh6LFl1iR7ncFXSIdU4KWMueDkQlLVcv7iANHbRl+y36yiXsKdrkIzRcBTBmM/vddIrgcPm5Il3CHhrwfFkzD7Pa2qG92Rn4Ef8eo8Jo0MIJgcQW0HciI+LIFcAvlOY0dIpOpKaAM8xpG6ahZJ/1XC2CZLW5oAAaPwXIuJJ4A7QKanny9g4sjVJMG0eoxncOZryXpIzjY4zQSqkHESzkjvrZs1g9uFY72d0PmWDAqN5Wes4KTp+5y/KLHVJxNC7SZ/1wVdtUep9ZvKjKk/eTFDojnreJaxyz/mA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.36) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine 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=R7DbtBQIcZF4LUA2VaUaiDzMK1m8SVbr7xND56mts4w=; b=HSC6t3DjjG9mgnBXB+2Bjgig+PlIHP1yMQJF4jC4r4ZjUXR3I8klb8mB0on624aR5CGGAT0jURl7oqOWJtZ+Kln/b91VITlEchsQMjx82cfehTazSVj8lGhCcYrgUtAH4TITPg7Qgv+S6vbmGL/hrijplX79e6wwmHwycyefcWk8/SpmjJJ/HaOZ/FMO8CajwiA1qir9ip1mnkDbgF9341SC6Y8QJ0JK78YTUXALUo3BDYxhcTv20ZxENqlLQ2Gj5kDAJfoRKfcc6HwebEdC+9EhGqvnji3Kt0f/Cx3JTh/eAwBesQdBarOQVblNKVR0iMkrs8TaWtQV83SXTbaGkA== Received: from MWHPR14CA0007.namprd14.prod.outlook.com (2603:10b6:300:ae::17) by MWHPR12MB1535.namprd12.prod.outlook.com (2603:10b6:301:5::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.19; Wed, 13 Oct 2021 09:48:53 +0000 Received: from CO1NAM11FT064.eop-nam11.prod.protection.outlook.com (2603:10b6:300:ae:cafe::db) by MWHPR14CA0007.outlook.office365.com (2603:10b6:300:ae::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.15 via Frontend Transport; Wed, 13 Oct 2021 09:48:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.36) smtp.mailfrom=nvidia.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.36 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.36; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.36) by CO1NAM11FT064.mail.protection.outlook.com (10.13.175.77) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4608.15 via Frontend Transport; Wed, 13 Oct 2021 09:48:53 +0000 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 13 Oct 2021 09:48:53 +0000 Received: from vdi.nvidia.com (172.20.187.6) by mail.nvidia.com (172.20.187.18) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Wed, 13 Oct 2021 09:48:49 +0000 From: Yishai Hadas To: , , , CC: , , , , , , , , Subject: [PATCH V1 mlx5-next 09/13] net/mlx5: Introduce migration bits and structures Date: Wed, 13 Oct 2021 12:47:03 +0300 Message-ID: <20211013094707.163054-10-yishaih@nvidia.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20211013094707.163054-1-yishaih@nvidia.com> References: <20211013094707.163054-1-yishaih@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d814046d-d7df-4292-3b41-08d98e2eaae9 X-MS-TrafficTypeDiagnostic: MWHPR12MB1535: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mPnb+DhHhupLwgoITXEENL9VhwrT2a+AitWROGVbSKBLjhcwIM9RM+Mrzid8LI4CoKvziN3I56YBxZoq5u5FokpTvPPciPI1EHxkucwtcCbPL9zkuLTLggZ0/iwWP07PicxY87BaLsIisDtOIAqxzr4ASPccWEepuTqYzPX2NDvWKrpEgqJPSUH9/pLwfi6WVqL1bBVk5WhJ9c3W1e1qx2TncBcj0CbQdJFFvl/GYdKYhtifPNC9tfiLrD9RxIpoUGAcHAsbHmsqeJT6jC9ia9CSIkJcaTjq+MclYvMm0xaHUwdsOB51d2sSFqc2gJA3OTiIDGgyQcWq3IQlkhoowosKpYHt0WGnS4d/v//uDgMd5SdIYOYQ5NAVRwkwBvAMZZtPao7CbHHX/TEihWdi9iuJ/xR4tJGWN/tMR0ni/nce2dHivAWj0oGMDbX4ZCB4xKSxJpWOhOI3fxyIwDjPVt90Q3m9GTwIL9MvXTFbn8z4o3392WYgHA4OFp1QTMhjRw7MoBAxca+nsAmK7LstgiCbztUNfJ7tSptilZV/MYKSXhGFr7eHxvymC2OUTFVfg+29i53NM2vVsSJClGmQvV3FYuXATJ30aB4TCA7Nj0/5rIUo+FrGPEB6YqiMNE63PrAES+MtCO0JHzD+V3QRusiBIiQPTg63BIF5R9AyV3widuoruDn5CGhQ0nKw+yg/OA18MceTkVtAaXBGyQYosw== X-Forefront-Antispam-Report: CIP:216.228.112.36;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:schybrid05.nvidia.com;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(2906002)(36756003)(356005)(86362001)(508600001)(7696005)(36860700001)(5660300002)(110136005)(47076005)(316002)(36906005)(54906003)(7636003)(2616005)(4326008)(6666004)(70206006)(70586007)(82310400003)(26005)(426003)(6636002)(8936002)(1076003)(83380400001)(8676002)(186003)(336012)(107886003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2021 09:48:53.5584 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d814046d-d7df-4292-3b41-08d98e2eaae9 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.112.36];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT064.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1535 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 | 145 +++++++++++++++++++++++++++++++++- 1 file changed, 144 insertions(+), 1 deletion(-) diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index 399ea52171fe..f7bad4ccc24f 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h @@ -126,6 +126,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, @@ -1719,7 +1724,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]; @@ -11146,4 +11153,140 @@ 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 reserved_at_40[0x40]; +}; + +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 */