diff mbox series

[2/2] crypto/octeontx: increase metabuf pool

Message ID 1623406873-7108-2-git-send-email-anoobj@marvell.com (mailing list archive)
State Accepted
Delegated to: akhil goyal
Headers show
Series [1/2] crypto/octeontx2: increase metabuf pool | expand

Checks

Context Check Description
ci/iol-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/github-robot success github build: passed
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Anoob Joseph June 11, 2021, 10:21 a.m. UTC
When used with crypto adapter, metabuf pool would be shared across
cores. Account for the same in pool size.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 drivers/crypto/octeontx/otx_cryptodev_hw_access.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/crypto/octeontx/otx_cryptodev_hw_access.c b/drivers/crypto/octeontx/otx_cryptodev_hw_access.c
index 5229e7c..ab335c6 100644
--- a/drivers/crypto/octeontx/otx_cryptodev_hw_access.c
+++ b/drivers/crypto/octeontx/otx_cryptodev_hw_access.c
@@ -409,7 +409,7 @@  otx_cpt_deinit_device(void *dev)
 static int
 otx_cpt_metabuf_mempool_create(const struct rte_cryptodev *dev,
 			       struct cpt_instance *instance, uint8_t qp_id,
-			       int nb_elements)
+			       unsigned int nb_elements)
 {
 	char mempool_name[RTE_MEMPOOL_NAMESIZE];
 	struct cpt_qp_meta_info *meta_info;
@@ -417,6 +417,7 @@  otx_cpt_metabuf_mempool_create(const struct rte_cryptodev *dev,
 	int max_mlen = 0;
 	int sg_mlen = 0;
 	int lb_mlen = 0;
+	int mb_pool_sz;
 	int ret;
 
 	/*
@@ -453,7 +454,9 @@  otx_cpt_metabuf_mempool_create(const struct rte_cryptodev *dev,
 	snprintf(mempool_name, RTE_MEMPOOL_NAMESIZE, "otx_cpt_mb_%u:%u",
 		 dev->data->dev_id, qp_id);
 
-	pool = rte_mempool_create_empty(mempool_name, nb_elements, max_mlen,
+	mb_pool_sz = RTE_MAX(nb_elements, (METABUF_POOL_CACHE_SIZE * rte_lcore_count()));
+
+	pool = rte_mempool_create_empty(mempool_name, mb_pool_sz, max_mlen,
 					METABUF_POOL_CACHE_SIZE, 0,
 					rte_socket_id(), 0);