DPDK patches and discussions
 help / color / mirror / Atom feed
From: Mohammad Iqbal Ahmad <mahmad@marvell.com>
To: <dev@dpdk.org>, Thomas Monjalon <thomas@monjalon.net>,
	Wisam Jaddo <wisamm@nvidia.com>, Xiaoyu Min <jackmin@nvidia.com>
Cc: <jerinj@marvell.com>, <skori@marvell.com>,
	<skoteshwar@marvell.com>, <pbhagavatula@marvell.com>,
	<kirankumark@marvell.com>, <psatheesh@marvell.com>,
	<asekhar@marvell.com>, <anoobj@marvell.com>, <gakhil@marvell.com>,
	<hkalra@marvell.com>, <ndabilpuram@marvell.com>,
	Mohammad Iqbal Ahmad <mahmad@marvell.com>
Subject: [PATCH v3 1/1] app/test-flow-perf: fix division or module by zero
Date: Tue, 24 Jan 2023 16:08:03 +0530	[thread overview]
Message-ID: <20230124103803.1924606-1-mahmad@marvell.com> (raw)
In-Reply-To: <20221219083402.1899934-1-mahmad@marvell.com>

Fix division or module by zero reported by coverity scan.
Updated .mailmap

Coverity issue: 373870
Fixes: bf3688f1e816 ("app/flow-perf: add insertion rate calculation")

Signed-off-by: Mohammad Iqbal Ahmad <mahmad@marvell.com>
---
 .mailmap                  | 1 +
 app/test-flow-perf/main.c | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index a153c9ab93..ec9f419f53 100644
--- a/.mailmap
+++ b/.mailmap
@@ -912,6 +912,7 @@ Mitch Williams <mitch.a.williams@intel.com>
 Mit Matelske <mit@pt.net>
 Mohamad Noor Alim Hussin <mohamad.noor.alim.hussin@intel.com>
 Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
+Mohammad Iqbal Ahmad <mahmad@marvell.com>
 Mohammed Gamal <mgamal@redhat.com>
 Mohsin Kazmi <mohsin.kazmi14@gmail.com>
 Mohsin Mazhar Shaikh <mohsinmazhar_shaikh@trendmicro.com>
diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c
index 4a9206803a..0a542b0d87 100644
--- a/app/test-flow-perf/main.c
+++ b/app/test-flow-perf/main.c
@@ -848,7 +848,12 @@ args_parse(int argc, char **argv)
 			/* Control */
 			if (strcmp(lgopts[opt_idx].name,
 					"rules-batch") == 0) {
-				rules_batch = atoi(optarg);
+				n = atoi(optarg);
+				if (n > 0)
+					rules_batch = n;
+				else
+					rte_exit(EXIT_FAILURE,
+							"flow rules_batch should be > 0\n");
 			}
 			if (strcmp(lgopts[opt_idx].name,
 					"rules-count") == 0) {
-- 
2.25.1


  parent reply	other threads:[~2023-01-25 10:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-16  7:39 [PATCH v1 1/2] mailmap: add contributor to list Mohammad Iqbal Ahmad
2022-12-16  7:39 ` [PATCH v1 2/2] app/test-flow-perf: fix division or module by zero Mohammad Iqbal Ahmad
2022-12-19  8:34 ` [PATCH v2 1/2] mailmap: add contributor to list Mohammad Iqbal Ahmad
2022-12-19  8:34   ` [PATCH v2 2/2] app/test-flow-perf: fix division or module by zero Mohammad Iqbal Ahmad
2023-01-23 11:41   ` [PATCH v2 1/2] mailmap: add contributor to list Mohammad Iqbal Ahmad
2023-01-23 15:32     ` Thomas Monjalon
2023-01-24 10:38   ` Mohammad Iqbal Ahmad [this message]
2023-02-20 12:46     ` [PATCH v3 1/1] app/test-flow-perf: fix division or module by zero Wisam Monther
2023-02-20 12:51       ` Thomas Monjalon
2023-03-06 10:21         ` Wisam Monther
2023-03-12 14:05     ` Thomas Monjalon
2023-01-09 10:57 ` [PATCH v1 1/2] mailmap: add contributor to list Mohammad Iqbal Ahmad
2023-01-10 14:56 ` [PATCH v1] examples/l3fwd: fix for coverity scan Mohammad Iqbal Ahmad
2023-01-18 11:24   ` Walsh, Conor
2023-02-01 17:28   ` Thomas Monjalon
2023-07-06 18:09     ` Stephen Hemminger
2023-07-12 14:39       ` Thomas Monjalon

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=20230124103803.1924606-1-mahmad@marvell.com \
    --to=mahmad@marvell.com \
    --cc=anoobj@marvell.com \
    --cc=asekhar@marvell.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=hkalra@marvell.com \
    --cc=jackmin@nvidia.com \
    --cc=jerinj@marvell.com \
    --cc=kirankumark@marvell.com \
    --cc=ndabilpuram@marvell.com \
    --cc=pbhagavatula@marvell.com \
    --cc=psatheesh@marvell.com \
    --cc=skori@marvell.com \
    --cc=skoteshwar@marvell.com \
    --cc=thomas@monjalon.net \
    --cc=wisamm@nvidia.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).