DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
To: declan.doherty@intel.com
Cc: dev@dpdk.org, Pablo de Lara <pablo.de.lara.guarch@intel.com>
Subject: [dpdk-dev] [PATCH] app/crypto-perf: display error message
Date: Fri, 28 Jul 2017 03:15:21 +0100	[thread overview]
Message-ID: <20170728021521.87814-1-pablo.de.lara.guarch@intel.com> (raw)

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 <pablo.de.lara.guarch@intel.com>
---
 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],
-- 
2.9.4

             reply	other threads:[~2017-07-28 10:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-28  2:15 Pablo de Lara [this message]
2017-07-28 16:55 ` De Lara Guarch, Pablo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170728021521.87814-1-pablo.de.lara.guarch@intel.com \
    --to=pablo.de.lara.guarch@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).