From patchwork Fri Jul 28 02:15:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "De Lara Guarch, Pablo" X-Patchwork-Id: 27250 X-Patchwork-Delegate: pablo.de.lara.guarch@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 1A56C918B; Fri, 28 Jul 2017 12:15:04 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 3BC3F918B for ; Fri, 28 Jul 2017 12:15:02 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jul 2017 03:15:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,425,1496127600"; d="scan'208";a="292654596" Received: from silpixa00399464.ir.intel.com (HELO silpixa00399464.ger.corp.intel.com) ([10.237.222.157]) by fmsmga004.fm.intel.com with ESMTP; 28 Jul 2017 03:14:59 -0700 From: Pablo de Lara To: declan.doherty@intel.com Cc: dev@dpdk.org, Pablo de Lara Date: Fri, 28 Jul 2017 03:15:21 +0100 Message-Id: <20170728021521.87814-1-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.9.4 Subject: [dpdk-dev] [PATCH] app/crypto-perf: display error message 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" If the crypto operation pool size is too small, the pool might run out of operations, if all the crypto operations are still being used and have not been freed. To inform the user about this, the application should display an error message, asking the user to increase the pool size through the app parameters. Signed-off-by: Pablo de Lara --- app/test-crypto-perf/cperf_test_latency.c | 8 +++++++- app/test-crypto-perf/cperf_test_throughput.c | 8 +++++++- app/test-crypto-perf/cperf_test_verify.c | 8 +++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c index 6b3a336..dfd60ed 100644 --- a/app/test-crypto-perf/cperf_test_latency.c +++ b/app/test-crypto-perf/cperf_test_latency.c @@ -391,8 +391,14 @@ cperf_latency_test_runner(void *arg) if (burst_size != rte_crypto_op_bulk_alloc( ctx->crypto_op_pool, RTE_CRYPTO_OP_TYPE_SYMMETRIC, - ops, burst_size)) + ops, burst_size)) { + RTE_LOG(ERR, USER1, + "Failed to allocate more crypto operations " + "from the the crypto operation pool.\n" + "Consider increasing the pool size " + "with --pool-sz\n"); return -1; + } /* Setup crypto op, attach mbuf etc */ (ctx->populate_ops)(ops, &ctx->mbufs_in[m_idx], diff --git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto-perf/cperf_test_throughput.c index 5ba75d0..85ed21a 100644 --- a/app/test-crypto-perf/cperf_test_throughput.c +++ b/app/test-crypto-perf/cperf_test_throughput.c @@ -353,8 +353,14 @@ cperf_throughput_test_runner(void *test_ctx) if (ops_needed != rte_crypto_op_bulk_alloc( ctx->crypto_op_pool, RTE_CRYPTO_OP_TYPE_SYMMETRIC, - ops, ops_needed)) + ops, ops_needed)) { + RTE_LOG(ERR, USER1, + "Failed to allocate more crypto operations " + "from the the crypto operation pool.\n" + "Consider increasing the pool size " + "with --pool-sz\n"); return -1; + } /* Setup crypto op, attach mbuf etc */ (ctx->populate_ops)(ops, &ctx->mbufs_in[m_idx], diff --git a/app/test-crypto-perf/cperf_test_verify.c b/app/test-crypto-perf/cperf_test_verify.c index 7416ffb..1827e6f 100644 --- a/app/test-crypto-perf/cperf_test_verify.c +++ b/app/test-crypto-perf/cperf_test_verify.c @@ -444,8 +444,14 @@ cperf_verify_test_runner(void *test_ctx) if (ops_needed != rte_crypto_op_bulk_alloc( ctx->crypto_op_pool, RTE_CRYPTO_OP_TYPE_SYMMETRIC, - ops, ops_needed)) + ops, ops_needed)) { + RTE_LOG(ERR, USER1, + "Failed to allocate more crypto operations " + "from the the crypto operation pool.\n" + "Consider increasing the pool size " + "with --pool-sz\n"); return -1; + } /* Setup crypto op, attach mbuf etc */ (ctx->populate_ops)(ops, &ctx->mbufs_in[m_idx],