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 9471342CFF; Tue, 20 Jun 2023 03:24:09 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8305F4068E; Tue, 20 Jun 2023 03:24:09 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2062.outbound.protection.outlook.com [40.107.244.62]) by mails.dpdk.org (Postfix) with ESMTP id 30B3D400D6 for ; Tue, 20 Jun 2023 03:24:08 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iXdwKpPpLeOAHRo5PrQsGh6FVyKMlT9L84OalF9Pyn5I68sJEJDTFF2Rbo5dIvKjLE+8xlYf8t4FUQgHViZQEB8BYX8cifXAM+viM5+lgcgkhXIySZT3BSxNZO32CVtaYV3ivAE6Nf2qrsIr+/8XG5OoPQXgnwvqqqZC01wbqRmrgQhRAwOYFyFgrYmx+3gKnaAnyVvWSxPWuWtmScBANe6ec+5621x4ecJg2mDF6G8TM/oRAY9i57InMcRnqYs9zTZoqUpD3F8tyWcsBC4+znWHPMXjCDGC9w4lz5+smYk4KDEO/y/bEI2kv9wqMPS4C6iId+7B1ggl45N99LX6sw== 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=leFyN45RmOB4V6oZgchzL4riiDDukla41MCo/Q3/hms=; b=SWLpZSAn5iRm7hIFkxMJSDOjYUAdLlATMN0vVeVMq3orwmBZ/DsvZq3tqN5FGIHca20Pvn3qnsAo5lkNqU3BwTFgu4scTZ1H++PdtUOBNWaeqzd9Q90c9sfJxft1F7CjT6sZZtjR4GcwXWDwPkswIPyvjDPB8hE6P9mmdvWSj7sqWfaVaDRR241bllnhm6CZSW3LAHsWZm+cn5/OfI9gRrMSg7dxzyy/bVvFxI9ZeIgQyUcgfpLrLcy2AtttIzhyrrP2RFX7pD8WkoA2R5NPtWT1Pb6gq363hGkEi9ee29rliVsLfQ2RWiSFWw94y7BPhgAujeFNuQtCW4N/QZN+EQ== 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=leFyN45RmOB4V6oZgchzL4riiDDukla41MCo/Q3/hms=; b=CLDK4i1Ovo1zmWfn/wztvya3gWZlfjlkl8ActaPO+0bmK0X6hYJd5IPtFNGGAsDjH/fF4dyTtjZd53OtJETQ44jMXyaUG6hYLz2TQK6kseHjpiKpV/sh2P4hjYWW5zDy4LCXQc46/l4NZACaZEEtgxeIlUyGhIahewnheJ/YYSFKOxI0M6Dc2z9Nk0GN1VWZ08I8JsUk4rAioyxkdcYzfCfKPQmviMRBct+jUl/0EADuCkPnOQ8EGmDYQVNnwuI7SM8opVKiYtvYO0MIi7x4/qnKC1Bw0Mw2qtP2MOEPgRFWdFOmc/sOnw8tZqwOZrU0I4yv/ZaDcjnYBFAROpZfcQ== Received: from CY8PR12CA0043.namprd12.prod.outlook.com (2603:10b6:930:49::25) by BL3PR12MB6570.namprd12.prod.outlook.com (2603:10b6:208:38d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37; Tue, 20 Jun 2023 01:24:06 +0000 Received: from CY4PEPF0000E9CE.namprd03.prod.outlook.com (2603:10b6:930:49:cafe::41) by CY8PR12CA0043.outlook.office365.com (2603:10b6:930:49::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37 via Frontend Transport; Tue, 20 Jun 2023 01:24:05 +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 CY4PEPF0000E9CE.mail.protection.outlook.com (10.167.241.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.20 via Frontend Transport; Tue, 20 Jun 2023 01:24:05 +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; Mon, 19 Jun 2023 18:23:59 -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; Mon, 19 Jun 2023 18:23:56 -0700 From: Suanming Mou To: CC: , , Subject: [PATCH v2 0/9] crypto/mlx5: support AES-GCM Date: Tue, 20 Jun 2023 04:23:13 +0300 Message-ID: <20230620012322.788099-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: CY4PEPF0000E9CE:EE_|BL3PR12MB6570:EE_ X-MS-Office365-Filtering-Correlation-Id: 6c745572-4ed2-433f-96ff-08db712d09c7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VKm5ONZ+LA/ApBneXfKcj71VqQAkyanlD0T5Ri1/x9Uw0aZ8Y9hHCCrWSGz/wW3UbDp91XHKAWR0rfbY+4NMBcMzf61Kp4WJZ+RLNXxZuwZ5uNDcqqDMKvw7OESJmqWGfNFI6TiB8o9QMQ9d/ylaGzCvmc56JIdWzWD3gh0g6Qj46r5ZwbBUx7IxQg3Mv01coy2pqj4IHnlax27GKJ0ial9jZjyyWsPLAZKnUuPtHgjjuzls6ybO0QeBlAsA87/q6kIWyl7YnfSaGkFAZSVpuI+g1DE4dka3w4OVYYyWv1DpQOwQZLYAuvF3rOOLe2d5lOJdXOUKK8FUVNs4BCp3UGWBg5sbz5NFhs7uvZeYvPYE+ycQaSr+/VjW55V5gUX4R8ueafcdGN/z25qIntPpt/7xjJj3K0OqLK+JkWEtQPzDhoUzgq+1F7ezIjeMQOmtlUtL4z45fQVJA3JPDdlcQEHiEW47+pnVz1eJVsj3QM+m87CRhIZ3qGJIS4YQhKrRhZKoI3aRAqDrVyxZKuCgPJsDo+geSNsb8D/1RWvvo476Ma2h+TjuQyKD4M4GGFOnQzbDJZNpiQNIvWrl5AWK4YfevF82msme4QvYqLJ5YabVALUgFtxciTGXxPa91l4ksk0STZfNIj3RxRGB5M+yxORiTrVCKb5VyVHZguFtBNlTzol7SC/vsmhMVm3rdszLltzevys62ebF3N5+5QFWNHjjxB49dBp2e6il1/8J5oIADAb+06ELZAqpU2F0AOqQrRwhmbCabDO3+eCRpLsoWA== 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)(6666004)(7696005)(478600001)(36860700001)(83380400001)(16526019)(6286002)(1076003)(26005)(186003)(47076005)(336012)(426003)(2616005)(36756003)(82310400005)(86362001)(82740400003)(356005)(7636003)(55016003)(40480700001)(70586007)(70206006)(4326008)(41300700001)(316002)(2906002)(5660300002)(8936002)(8676002)(54906003)(266003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2023 01:24:05.3505 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6c745572-4ed2-433f-96ff-08db712d09c7 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: CY4PEPF0000E9CE.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR12MB6570 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 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. v2: - split XTS and GCM code to different file. - add headroom and tailroom optimize. v3: - fix AES-GCM 128b key creation. 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 | 997 +++++++++++++++++++++++++ drivers/crypto/mlx5/mlx5_crypto_xts.c | 645 ++++++++++++++++ 14 files changed, 2016 insertions(+), 665 deletions(-) create mode 100644 drivers/crypto/mlx5/mlx5_crypto_gcm.c create mode 100644 drivers/crypto/mlx5/mlx5_crypto_xts.c -- 2.25.1