From: Junxiao Shi Date: Tue, 9 Oct 2018 14:16:23 +0000 (-0400) Subject: cryptodev: fix pool element size for undefined operation X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=f49d7e9a99477c00c1f666e999dc62a0f73e5db3;p=dpdk.git cryptodev: fix pool element size for undefined operation The documentation of rte_crypto_op_pool_create indicates that specifying RTE_CRYPTO_OP_TYPE_UNDEFINED would create a pool that supports all operation types. This change makes the code consistent with documentation. Fixes: c0f87eb5252b ("cryptodev: change burst API to be crypto op oriented") Cc: stable@dpdk.org Signed-off-by: Junxiao Shi Acked-by: Akhil Goyal --- diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c index 63ae23f00d..608323fdd0 100644 --- a/lib/librte_cryptodev/rte_cryptodev.c +++ b/lib/librte_cryptodev/rte_cryptodev.c @@ -1477,6 +1477,9 @@ rte_crypto_op_pool_create(const char *name, enum rte_crypto_op_type type, elt_size += sizeof(struct rte_crypto_sym_op); } else if (type == RTE_CRYPTO_OP_TYPE_ASYMMETRIC) { elt_size += sizeof(struct rte_crypto_asym_op); + } else if (type == RTE_CRYPTO_OP_TYPE_UNDEFINED) { + elt_size += RTE_MAX(sizeof(struct rte_crypto_sym_op), + sizeof(struct rte_crypto_asym_op)); } else { CDEV_LOG_ERR("Invalid op_type\n"); return NULL;