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 58B7CA0C4B; Mon, 4 Oct 2021 08:37:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EE673412B8; Mon, 4 Oct 2021 08:37:07 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2043.outbound.protection.outlook.com [40.107.220.43]) by mails.dpdk.org (Postfix) with ESMTP id 962A2412B6 for ; Mon, 4 Oct 2021 08:37:06 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MJ7/bh6Bo/9DJdyf8ilJwNO+nCOu/2yP2U2dx7Kn8tozcd/pTbEVEWraRL5EfxQNgdV0peEn7WRKu3npl1+Fez6xXtuo0lYCNcm23WLrgxw10zq/PAasM+UVJfk0sLtGIsbSMCO4isZ4XNOzaAVkEKw+wHAxVLQ4nYunJJEwiUcj4oIe6ixGAQZhky6ETZFhZnxjdzNqyz5rpGtVxvVoeKjrNLYzS3RYgSLgJvS+SH5srBX5qVSV6UsAp8jfF88WQB+Va1w1J3FfTbmEoU8JMATtiKbi3p5RH9JYh/Y/+0R/VTU94u2d6dtAPTTtjB/lg4qMocqWche5KEUrqCR9ag== 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=jDe55W6PIXfDm1laJHklOw3OAQnfc7TGwY3hUAyQCbc=; b=f3uVDxnIkfLufYBOzlpKA6W4hfmYs0Vd56sK+JOSGIM3dhWjzsQxnUC0eJBhiXGbsmqAhK9MNamQT9lMMAQaX+zWO8L04YNn9kZU0ORDuK+oVZNitlqoZuGEeWp2jvQjsWEC8DpBJtUS99xxlMzb9surHucXhVIPvEncvDbdSqnxO2f+NoUKc2K3yn4nhfD01g0eiCyX88Pv5cHQQ/L/whdS6qu1BXK4cZ8xM05hUnTxICpnMOqaihavJyEVk4o9jEQrkLu0TBrxVUUcdkUP58A8KzmOAWrMEwq5y+IlpFE9w7atNKYB1zKk9GB4NyIhyO9vsFZ8SmxPvfDUM0418w== 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=none 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=jDe55W6PIXfDm1laJHklOw3OAQnfc7TGwY3hUAyQCbc=; b=OZkNOp5uhX6Q5EyNTKXpis/bafgp9Br7ImLh6hqXDau87DFrtepofa8C9bAsS3ZfhzWlObWoGpYnaUi3z7WzWnTrN1FrWNNFElJCfqvaPc+aphOd3+6XOElA1IBVPoLGs5dHzZVKn4zqIZ4hiStx9pcJej+GDW4BGOj1sNwSkpyIChAARM7VbNnFfXfPdZ/sb9nBfz/PtgzIFSI8S8cbqXcRPrm6R4MUqPv37ANqI96xoU9jag1Mm0KHq9vcde+wIlTJ+MStfE7fS3+q3/2V+mwsiUg5mxjpOx1IZm9T4qFg5ASfPJOtm0DSbbrbsIxz9mQ+1myMMI1f5CY7RaiPRQ== Received: from DM6PR07CA0074.namprd07.prod.outlook.com (2603:10b6:5:337::7) by CH2PR12MB4892.namprd12.prod.outlook.com (2603:10b6:610:65::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.19; Mon, 4 Oct 2021 06:37:04 +0000 Received: from DM6NAM11FT024.eop-nam11.prod.protection.outlook.com (2603:10b6:5:337:cafe::fa) by DM6PR07CA0074.outlook.office365.com (2603:10b6:5:337::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14 via Frontend Transport; Mon, 4 Oct 2021 06:37:04 +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 DM6NAM11FT024.mail.protection.outlook.com (10.13.172.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4566.14 via Frontend Transport; Mon, 4 Oct 2021 06:37:03 +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, 4 Oct 2021 06:37:01 +0000 From: Matan Azrad To: Akhil Goyal , Declan Doherty CC: , Thomas Monjalon Date: Mon, 4 Oct 2021 09:36:38 +0300 Message-ID: <20211004063638.1977857-1-matan@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: [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: f010b4d3-645a-49c7-dfc3-08d9870160bd X-MS-TrafficTypeDiagnostic: CH2PR12MB4892: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iaL3bxOF8YnHaANRWdvouVG3tk5rZAPF3Vux04p9OGQ+zlVs8HK6PQsdUN6m7lHSrdUvqKAx7RIacgSBhUSxoM6kmR5ON0xXo2UwRmAllxbBYjDv742aSMUEhjDPpfVv9i4ToR5kAcZEe80JO/XyKiKV195sNrx+iXjltMDzIGP6Ruz+GE/f4mhXIUI6ahXHz82JIlEht8jnbcV3sl+5Zl7mGqH1il9JtB752PXLbeAFMZSYdrr8ZGx4YxIJ+OAoUlyH/0wOrpVjRNJmgysDmOiwYC/C4xlIw+VmvzBC3RihJTlgJJYn0bQMit27yRq4d1UOS5aw5kBKfl6WFns77++eb1pgi8EqTUzYNznIKRo/MG/nDuVjgaSRmXapbBtiZ6JQnztitcbdmDn7DRAQ0vaidyHzRXPCY03aSusg6bopy7BWbvHXvhq6p4XFzbYHZm5b2zMvBiHI+QmfuL5ma36x2XG2DkBGqBhSpXOtBHb9OsB4EeBUinMeVUxmymv6a/OFKE6BM/rE+WnOUeUDqxQEMaj0r8QBGKRDokACivFmQSHvtzj0yhPRP4o1rhOZhDn9h5BHZDSYcHGllJdaUpq7rPm4OfE309xUP3BCqNzWJS+9XsFhMW4argYsZy1iJRrmqObyzdv6IX+AE41blpi+Va1fA49pFZnxTlF6g/FwQM7pdruD82eY6Jo0mkQbs7Mx+xcxPFSLcZ1Mfm3qgA== 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)(36840700001)(46966006)(82310400003)(55016002)(8676002)(83380400001)(8936002)(6666004)(86362001)(6286002)(5660300002)(36756003)(36860700001)(1076003)(70586007)(4326008)(70206006)(26005)(336012)(508600001)(47076005)(54906003)(7696005)(2906002)(2616005)(426003)(110136005)(7636003)(16526019)(186003)(316002)(356005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2021 06:37:03.6289 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f010b4d3-645a-49c7-dfc3-08d9870160bd 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: DM6NAM11FT024.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4892 Subject: [dpdk-dev] [PATCH] cryptodev: extend data-unit length field 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" As described in [1] and as announced in [2], The field ``dataunit_len`` of the ``struct rte_crypto_cipher_xform`` moved to the end of the structure and extended to ``uint32_t``. In this way, sizes bigger than 64K bytes can be supported for data-unit lengths. [1] commit d014dddb2d69 ("cryptodev: support multiple cipher data-units") [2] commit 9a5c09211b3a ("doc: announce extension of crypto data-unit length") Signed-off-by: Matan Azrad --- app/test/test_cryptodev_blockcipher.h | 2 +- doc/guides/rel_notes/deprecation.rst | 4 --- doc/guides/rel_notes/release_21_11.rst | 3 +++ examples/l2fwd-crypto/main.c | 6 ++--- lib/cryptodev/rte_crypto_sym.h | 36 +++++++++----------------- 5 files changed, 19 insertions(+), 32 deletions(-) diff --git a/app/test/test_cryptodev_blockcipher.h b/app/test/test_cryptodev_blockcipher.h index dcaa08ae22..84f5d57787 100644 --- a/app/test/test_cryptodev_blockcipher.h +++ b/app/test/test_cryptodev_blockcipher.h @@ -97,7 +97,7 @@ struct blockcipher_test_data { unsigned int cipher_offset; unsigned int auth_offset; - uint16_t xts_dataunit_len; + uint32_t xts_dataunit_len; bool wrapped_key; }; diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index 05fc2fdee7..8b54088a39 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -202,10 +202,6 @@ Deprecation Notices * cryptodev: ``min`` and ``max`` fields of ``rte_crypto_param_range`` structure will be renamed in DPDK 21.11 to avoid conflict with Windows Sockets headers. -* cryptodev: The field ``dataunit_len`` of the ``struct rte_crypto_cipher_xform`` - has a limited size ``uint16_t``. - It will be moved and extended as ``uint32_t`` in DPDK 21.11. - * cryptodev: The structure ``rte_crypto_sym_vec`` would be updated to add ``dest_sgl`` to support out of place processing. This field will be null for inplace processing. diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst index 37dc1a7786..4a9d1dedd8 100644 --- a/doc/guides/rel_notes/release_21_11.rst +++ b/doc/guides/rel_notes/release_21_11.rst @@ -190,6 +190,9 @@ ABI Changes Use fixed width quotes for ``function_names`` or ``struct_names``. Use the past tense. +* cryptodev: The field ``dataunit_len`` of the ``struct rte_crypto_cipher_xform`` + moved to the end of the structure and extended to ``uint32_t``. + This section is a comment. Do not overwrite or remove it. Also, make sure to start the actual text at the margin. ======================================================= diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c index 66d1491bf7..78844cee18 100644 --- a/examples/l2fwd-crypto/main.c +++ b/examples/l2fwd-crypto/main.c @@ -182,7 +182,7 @@ struct l2fwd_crypto_params { unsigned digest_length; unsigned block_size; - uint16_t cipher_dataunit_len; + uint32_t cipher_dataunit_len; struct l2fwd_iv cipher_iv; struct l2fwd_iv auth_iv; @@ -1269,9 +1269,9 @@ l2fwd_crypto_parse_args_long_options(struct l2fwd_crypto_options *options, else if (strcmp(lgopts[option_index].name, "cipher_dataunit_len") == 0) { retval = parse_size(&val, optarg); - if (retval == 0 && val >= 0 && val <= UINT16_MAX) { + if (retval == 0 && val >= 0) { options->cipher_xform.cipher.dataunit_len = - (uint16_t)val; + (uint32_t)val; return 0; } else return -1; diff --git a/lib/cryptodev/rte_crypto_sym.h b/lib/cryptodev/rte_crypto_sym.h index 58c0724743..1106ad6201 100644 --- a/lib/cryptodev/rte_crypto_sym.h +++ b/lib/cryptodev/rte_crypto_sym.h @@ -195,9 +195,6 @@ struct rte_crypto_cipher_xform { enum rte_crypto_cipher_algorithm algo; /**< Cipher algorithm */ - RTE_STD_C11 - union { /* temporary anonymous union for ABI compatibility */ - struct { const uint8_t *data; /**< pointer to key data */ uint16_t length; /**< key length in bytes */ @@ -233,27 +230,6 @@ struct rte_crypto_cipher_xform { * - Each key can be either 128 bits (16 bytes) or 256 bits (32 bytes). * - Both keys must have the same size. **/ - - RTE_STD_C11 - struct { /* temporary anonymous struct for ABI compatibility */ - const uint8_t *_key_data; /* reserved for key.data union */ - uint16_t _key_length; /* reserved for key.length union */ - /* next field can fill the padding hole */ - - uint16_t dataunit_len; - /**< When RTE_CRYPTODEV_FF_CIPHER_MULTIPLE_DATA_UNITS is enabled, - * this is the data-unit length of the algorithm, - * otherwise or when the value is 0, use the operation length. - * The value should be in the range defined by the dataunit_set field - * in the cipher capability. - * - * - For AES-XTS it is the size of data-unit, from IEEE Std 1619-2007. - * For-each data-unit in the operation, the tweak (IV) value is - * assigned consecutively starting from the operation assigned IV. - */ - - }; }; /* temporary struct nested in union for ABI compatibility */ - struct { uint16_t offset; /**< Starting point for Initialisation Vector or Counter, @@ -297,6 +273,18 @@ struct rte_crypto_cipher_xform { * which can be in the range 7 to 13 inclusive. */ } iv; /**< Initialisation vector parameters */ + + uint32_t dataunit_len; + /**< When RTE_CRYPTODEV_FF_CIPHER_MULTIPLE_DATA_UNITS is enabled, + * this is the data-unit length of the algorithm, + * otherwise or when the value is 0, use the operation length. + * The value should be in the range defined by the dataunit_set field + * in the cipher capability. + * + * - For AES-XTS it is the size of data-unit, from IEEE Std 1619-2007. + * For-each data-unit in the operation, the tweak (IV) value is + * assigned consecutively starting from the operation assigned IV. + */ }; /** Symmetric Authentication / Hash Algorithms -- 2.25.1