DPDK patches and discussions
 help / color / mirror / Atom feed
From: Adam Dybkowski <adamx.dybkowski@intel.com>
To: dev@dpdk.org, fiona.trahe@intel.com, pablo.de.lara.guarch@intel.com
Cc: Adam Dybkowski <adamx.dybkowski@intel.com>
Subject: [dpdk-dev] [PATCH] app/compress-perf: fix floating point exception
Date: Tue,  6 Aug 2019 12:37:38 +0200	[thread overview]
Message-ID: <20190806103738.16224-1-adamx.dybkowski@intel.com> (raw)

This patch fixes the floating point exception that happened
when the number of cores to be used during the benchmark
was zero. After the fix such situation is detected, the error
message is printed and the benchmark application exits.

Fixes: 424dd6c8c1a8 ("app/compress-perf: add weak functions for multicore test")

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
---
 app/test-compress-perf/main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/app/test-compress-perf/main.c b/app/test-compress-perf/main.c
index e7ac412e6..6f095b548 100644
--- a/app/test-compress-perf/main.c
+++ b/app/test-compress-perf/main.c
@@ -127,9 +127,13 @@ comp_perf_initialize_compressdev(struct comp_test_data *test_data,
 	 * if there are more available than cores.
 	 */
 	if (enabled_cdev_count > nb_lcores) {
+		if (nb_lcores == 0) {
+			RTE_LOG(ERR, USER1, "Cannot run with 0 cores! Increase the number of cores\n");
+			return -EINVAL;
+		}
 		enabled_cdev_count = nb_lcores;
 		RTE_LOG(INFO, USER1,
-			" There's more available devices than cores!"
+			"There's more available devices than cores!"
 			" The number of devices has been aligned to %d cores\n",
 			nb_lcores);
 	}
-- 
2.17.1


             reply	other threads:[~2019-08-06 10:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-06 10:37 Adam Dybkowski [this message]
2019-09-09 14:03 ` Trybula, ArturX
2019-09-19 14:52 ` Akhil Goyal

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=20190806103738.16224-1-adamx.dybkowski@intel.com \
    --to=adamx.dybkowski@intel.com \
    --cc=dev@dpdk.org \
    --cc=fiona.trahe@intel.com \
    --cc=pablo.de.lara.guarch@intel.com \
    /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).