From 5449a688839315ff9da11a38d760dce05eaca119 Mon Sep 17 00:00:00 2001 From: Hemant Agrawal Date: Mon, 2 Apr 2018 21:03:16 +0530 Subject: [PATCH] app/crypto-perf: support non default mempools 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 Signed-off-by: Hemant Agrawal Acked-by: Pablo de Lara --- app/test-crypto-perf/Makefile | 1 + app/test-crypto-perf/cperf_test_common.c | 6 +++++- app/test-crypto-perf/meson.build | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/test-crypto-perf/Makefile b/app/test-crypto-perf/Makefile index 3935aec409..28a0cd03c7 100644 --- a/app/test-crypto-perf/Makefile +++ b/app/test-crypto-perf/Makefile @@ -7,6 +7,7 @@ include $(RTE_SDK)/mk/rte.vars.mk APP = dpdk-test-crypto-perf CFLAGS += $(WERROR_FLAGS) +CFLAGS += -DALLOW_EXPERIMENTAL_API # all source are stored in SRCS-y SRCS-y := main.c diff --git a/app/test-crypto-perf/cperf_test_common.c b/app/test-crypto-perf/cperf_test_common.c index bd71ac3531..423782cb48 100644 --- a/app/test-crypto-perf/cperf_test_common.c +++ b/app/test-crypto-perf/cperf_test_common.c @@ -3,6 +3,7 @@ */ #include +#include #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", diff --git a/app/test-crypto-perf/meson.build b/app/test-crypto-perf/meson.build index 6eb22a5fd4..eacd7a0f5f 100644 --- a/app/test-crypto-perf/meson.build +++ b/app/test-crypto-perf/meson.build @@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2018 Intel Corporation +allow_experimental_apis = true sources = files('cperf_ops.c', 'cperf_options_parsing.c', 'cperf_test_common.c', -- 2.20.1