[v2,0/9] crypto/mlx5: support AES-GCM
Message ID | 20230526031422.913377-1-suanmingm@nvidia.com (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 578AF42BA3; Fri, 26 May 2023 05:15:41 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D0D7540ED9; Fri, 26 May 2023 05:15:40 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2075.outbound.protection.outlook.com [40.107.95.75]) by mails.dpdk.org (Postfix) with ESMTP id 45B6440A87 for <dev@dpdk.org>; Fri, 26 May 2023 05:15:39 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PEQNcDwOlwApg/YtJcpmihQ5mvDyNXvrN1YQi4Lz3kOvwneaFTz6lBNVOEFEC+rXXH01LUtf5S9BVfcXz64wrqobFwchs2y0/zHAOzKbZ06qcSzpi28knXq3x3M2hbScMDU2au7jmcjjSqBEok/tG/KAXSvMaPTYymt37e4HwnLhO88aDCbXnF7ZoR60efxN6kPRx0DikgojwjXdvUN3oHhfAMIz7HBAe6jdBaagIEOlkAFlBIdqea+mLPEr4nlDQ4msU9VHyW9kiXnCqg4xrkfkOJBmq4dDQIGG8QM2Zi8Fqb90fGXM16uAnHpS34p/KX3fxjp76PgyQ4Z60VbjGw== 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=lHqqMLfpLGLh1o/PoFA7Jz5csW+gcgbqALOvoqWL7tg=; b=HRFBtyKnFWypa4ZlKjBctjM7RSgLWWN5MDq0HncJl5puAMOF1LX5sbBUPmSjji7TET+rljhSheO8vnn0VyFfbrhMI8D2zIxnPl2t3nAYAD4mVN+4HGrKqmA4ItWlNF/f1CF4HzIIHeXSiOVCVyOU5BwpcubNisRQxRG+u57LH8qjUHqVkudQ+ICN1VUuaktkB2zH+N0q9dbSfxdNBcs6ZNzLPaZ15PvW2vFy9B2Syw/bf/gidIag/0wUwz1Ys9w5A7hUCwH2NIxIeS+EVN94F4Cd2KP9L0aCBYv1YpkP0efqEVXRIyT1gJga1CV4jPUkzLx29GVtATXZ2cs5/JH3jQ== 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=lHqqMLfpLGLh1o/PoFA7Jz5csW+gcgbqALOvoqWL7tg=; b=GbXfSFt8ln82JZowFDwGLaileOMr5AWuSnrQy5gEAmAJjLx331TsbnM9TpXK9/JT0/+KhTYkjtGricdqUmXYbHbqbfceTntTcWA4WFk2emvki3GXnDi/+ZA70n450FO7DuvoAkEBCsuKXa+7TIR8OIZjhy5kG5MJjK48lrVZfbFIjJXOmEeoSHXgGbASLNAYCBjQrS0gAAtgDeUqZ3psZe18ZIVOOEuYjVPpaM/noBbrHvuyObJ9pioADVhT6ZU1pdgwbcyCvlhKDGlU4Ke0suSTQhC1VjdLcxPcwIj6VaDQWtFImzRgMhp0q+Yv6xhSXc9f0ltzG/yfD6gy7q7UZg== Received: from BN0PR10CA0023.namprd10.prod.outlook.com (2603:10b6:408:143::20) by CH3PR12MB8185.namprd12.prod.outlook.com (2603:10b6:610:123::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.15; Fri, 26 May 2023 03:15:37 +0000 Received: from BN8NAM11FT091.eop-nam11.prod.protection.outlook.com (2603:10b6:408:143:cafe::ca) by BN0PR10CA0023.outlook.office365.com (2603:10b6:408:143::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.17 via Frontend Transport; Fri, 26 May 2023 03:15:37 +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 BN8NAM11FT091.mail.protection.outlook.com (10.13.176.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.18 via Frontend Transport; Fri, 26 May 2023 03:15:36 +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.5; Thu, 25 May 2023 20:15:19 -0700 Received: from nvidia.com (10.126.231.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.37; Thu, 25 May 2023 20:15:17 -0700 From: Suanming Mou <suanmingm@nvidia.com> To: CC: <dev@dpdk.org>, <rasland@nvidia.com> Subject: [PATCH v2 0/9] crypto/mlx5: support AES-GCM Date: Fri, 26 May 2023 06:14:12 +0300 Message-ID: <20230526031422.913377-1-suanmingm@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230418092325.2578712-1-suanmingm@nvidia.com> References: <20230418092325.2578712-1-suanmingm@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.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: BN8NAM11FT091:EE_|CH3PR12MB8185:EE_ X-MS-Office365-Filtering-Correlation-Id: 17500a27-a035-4980-393b-08db5d9779e0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YU0WEAAQadxZ3SfRtDtREeTb2U9cvkgY5PCG5gMc4KVWmc3PqnMnGkDt3s3URfD1TGX1KkJeYOR0SjWlNUbbRSRGYmO+K23TpXUdpLZ/t6y8+5ehsVNKp9Oz2yMED5RtdxP9HN0ygF11U9OOxg8Z2z11iaDkfRWagxDhq+LeUw92+z65Pdy4vehMg8whGcEJDAkah/lnfO+sOxgT5vifxQJizvpiAZNchcFTD2JBWt+mm55QI+BD0dquNA/n651L6jpQRcrjBkmiaPC34rU9UqpZSfecpsFSqE9XR4s1yr+a9bIK7MKkbGuU9WuQ/uOq/p9U8fzXoFl/jQKazd04r8kNsAfdL0T3fjibD3LqFyWbg2Tq0UBqt4j9hJCAcH+03dJZdsY8iRfWjg3uiTcc2Ln8tkx7VPE15L5hpH9r2/UGnE36FusTBtM6bVMzYR6diy6m+tPeJNn2QvjrABHxRWejVDRAnyycNDeHGQ6u2BlmAJyq+uke9B7e0ZM5BNrGtuntTEAeCQ9w4biO0UJssNNXwHNtulrFwQbp3ksbNhEIb/hqnXfbz/WnOE7PVxcvKMsaHQphfFd4ZftDrZwHLQdWQmt1jVMyVMdqqkZ8yiVCNvfqLXE2BBUPb1okQGbB7HbMDinXirDOkXxGwK/ZZyyR9FWOj0t/nSRUkjbd1jKD9bytKfkRmkZYahiCYpeBGA87Vx83YEdS13RjXIyjhcEAKQaEX9vSrKAhecuvOb5mMw5+BDvMzrfx6hD9rFwWthlTlEwEvP02/C6rw0zZDA== 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:(13230028)(4636009)(376002)(39860400002)(346002)(136003)(396003)(451199021)(109986019)(46966006)(40470700004)(36840700001)(40460700003)(5660300002)(8676002)(8936002)(16526019)(186003)(6286002)(47076005)(36860700001)(2906002)(36756003)(86362001)(83380400001)(336012)(426003)(2616005)(82310400005)(356005)(82740400003)(40480700001)(7636003)(55016003)(1076003)(26005)(316002)(4326008)(107886003)(70586007)(70206006)(6666004)(54906003)(478600001)(7696005)(41300700001)(266003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2023 03:15:36.7364 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 17500a27-a035-4980-393b-08db5d9779e0 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: BN8NAM11FT091.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8185 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org |
Message
Suanming Mou
May 26, 2023, 3:14 a.m. UTC
AES-GCM provides both authenticated encryption and the ability to check the integrity and authentication of additional authenticated data (AAD) that is sent in the clear. The crypto operations are performed with crypto WQE. If the input buffers(AAD, mbuf, digest) are not contiguous and there is no enough headroom or tailroom for AAD or digest, as the requirement from FW, an UMR WQE is needed to generate contiguous address space for crypto WQE. The UMR WQE and crypto WQE are handled in two different QPs. The QP for UMR operation contains two types of WQE, UMR and SEND_EN WQE. The WQEs are built dynamically according to the crypto operation buffer address. Crypto operation with non-contiguous buffers will have its own UMR WQE, while the operation with contiguous buffers doesn't need the UMR WQE. Once the all the operations WQE in the enqueue burst built finishes, if any UMR WQEs are built, additional SEND_EN WQE will be as the final WQE of the burst in the UMR QP. The purpose of that SEND_EN WQE is to trigger the crypto QP processing with the UMR ready input memory address space buffers. The QP for crypto operations contains only the crypto WQE and the QP WQEs are built as fixed in QP setup. The QP processing is triggered by doorbell ring or the SEND_EN WQE from UMR QP. Suanming Mou (9): common/mlx5: export memory region lookup by address crypto/mlx5: split AES-XTS crypto/mlx5: add AES-GCM query and initialization crypto/mlx5: add AES-GCM encryption key crypto/mlx5: add AES-GCM session configure common/mlx5: add WQE-based QP synchronous basics crypto/mlx5: add queue pair setup for GCM crypto/mlx5: add enqueue and dequeue operations crypto/mlx5: enable AES-GCM capability doc/guides/cryptodevs/mlx5.rst | 48 +- doc/guides/rel_notes/release_23_07.rst | 1 + drivers/common/mlx5/mlx5_common_mr.c | 2 +- drivers/common/mlx5/mlx5_common_mr.h | 5 + drivers/common/mlx5/mlx5_devx_cmds.c | 21 + drivers/common/mlx5/mlx5_devx_cmds.h | 16 + drivers/common/mlx5/mlx5_prm.h | 65 +- drivers/common/mlx5/version.map | 3 + drivers/crypto/mlx5/meson.build | 2 + drivers/crypto/mlx5/mlx5_crypto.c | 673 ++--------------- drivers/crypto/mlx5/mlx5_crypto.h | 101 ++- drivers/crypto/mlx5/mlx5_crypto_dek.c | 102 ++- drivers/crypto/mlx5/mlx5_crypto_gcm.c | 995 +++++++++++++++++++++++++ drivers/crypto/mlx5/mlx5_crypto_xts.c | 645 ++++++++++++++++ 14 files changed, 2014 insertions(+), 665 deletions(-) create mode 100644 drivers/crypto/mlx5/mlx5_crypto_gcm.c create mode 100644 drivers/crypto/mlx5/mlx5_crypto_xts.c