DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] crypto/octeontx2: increase metabuf pool
@ 2021-06-11 10:21 Anoob Joseph
  2021-06-11 10:21 ` [dpdk-dev] [PATCH 2/2] crypto/octeontx: " Anoob Joseph
  2021-06-29 19:59 ` [dpdk-dev] [PATCH 1/2] crypto/octeontx2: " Akhil Goyal
  0 siblings, 2 replies; 3+ messages in thread
From: Anoob Joseph @ 2021-06-11 10:21 UTC (permalink / raw)
  To: Akhil Goyal
  Cc: Anoob Joseph, Jerin Jacob, Ankur Dwivedi, Tejasree Kondoj, dev

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/octeontx2/otx2_cryptodev_ops.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
index 0cf8e80..12a2747 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
+++ b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
@@ -45,12 +45,12 @@ qp_memzone_name_get(char *name, int size, int dev_id, int qp_id)
 static int
 otx2_cpt_metabuf_mempool_create(const struct rte_cryptodev *dev,
 				struct otx2_cpt_qp *qp, uint8_t qp_id,
-				int nb_elements)
+				unsigned int nb_elements)
 {
 	char mempool_name[RTE_MEMPOOL_NAMESIZE];
 	struct cpt_qp_meta_info *meta_info;
+	int ret, max_mlen, mb_pool_sz;
 	struct rte_mempool *pool;
-	int ret, max_mlen;
 	int asym_mlen = 0;
 	int lb_mlen = 0;
 	int sg_mlen = 0;
@@ -87,7 +87,9 @@ otx2_cpt_metabuf_mempool_create(const struct rte_cryptodev *dev,
 	snprintf(mempool_name, RTE_MEMPOOL_NAMESIZE, "otx2_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);
 
-- 
2.7.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dpdk-dev] [PATCH 2/2] crypto/octeontx: increase metabuf pool
  2021-06-11 10:21 [dpdk-dev] [PATCH 1/2] crypto/octeontx2: increase metabuf pool Anoob Joseph
@ 2021-06-11 10:21 ` Anoob Joseph
  2021-06-29 19:59 ` [dpdk-dev] [PATCH 1/2] crypto/octeontx2: " Akhil Goyal
  1 sibling, 0 replies; 3+ messages in thread
From: Anoob Joseph @ 2021-06-11 10:21 UTC (permalink / raw)
  To: Akhil Goyal
  Cc: Anoob Joseph, Jerin Jacob, Ankur Dwivedi, Tejasree Kondoj, dev

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 --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);
 
-- 
2.7.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] crypto/octeontx2: increase metabuf pool
  2021-06-11 10:21 [dpdk-dev] [PATCH 1/2] crypto/octeontx2: increase metabuf pool Anoob Joseph
  2021-06-11 10:21 ` [dpdk-dev] [PATCH 2/2] crypto/octeontx: " Anoob Joseph
@ 2021-06-29 19:59 ` Akhil Goyal
  1 sibling, 0 replies; 3+ messages in thread
From: Akhil Goyal @ 2021-06-29 19:59 UTC (permalink / raw)
  To: Anoob Joseph
  Cc: Anoob Joseph, Jerin Jacob Kollanukkaran, Ankur Dwivedi,
	Tejasree Kondoj, dev

> 
> 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>
> ---
Series
Acked-by: Akhil Goyal <gakhil@marvell.com>

Applied to dpdk-next-crypto

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-29 19:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-11 10:21 [dpdk-dev] [PATCH 1/2] crypto/octeontx2: increase metabuf pool Anoob Joseph
2021-06-11 10:21 ` [dpdk-dev] [PATCH 2/2] crypto/octeontx: " Anoob Joseph
2021-06-29 19:59 ` [dpdk-dev] [PATCH 1/2] crypto/octeontx2: " Akhil Goyal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).