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 BF19AA0C4E; Tue, 2 Nov 2021 10:33:23 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 649984068F; Tue, 2 Nov 2021 10:33:23 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2056.outbound.protection.outlook.com [40.107.243.56]) by mails.dpdk.org (Postfix) with ESMTP id 650BF40689 for ; Tue, 2 Nov 2021 10:33:22 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P7CbB1NpWjZ1vPdP8q8+HMT/K45BZ03oWB3sRM+Wv0Y5P8DjDQMnJh40ij6E5NC+HW+Sh6YebuGmEjjQabdGTuxCcdxxseaSQj7H0ALG+ZPnVOScf6D7PydfKVVaPBePvxHV7SqiHzl0ou+EHLtTgLlmcjlk+T98ounVynvFQ/AvaZMsdujcaSpZWr8uaFIGyzoTEEPa/J2oh3eXqSpG4lZP5d1oaHl24vHDtP2GYLCKhEGOMzwaAqZ8SRWiCjVYTMAY1+I+f5lq5mqUYKfoYZV0Y9bil1uLUWoifqhXpEVYLNRB7W4f0Y/FqTMW53H/DktIzIR5WzTV91i9LRnOPA== 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=PwO0YQgnJSAcZM0VAAyh8QY2Iaiz1sct6EtQBUZA2hk=; b=moQmk7aXG9KscUiJ6n0V57yZdLYPCBe/Juw1uOoP4b6ujPYjKbaexB5w6RPCo7PLbxp1AWF+AsAI5suWNHY/BCU/V93KIOrBIZyl8EzpYhbwauA1awyIB8D6jQP+lXYvWl3NA7O2suDR5ZxblCKK2MD9N6PyUae+3v9GOmJLBXOrqPfNfFOGursm0QNGhYciDYaMViwl6UBR5q2Um4CSWRInBRvIRK9vsQlKtd2JNGyQhdzCHfoA+XGEJmD/8i//sv+ZrEl1twUTSKWy5ZnFPOp+Grz5cOW7yCg1hzNAVjSodx7MPBH1xiWosjiVItc/5R1SlKN8NPa2Cv2lxTzHiQ== 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=PwO0YQgnJSAcZM0VAAyh8QY2Iaiz1sct6EtQBUZA2hk=; b=sKcZoIndx2S0Bkty1aUFQGGvOj2ziwMFgO1I9oE3iBObegP/aVMt1udbThOPUwKY4ZLGQe+9T9ssokY44z2Wc94UoPWVgaNuEby1uKLJFOLFf8seZc9YjwzZ6IkouJBSEmTFqGqfM5bTAdCWmLMWZWvpV5cLWd+xt/qLnNPwMcFe7xUv3z/tTIbSbRTPqymvA6DbNE2wUdN5k48Sf/WjXPD5QqvKt3Ug8j/nmZ1pE+FB/HhRKzS7IC4r6vPQFoqVAbH4AmMTjDrxE++JxjtyL3kdfpQHX+QQY0zTVj6/iBhTWiDhiG9I1uJVkmSKr9xzNawX5Pfwb3dQNSo9uNiECA== Received: from BN6PR16CA0001.namprd16.prod.outlook.com (2603:10b6:404:f5::11) by SA0PR12MB4559.namprd12.prod.outlook.com (2603:10b6:806:9e::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14; Tue, 2 Nov 2021 09:33:20 +0000 Received: from BN8NAM11FT019.eop-nam11.prod.protection.outlook.com (2603:10b6:404:f5:cafe::9b) by BN6PR16CA0001.outlook.office365.com (2603:10b6:404:f5::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15 via Frontend Transport; Tue, 2 Nov 2021 09:33:20 +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 BN8NAM11FT019.mail.protection.outlook.com (10.13.176.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4649.14 via Frontend Transport; Tue, 2 Nov 2021 09:33:19 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 2 Nov 2021 09:33:17 +0000 From: Raja Zidane To: CC: Matan Azrad Date: Tue, 2 Nov 2021 09:32:56 +0000 Message-ID: <20211102093256.35581-1-rzidane@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211101150547.34040-1-rzidane@nvidia.com> References: <20211101150547.34040-1-rzidane@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0c8ee6d9-0dc7-4018-7acc-08d99de3ce71 X-MS-TrafficTypeDiagnostic: SA0PR12MB4559: 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: mKcbthRzsYNAC1/wHr9cFWKBpMRmqkQjZ8lzqL2STYXFh77Dd4Hp7Ijao1IfzqYwcFSwI71M9bUroLm+1lKOMCT712+w8LqEJrGiZQR5BQch1wFX9zUYaghhWJ3+oMpndCK5EMtQP7dUJOYVVSrb/33vD/PaGCgBhg2t/VYQW/2BEyjMQp2P8F3rYrEp/l6GvGHBckMP9Drr1Kg+2Yqs1ozleVxRGUg1p8zjsKr8+gFLYNvbTJWu9BzkMpMP6+GO1BxLqJB6vcvUo9M0mne/6Qq0ZtuCSHOGDmgNxyuUE4C+sgFrvUnLVhCwm6ULlZ6dryouJ7gu5arKTVjOeEvHoa/fc2iC2LJaO4aJNgH4BlnRah57Bz7v0VUUFR8xSzASvGq2mWiflXmEcfmB1OuzQFcJWBpc0dsibXh0rn3734ZyzO69pTJMU1bibVwFuIbMcSydeSB+SnIoVNUMDMCuvDFFS5Dy3jTTVFiD6kWu7lR5muC9z3ORd3lqy6Jilf3aVs6+Mzz/u3KgIK/9nDt6B9C5cert/D9oC/OOyG3ajp6CtYiEfojJRvzLdt9v3nsEpBwIZ9rh1lIpWrGxk4JN4HHrkc1bejokbupAWWJZZq0wrSKQbytJkabVtjeDX3vA/00OBj0x0os6V2KXMUZLZcE2RpquJgWnB0xuawdfqV8tilIIbiq4+Qc19UQphv9Qi11LHgTr5SQA0hRmgCuiIw== 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)(508600001)(36860700001)(16526019)(186003)(55016002)(70586007)(82310400003)(336012)(6666004)(8936002)(6286002)(70206006)(2616005)(426003)(107886003)(7696005)(86362001)(8676002)(47076005)(6916009)(316002)(83380400001)(7636003)(36756003)(5660300002)(356005)(1076003)(4326008)(2906002)(26005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2021 09:33:19.4487 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0c8ee6d9-0dc7-4018-7acc-08d99de3ce71 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: BN8NAM11FT019.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4559 Subject: [dpdk-dev] [PATCH V2] 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. V2: fix doc. Signed-off-by: Raja Zidane Acked-by: Matan Azrad --- doc/guides/cryptodevs/mlx5.rst | 4 ++-- drivers/crypto/mlx5/mlx5_crypto.c | 8 +++++++- examples/l2fwd-crypto/main.c | 5 +++++ lib/cryptodev/rte_cryptodev.h | 1 + 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/doc/guides/cryptodevs/mlx5.rst b/doc/guides/cryptodevs/mlx5.rst index 68bfdf3a83..bb50376b4c 100644 --- a/doc/guides/cryptodevs/mlx5.rst +++ b/doc/guides/cryptodevs/mlx5.rst @@ -147,9 +147,9 @@ 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 and 1MB. In case the `dataunit_len` is not provided in the cipher xform, the OP length is limited to the above - values and 1MB. + values. Prerequisites 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