From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D8BE442483; Wed, 25 Jan 2023 11:13:22 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CF43042D63; Wed, 25 Jan 2023 11:13:13 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 85A91400EF for ; Tue, 24 Jan 2023 11:39:54 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30NNv2FE006282; Tue, 24 Jan 2023 02:39:53 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=lC176bolZPzuBJSS6Ex/suNMV0M37+o6/DM7LQ+8r6Q=; b=ai8LEaAg1oZ1cbt9EUjhCwyB3pJMCNjEEas+hpOvrDZugSlZIK5Kg18amXDxUq05OJKk zyrHDEaV88/TGWFFC9wdMRO2XlccmiMsglnYC4TMuqd+aaVkFIhOJMjboGA5x2lcgjMK mYu91ovv8ZVupBH2Yb1AayI7HC2W2DkmDHZ1xIgEv2kRzhBhQNEfClCW6xYyuc4LhxSf oXPGWUdW2BLa71iLKizL2Opu7JUGHGh9+v3EN3fzYswhDYnwuKQJsMzkpuSsVALq0ryU ynJbhIf0jyiA05vjUmlpaJo33tiESfySyVyxb1n0ib2bhV6cdynBtfv0FpORaUXVRs6H 7A== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3n8gerfd3a-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 24 Jan 2023 02:39:53 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 24 Jan 2023 02:39:46 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Tue, 24 Jan 2023 02:39:46 -0800 Received: from localhost.localdomain (unknown [10.28.34.23]) by maili.marvell.com (Postfix) with ESMTP id 5015E3F705A; Tue, 24 Jan 2023 02:39:42 -0800 (PST) From: Mohammad Iqbal Ahmad To: , Thomas Monjalon , Wisam Jaddo , Xiaoyu Min CC: , , , , , , , , , , , Mohammad Iqbal Ahmad Subject: [PATCH v3 1/1] app/test-flow-perf: fix division or module by zero Date: Tue, 24 Jan 2023 16:08:03 +0530 Message-ID: <20230124103803.1924606-1-mahmad@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221219083402.1899934-1-mahmad@marvell.com> References: <20221219083402.1899934-1-mahmad@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: 6Bdked4xkh_gKKuNQsXkoov76bagsqGq X-Proofpoint-ORIG-GUID: 6Bdked4xkh_gKKuNQsXkoov76bagsqGq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-23_12,2023-01-24_01,2022-06-22_01 X-Mailman-Approved-At: Wed, 25 Jan 2023 11:13:11 +0100 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- .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 Mit Matelske Mohamad Noor Alim Hussin Mohammad Abdul Awal +Mohammad Iqbal Ahmad Mohammed Gamal Mohsin Kazmi Mohsin Mazhar Shaikh 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