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 01520A0C57; Mon, 1 Nov 2021 16:06:13 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 82E6640E28; Mon, 1 Nov 2021 16:06:13 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2065.outbound.protection.outlook.com [40.107.244.65]) by mails.dpdk.org (Postfix) with ESMTP id 9049540DF6 for ; Mon, 1 Nov 2021 16:06:12 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U/WHtZmH3mK01IJvGx4A2elFOpylywM0jNptKWlrtKMIu/0nM9jGAXbXmgXyjZIx1CfXz6HZ0WhysOdz4o7eaRexoJEt8j/wEcIBUEuPBnPdUVgk4H6PtnIS2b1QyVM119JzcbYdbP98cWQMxP6dHb4eHdGkpSUpGMTPppStoexPXEPTrMLvfypDIsTDvx7Ahfdt6QR/XzLQcHLNkGuKQTP9jGWt5ocaaF6I0VehNOd4Foey/hnIoFDtpfKojDH9yUvec6x6G4iNUDQZMd3nMDrGBE0snoGgK+feOdau6O3db9HPBRpjDt8zGYYop8UcUStFbBZP2coHUm9OvE+DdQ== 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=elFmpqP1FA5sp7EPXaDOfRuf8ozfw3g8qpRZEfZd3Ek=; b=lrnziLwz0n3RCaBvdMp/WJ1o1s9rP5Qq3BOCOALW66zdsvXvFj6Mu00Bfevwi4H0InmAYwzKXELhhKkiwBBua3zAbSkowdO76iq62qfEgVn2oDcJZM213gVDXCuZ1ouT4PP8rw0dEdESs8a1kFDBClZFmvrhdqsBWnuSAJV9PatbjhA8Z/YZ/qQNxe1OOSfdbs3SUex54rJ28mUdGC/5aPBzBn1NhnGXNE6BYzf0CU4zk1KiHNYtDaNMQR1RZ+3EXbomJHGzFR3Zg7wiahFBd4gizyKUXPn7N0lN8M3Qlu7gH5VG4HKt8cAfJBINW6KRO2EHUiyD7vPuY0KAPBJoTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.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=elFmpqP1FA5sp7EPXaDOfRuf8ozfw3g8qpRZEfZd3Ek=; b=YSjhyLEy42yqafTheor96PvCkf6e9wwJcYvjR6nZ6HKedtrh+nPoK5JLBtrMRE8HYgjzOwg7OmCKgk0mpccjNK3v9UUoRUptuDBvxe1Rqm8ECcavV2IOJj/S4NLqJqB8gRFeWoSUbwB2tnSzxlnyPG8xWTbOqSFX/7Ob3pMnc0Bo8BqmzlJ1gZ5BDRdoA8CN0Cbth+IIzyVrDMYQ6KlSYMqVifSJ3iTTE03b2E0d3cwKlEW9/ptRLGcG+Fg5NzhXwj0Wr44uUsBhEEbnQQEI5ZTOAhAqrlbkq2pmel/jbmzaFtivFfd1osEtm6r+teFE/6/0zEn88deR3WJZJFq2uQ== Received: from BN8PR04CA0042.namprd04.prod.outlook.com (2603:10b6:408:d4::16) by MWHPR1201MB0191.namprd12.prod.outlook.com (2603:10b6:301:56::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14; Mon, 1 Nov 2021 15:06:08 +0000 Received: from BN8NAM11FT014.eop-nam11.prod.protection.outlook.com (2603:10b6:408:d4:cafe::d6) by BN8PR04CA0042.outlook.office365.com (2603:10b6:408:d4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.18 via Frontend Transport; Mon, 1 Nov 2021 15:06:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT014.mail.protection.outlook.com (10.13.177.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4649.14 via Frontend Transport; Mon, 1 Nov 2021 15:06:08 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 1 Nov 2021 15:06:01 +0000 From: Raja Zidane To: CC: Matan Azrad Date: Mon, 1 Nov 2021 15:05:47 +0000 Message-ID: <20211101150547.34040-1-rzidane@nvidia.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7f8342a5-2e15-422a-b0b2-08d99d492253 X-MS-TrafficTypeDiagnostic: MWHPR1201MB0191: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cHN8NGT9zdHAslbslytx6ALhdHVHLENUJEO7CdDt3KsDa+bsPCkWpDoRdxrPSB+qH8tOTZ1sxOqY9aVEfuO9K0cBivfpOwwpFe9HgqL4d9BYxr7cbHSoC7LUhtjJMaF4IE7gKLg0lK8Qpei11FsL9VSPa/8qdzLXulZ3+QiqfN9993iIgYZ99L3YSQYvZRHRD4cAnjtEcgATI0g6bFEmt8ri4cisi5a7gjcLeaOl9Lgrnei27HrJ/nWtdgRRVChdoszVANTwZaSHYvigFzDchjV9XgshEE8EJ+bPxyiX2H0WFMH/rlWZoZleon61WsCC6gpRkpqWHmsgcquA7/a5cDLv7J3KVrVAVobxJeiDRVN9nup6Gj4cDvBtuCGi0zQVLDCKsmdsFUCaOUguCQeU68qCmfx3HUwJ3w8/x7rDKHS1lf3K/KwMs2PctBRWk8bC3QvTCW+sNJx2/bAOXRDYpYpJ//XF8JXOnVjRtHqtTBClxL/8rda1eUJ77Fs7ueTR8a7mmcmkbvwZK0SimPIexcFvgGQlYg/3oLBKIV7tTk5HDM0lvoGZDJwZJi+BqTLd88dGVIJmwvb0gbSFcTo0u7mUFZJPQgefHIA9na7HKZw6+AVs2R1Rp60zw47xf2I+1df62Qnp7L+jsuiy4TxSqSULq9nC6/L0tSnJXpME8FwfkG+tFXn0olfkKYu0ois9g2sIGb7180CKuD+R5lkBYA== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(16526019)(6666004)(26005)(4326008)(36860700001)(356005)(36756003)(5660300002)(86362001)(186003)(6286002)(82310400003)(7636003)(508600001)(70206006)(6916009)(1076003)(83380400001)(2906002)(8676002)(8936002)(426003)(107886003)(7696005)(2616005)(336012)(36906005)(316002)(70586007)(55016002)(47076005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2021 15:06:08.1910 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7f8342a5-2e15-422a-b0b2-08d99d492253 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.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT014.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB0191 Subject: [dpdk-dev] [PATCH] crypto/mlx5: support 1MB data-unit 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 Sender: "dev" Add 1MB data-unit length to the capability's bitmap. Handle 1MB data-unit length in the mlx5 session create operation, and expose its capability in the mlx5 capabilities. Signed-off-by: Raja Zidane Acked-by: Matan Azrad --- doc/guides/cryptodevs/mlx5.rst | 2 +- drivers/crypto/mlx5/mlx5_crypto.c | 8 +++++++- examples/l2fwd-crypto/main.c | 5 +++++ lib/cryptodev/rte_cryptodev.h | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/doc/guides/cryptodevs/mlx5.rst b/doc/guides/cryptodevs/mlx5.rst index 68bfdf3a83..bc6ae82d40 100644 --- a/doc/guides/cryptodevs/mlx5.rst +++ b/doc/guides/cryptodevs/mlx5.rst @@ -147,7 +147,7 @@ Limitations ----------- - AES-XTS keys provided in xform must include keytag and should be wrapped. -- The supported data-unit lengths are 512B and 1KB. In case the `dataunit_len` +- The supported data-unit lengths are 512B and 4KB. In case the `dataunit_len` is not provided in the cipher xform, the OP length is limited to the above values and 1MB. diff --git a/drivers/crypto/mlx5/mlx5_crypto.c b/drivers/crypto/mlx5/mlx5_crypto.c index f430d8cde0..c3a9d2d8f7 100644 --- a/drivers/crypto/mlx5/mlx5_crypto.c +++ b/drivers/crypto/mlx5/mlx5_crypto.c @@ -59,7 +59,8 @@ const struct rte_cryptodev_capabilities mlx5_crypto_caps[] = { }, .dataunit_set = RTE_CRYPTO_CIPHER_DATA_UNIT_LEN_512_BYTES | - RTE_CRYPTO_CIPHER_DATA_UNIT_LEN_4096_BYTES, + RTE_CRYPTO_CIPHER_DATA_UNIT_LEN_4096_BYTES | + RTE_CRYPTO_CIPHER_DATA_UNIT_LEN_1_MEGABYTES, }, } }, } }, @@ -221,6 +222,11 @@ mlx5_crypto_sym_session_configure(struct rte_cryptodev *dev, ((uint32_t)MLX5_BLOCK_SIZE_4096B << MLX5_BLOCK_SIZE_OFFSET); break; + case 1048576: + sess_private_data->bsp_res = rte_cpu_to_be_32 + ((uint32_t)MLX5_BLOCK_SIZE_1MB << + MLX5_BLOCK_SIZE_OFFSET); + break; default: DRV_LOG(ERR, "Cipher data unit length is not supported."); return -ENOTSUP; diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c index 04a3bdace2..4d9f8861af 100644 --- a/examples/l2fwd-crypto/main.c +++ b/examples/l2fwd-crypto/main.c @@ -2218,6 +2218,11 @@ check_capabilities(struct l2fwd_crypto_options *options, uint8_t cdev_id) RTE_CRYPTO_CIPHER_DATA_UNIT_LEN_4096_BYTES)) ret = -1; break; + case 1048576: + if (!(cap->sym.cipher.dataunit_set & + RTE_CRYPTO_CIPHER_DATA_UNIT_LEN_1_MEGABYTES)) + ret = -1; + break; default: ret = -1; } diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h index 56e3868ada..59ea5a54df 100644 --- a/lib/cryptodev/rte_cryptodev.h +++ b/lib/cryptodev/rte_cryptodev.h @@ -102,6 +102,7 @@ struct rte_crypto_param_range { */ #define RTE_CRYPTO_CIPHER_DATA_UNIT_LEN_512_BYTES RTE_BIT32(0) #define RTE_CRYPTO_CIPHER_DATA_UNIT_LEN_4096_BYTES RTE_BIT32(1) +#define RTE_CRYPTO_CIPHER_DATA_UNIT_LEN_1_MEGABYTES RTE_BIT32(2) /** * Symmetric Crypto Capability -- 2.17.1