[dpdk-dev,04/22] cryptodev: do not store pointer to op specific params
Checks
Commit Message
Instead of storing a pointer to operation specific parameters,
such as symmetric crypto parameters, use a zero-length array,
to mark that these parameters will be stored after the
generic crypto operation structure, which was already assumed
in the code.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
examples/ipsec-secgw/ipsec.c | 1 -
lib/librte_cryptodev/rte_crypto.h | 12 +++---------
lib/librte_cryptodev/rte_crypto_sym.h | 2 +-
3 files changed, 4 insertions(+), 11 deletions(-)
@@ -140,7 +140,6 @@ ipsec_enqueue(ipsec_xform_fn xform_func, struct ipsec_ctx *ipsec_ctx,
priv->cop.status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
rte_prefetch0(&priv->sym_cop);
- priv->cop.sym = &priv->sym_cop;
if ((unlikely(sa->crypto_session == NULL)) &&
create_session(ipsec_ctx, sa)) {
@@ -124,10 +124,10 @@ struct rte_crypto_op {
RTE_STD_C11
union {
- struct rte_crypto_sym_op *sym;
+ struct rte_crypto_sym_op sym[0];
/**< Symmetric operation parameters */
- }; /**< operation specific parameters */
-} __rte_cache_aligned;
+ } /**< operation specific parameters */ __rte_aligned(8);
+};
/**
* Reset the fields of a crypto operation to their default values.
@@ -144,12 +144,6 @@ __rte_crypto_op_reset(struct rte_crypto_op *op, enum rte_crypto_op_type type)
switch (type) {
case RTE_CRYPTO_OP_TYPE_SYMMETRIC:
- /** Symmetric operation structure starts after the end of the
- * rte_crypto_op structure.
- */
- op->sym = (struct rte_crypto_sym_op *)(op + 1);
- op->type = type;
-
__rte_crypto_sym_op_reset(op->sym);
break;
default:
@@ -640,7 +640,7 @@ struct rte_crypto_sym_op {
} aad;
/**< Additional authentication parameters */
} auth;
-} __rte_cache_aligned;
+};
/**