From mboxrd@z Thu Jan 1 00:00:00 1970 From: Junxiao Shi Subject: [PATCH v2] crypto: fix element size for undefined crypto op Date: Tue, 9 Oct 2018 10:16:23 -0400 Message-ID: <201810091428.w99ESIjR028786@lectura.cs.arizona.edu> Cc: stable@dpdk.org, akhil.goyal@nxp.com To: dev@dpdk.org Return-path: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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") Signed-off-by: Junxiao Shi --- lib/librte_cryptodev/rte_cryptodev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c index 63ae23f00..608323fdd 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; -- 2.15.0.windows.1