From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8686BA0552; Tue, 6 Dec 2022 02:17:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 37FF640156; Tue, 6 Dec 2022 02:17:53 +0100 (CET) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2050.outbound.protection.outlook.com [40.107.95.50]) by mails.dpdk.org (Postfix) with ESMTP id DD9C340151 for ; Tue, 6 Dec 2022 02:17:51 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KeZD1iFgi8Z1sk2sb0/spowQ3Qop2WzoiV6ISHepGLTraeIAmUWeWmrz5OCDe1mUZsybMFFjRjzkEPkRDJcU9dQ42ks1ziQc+7n7GtzGaBhuEcsdb0KMXt0XSMJqBs2jcINUapSzVkbbJmwWQy2YNzBCTollQyawb8wgFT3ZaByTK5Ho9pXtI+KN4vI0MbbSYHtjSV2p48MQMopGVD/EmypJDkRq6kWlOsVYMHOgjZC2JyLuuJSNYD2VF0DJeor6LvQwKqia91g6mefDdpgjf+6y9sNMhhQuwnYMJ8o2M7cgphmTPw4WXoQkLhqhS4OLbUFHaeP4RoABDtGzRkljNQ== 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=HhtfcZ9FABtA9UtY5GhEaFSXRg2gH3L/S2FQeWwxYfY=; b=E18Dzms+sXllGv6uRdeyJ43Wi/Z9Uu9brOhtq9o7ilYPLVdcEfkpXy7jNftKJyRFlXB+FWkPrwSh/H89MBKTpXXPyFqmfcx1egW54AwL/uMC1dbbw/vsWdzIk/7bf1sZwKIPaY231kSbbKw/KSahyeYemsz/8fGo0z/9lSbsTN/8unGQYjsqhbYPpgTEQ1sxAGByTq4Ima6aD2yWZsWsmCbhObGSIeT1JkJ9tfNd+xTn7qqcysXaqPsNVbb/rdhpo04OZy9gR68v6SUKXr21aZYwtgolY+48oqaGt/nvOy7Qa9YxogcqysomPDv8JpC3m/bO1OH+xxy5LQ+na8ZbCw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.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=HhtfcZ9FABtA9UtY5GhEaFSXRg2gH3L/S2FQeWwxYfY=; b=p9nywWeljg1goXCdigsFkE9bP3si6WkB7BNdWBuY+/M/hIo7Zi93hh6aivNzuKVsazPM3owQ1gAQ5eQQ4Cj/VYbRAyG7gTow+G3beRA9B1J2dWedMPvH5CTMmhlR2LNf+BNZlJkSq43d0HjWa6hLSuB66LOvYqoIz50IncYm4vl+dRmTF3IjWscXNKPPHnUm3cbpyS4LDPfDdMwCc5HWwd/PS1RQKAo0qmcxBiUCNuo1rse1RXFePCCm6SegU50vEI0LfYSKo8QnlvKazGtq8rLxKjBBvHDLlwQxwZAN2WLas8TJLRBS0moKHKZISjcZbxxG5pGKUMpQafjI0il4sg== Received: from MW3PR05CA0005.namprd05.prod.outlook.com (2603:10b6:303:2b::10) by MN0PR12MB6003.namprd12.prod.outlook.com (2603:10b6:208:37f::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.13; Tue, 6 Dec 2022 01:17:50 +0000 Received: from CO1NAM11FT051.eop-nam11.prod.protection.outlook.com (2603:10b6:303:2b:cafe::d5) by MW3PR05CA0005.outlook.office365.com (2603:10b6:303:2b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.8 via Frontend Transport; Tue, 6 Dec 2022 01:17:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1NAM11FT051.mail.protection.outlook.com (10.13.174.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5901.14 via Frontend Transport; Tue, 6 Dec 2022 01:17:49 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Mon, 5 Dec 2022 17:17:40 -0800 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Mon, 5 Dec 2022 17:17:38 -0800 From: Suanming Mou To: , CC: , Subject: [PATCH] common/mlx5: improve AES-XTS tweek capability check Date: Tue, 6 Dec 2022 03:17:24 +0200 Message-ID: <20221206011724.1644736-1-suanmingm@nvidia.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT051:EE_|MN0PR12MB6003:EE_ X-MS-Office365-Filtering-Correlation-Id: b67d9739-4939-41dc-9198-08dad727b0e0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2FO1TM1uabYkAYb1fwAkAmFyyNTWK+X2OCU/Z0AWXRfbrcrOkLzTTqbTOZkq0KwBoKfxzRZIZPfxhM4TlGoHtFl48KXsd9Sa0PrslDgufeqLH7nPirI32AfLqaGvg/q5WEKML9nI4Dn2WuEygMNHQ84cpyJjpru+F2NGhUP9mEVF/mCC2xgJXeFcWc6SorrfDouaz5TTeu2heq9dkHLYnjYh+Dgmhh+VUebAIyK7Gh0IB8wNonVy555SGsp8TgHOK+8giUU6pJ0Iz4lznJD0x0RRYNB7aemVOCrQk6azTRgctWyIlUCwsAL8saX0LwaSR9tkGActvbRqpHkBpFyLI4lBW3BhU5Sb3DY9YEpsanREk1YELsxfEuYFw91B4ZKVIQKJgY1kCEOcpiB0mKkRCtfpK77BFkW/p8qRBoZJze/8fbqEjmFkSvLR8ktp2qI0No60mfg/EXN8XuFVwZ2lkveH7svUkU5OsghREm4sq52TSc49XwTPMSIVTKDOzuij/oHQS/VX1aOmfRxLeiE9aMElhH4RsRjd4eXio/kbffOzU5Xb3EztijkwPu9lregjdmAmR0C8wqFwDu1vrxVRqkelpIz8bxcUIyaavu/PSomZfF7n0uoQYvLrVUHG0vNLNgO2Lq7dKX1N54ELZxCft10439UHnSJK8dC9WB+0mrOBkPFo+X+HRdduMn4b8AXEAgz/LR1S57BYoJSG0WVJ4A== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230022)(4636009)(39860400002)(136003)(346002)(376002)(396003)(451199015)(46966006)(36840700001)(40470700004)(7636003)(356005)(82740400003)(36756003)(40480700001)(55016003)(40460700003)(86362001)(82310400005)(26005)(6636002)(110136005)(6286002)(54906003)(316002)(6666004)(478600001)(5660300002)(47076005)(7696005)(426003)(8936002)(83380400001)(36860700001)(2906002)(8676002)(4326008)(70206006)(70586007)(1076003)(16526019)(336012)(41300700001)(2616005)(186003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2022 01:17:49.5987 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b67d9739-4939-41dc-9198-08dad727b0e0 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT051.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6003 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Bluefield-3 and above devices use aes_xts_multi_block_be_tweak bit to indicate AES-XTS capability. The devices below use aes_xts_single_block_le_tweak bit. This commit adds the AES-XTS attribute set while one of the bits is set to make the attribute compatible with all the devices. Signed-off-by: Suanming Mou --- drivers/common/mlx5/mlx5_devx_cmds.c | 4 +++- drivers/common/mlx5/mlx5_prm.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c index 59cebb530f..e3a4927d0f 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.c +++ b/drivers/common/mlx5/mlx5_devx_cmds.c @@ -1013,7 +1013,9 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, attr->flow_access_aso_opc_mod = MLX5_GET(cmd_hca_cap, hcattr, flow_access_aso_opc_mod); if (attr->crypto) { - attr->aes_xts = MLX5_GET(cmd_hca_cap, hcattr, aes_xts); + attr->aes_xts = MLX5_GET(cmd_hca_cap, hcattr, aes_xts) || + MLX5_GET(cmd_hca_cap, hcattr, aes_xts_multi_block_be_tweak) || + MLX5_GET(cmd_hca_cap, hcattr, aes_xts_single_block_le_tweak); hcattr = mlx5_devx_get_hca_cap(ctx, in, out, &rc, MLX5_GET_HCA_CAP_OP_MOD_CRYPTO | MLX5_HCA_CAP_OPMOD_GET_CUR); diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h index 2b5c43ee6e..6ec5185a7c 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -1679,7 +1679,9 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 log_min_hairpin_wq_data_sz[0x5]; u8 reserved_at_3e8[0x3]; u8 log_max_vlan_list[0x5]; - u8 reserved_at_3f0[0x3]; + u8 reserved_at_3f0[0x1]; + u8 aes_xts_single_block_le_tweak[1]; + u8 aes_xts_multi_block_be_tweak[1]; u8 log_max_current_mc_list[0x5]; u8 reserved_at_3f8[0x3]; u8 log_max_current_uc_list[0x5]; -- 2.25.1