cryptodev: extend data-unit length field
Checks
Commit Message
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 <matan@nvidia.com>
---
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(-)
Comments
> 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 <matan@nvidia.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
> 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 <matan@nvidia.com>
> ---
Applied to dpdk-next-crypto
@@ -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;
};
@@ -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.
@@ -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.
=======================================================
@@ -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;
@@ -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