From patchwork Fri Aug 17 07:19:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamil Chalupnik X-Patchwork-Id: 43760 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C226E10A3; Fri, 17 Aug 2018 09:20:09 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id D43ABF72; Fri, 17 Aug 2018 09:20:07 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Aug 2018 00:20:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,249,1531810800"; d="scan'208";a="82509557" Received: from kchalupx-mobl.ger.corp.intel.com ([10.103.104.151]) by orsmga001.jf.intel.com with ESMTP; 17 Aug 2018 00:19:53 -0700 From: Kamil Chalupnik To: amr.mokhtar@intel.com, pablo.de.lara.guarch@intel.com Cc: dev@dpdk.org, stable@dpdk.org, Kamil Chalupnik Date: Fri, 17 Aug 2018 09:19:19 +0200 Message-Id: <20180817071919.31500-1-kamilx.chalupnik@intel.com> X-Mailer: git-send-email 2.9.0.windows.1 Subject: [dpdk-dev] [PATCH] app/testbbdev: fix inputs mbuf creation issue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Omitting inputs and outputs mbuf creation for BaseBand Null Device as inputs and outputs data do not exist for Null Device Fixes: b2a4654f082b ("mempool: check for zero size creation") Cc: pablo.de.lara.guarch@intel.com Signed-off-by: Kamil Chalupnik Tested-by: Peng, Yuan Signed-off-by: Kamil Chalupnik Acked-by: Amr Mokhtar --- app/test-bbdev/test_bbdev_perf.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c index 6861edc..fbe6cc9 100644 --- a/app/test-bbdev/test_bbdev_perf.c +++ b/app/test-bbdev/test_bbdev_perf.c @@ -267,12 +267,13 @@ typedef int (test_case_function)(struct active_device *ad, static int create_mempools(struct active_device *ad, int socket_id, - enum rte_bbdev_op_type op_type, uint16_t num_ops) + enum rte_bbdev_op_type org_op_type, uint16_t num_ops) { struct rte_mempool *mp; unsigned int ops_pool_size, mbuf_pool_size = 0; char pool_name[RTE_MEMPOOL_NAMESIZE]; const char *op_type_str; + enum rte_bbdev_op_type op_type = org_op_type; struct op_data_entries *in = &test_vector.entries[DATA_INPUT]; struct op_data_entries *hard_out = @@ -289,6 +290,9 @@ typedef int (test_case_function)(struct active_device *ad, OPS_CACHE_SIZE + 1)), OPS_POOL_SIZE_MIN)); + if (org_op_type == RTE_BBDEV_OP_NONE) + op_type = RTE_BBDEV_OP_TURBO_ENC; + op_type_str = rte_bbdev_op_type_str(op_type); TEST_ASSERT_NOT_NULL(op_type_str, "Invalid op type: %u", op_type); @@ -303,6 +307,10 @@ typedef int (test_case_function)(struct active_device *ad, socket_id); ad->ops_mempool = mp; + /* Do not create inputs and outputs mbufs for BaseBand Null Device */ + if (org_op_type == RTE_BBDEV_OP_NONE) + return TEST_SUCCESS; + /* Inputs */ mbuf_pool_size = optimal_mempool_size(ops_pool_size * in->nb_segments); mp = create_mbuf_pool(in, ad->dev_id, socket_id, mbuf_pool_size, "in"); @@ -1058,14 +1066,14 @@ typedef int (test_case_function)(struct active_device *ad, rte_bbdev_info_get(ad->dev_id, &info); socket_id = GET_SOCKET(info.socket_id); - if (op_type == RTE_BBDEV_OP_NONE) - op_type = RTE_BBDEV_OP_TURBO_ENC; f_ret = create_mempools(ad, socket_id, op_type, get_num_ops()); if (f_ret != TEST_SUCCESS) { printf("Couldn't create mempools"); goto fail; } + if (op_type == RTE_BBDEV_OP_NONE) + op_type = RTE_BBDEV_OP_TURBO_ENC; f_ret = init_test_op_params(op_params, test_vector.op_type, test_vector.expected_status,