[dpdk-dev,3/7] app/crypto-perf: enable it for non default mempool

Message ID 1522152039-32493-3-git-send-email-hemant.agrawal@nxp.com (mailing list archive)
State Superseded, archived
Delegated to: Pablo de Lara Guarch
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Hemant Agrawal March 27, 2018, noon UTC
  The current code usages the default mempool ops while
creating the mempool for crypto usages. Adding the support
for best_mempool_ops to enable it for devices using
non default mempools.

Signed-off-by: Ashish Jain <ashish.jain@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 app/test-crypto-perf/cperf_test_common.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
  

Comments

De Lara Guarch, Pablo March 30, 2018, 4:02 p.m. UTC | #1
> -----Original Message-----
> From: Hemant Agrawal [mailto:hemant.agrawal@nxp.com]
> Sent: Tuesday, March 27, 2018 1:01 PM
> To: dev@dpdk.org
> Cc: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>;
> akhil.goyal@nxp.com
> Subject: [PATCH 3/7] app/crypto-perf: enable it for non default mempool
> 
> The current code usages the default mempool ops while creating the mempool
> for crypto usages. Adding the support for best_mempool_ops to enable it for
> devices using non default mempools.
> 
> Signed-off-by: Ashish Jain <ashish.jain@nxp.com>
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
  
De Lara Guarch, Pablo March 30, 2018, 4:11 p.m. UTC | #2
> -----Original Message-----
> From: Hemant Agrawal [mailto:hemant.agrawal@nxp.com]
> Sent: Tuesday, March 27, 2018 1:01 PM
> To: dev@dpdk.org
> Cc: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>;
> akhil.goyal@nxp.com
> Subject: [PATCH 3/7] app/crypto-perf: enable it for non default mempool
> 
> The current code usages the default mempool ops while creating the mempool
> for crypto usages. Adding the support for best_mempool_ops to enable it for
> devices using non default mempools.
> 
> Signed-off-by: Ashish Jain <ashish.jain@nxp.com>
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

FYI, I added " CFLAGS += -DALLOW_EXPERIMENTAL_API" in the app Makefile,
as that function is marked as experimental, and compilation was broken.
  

Patch

diff --git a/app/test-crypto-perf/cperf_test_common.c b/app/test-crypto-perf/cperf_test_common.c
index 21cb1c2..fa1dc49 100644
--- a/app/test-crypto-perf/cperf_test_common.c
+++ b/app/test-crypto-perf/cperf_test_common.c
@@ -3,6 +3,7 @@ 
  */
 
 #include <rte_malloc.h>
+#include <rte_mbuf_pool_ops.h>
 
 #include "cperf_test_common.h"
 
@@ -124,6 +125,7 @@  cperf_alloc_common_memory(const struct cperf_options *options,
 			uint32_t *dst_buf_offset,
 			struct rte_mempool **pool)
 {
+	const char *mp_ops_name;
 	char pool_name[32] = "";
 	int ret;
 
@@ -193,8 +195,10 @@  cperf_alloc_common_memory(const struct cperf_options *options,
 		return -1;
 	}
 
+	mp_ops_name = rte_mbuf_best_mempool_ops();
+
 	ret = rte_mempool_set_ops_byname(*pool,
-		RTE_MBUF_DEFAULT_MEMPOOL_OPS, NULL);
+		mp_ops_name, NULL);
 	if (ret != 0) {
 		RTE_LOG(ERR, USER1,
 			 "Error setting mempool handler for device %u\n",