From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 15BA5A00E6 for ; Tue, 6 Aug 2019 12:37:46 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 324AA1BE31; Tue, 6 Aug 2019 12:37:45 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id DA8A737A8 for ; Tue, 6 Aug 2019 12:37:43 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Aug 2019 03:37:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,353,1559545200"; d="scan'208";a="185613375" Received: from adamdybx-mobl.ger.corp.intel.com (HELO addy-VirtualBox.isw.intel.com) ([10.103.104.111]) by orsmga002.jf.intel.com with ESMTP; 06 Aug 2019 03:37:41 -0700 From: Adam Dybkowski To: dev@dpdk.org, fiona.trahe@intel.com, pablo.de.lara.guarch@intel.com Cc: Adam Dybkowski Date: Tue, 6 Aug 2019 12:37:38 +0200 Message-Id: <20190806103738.16224-1-adamx.dybkowski@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] app/compress-perf: fix floating point exception 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" 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 --- 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