[dpdk-stable] patch 'app/eventdev: fix divide by zero' has been queued to LTS release 18.11.6

Kevin Traynor ktraynor at redhat.com
Wed Dec 11 22:26:42 CET 2019


Hi,

FYI, your patch has been queued to LTS release 18.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/17/19. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/e3edd018212bd1f91a69370b52012d4cea15a360

Thanks.

Kevin.

---
>From e3edd018212bd1f91a69370b52012d4cea15a360 Mon Sep 17 00:00:00 2001
From: Pavan Nikhilesh <pbhagavatula at marvell.com>
Date: Fri, 22 Nov 2019 00:52:38 +0530
Subject: [PATCH] app/eventdev: fix divide by zero

[ upstream commit 93b7794b83524b322d03634969f77d767dec13f1 ]

Fix possible divide by zero condition when calculating percentages.

Coverity issue: 277205
Coverity issue: 277234
Fixes: d008f20bce23 ("app/eventdev: add event timer adapter as a producer")

Signed-off-by: Pavan Nikhilesh <pbhagavatula at marvell.com>
---
 app/test-eventdev/test_perf_common.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index f93729a12..81553a7b1 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -129,6 +129,7 @@ perf_event_timer_producer(void *arg)
 	rte_delay_ms(1000);
 	printf("%s(): lcore %d Average event timer arm latency = %.3f us\n",
-			__func__, rte_lcore_id(), (float)(arm_latency / count) /
-			(rte_get_timer_hz() / 1000000));
+			__func__, rte_lcore_id(),
+			count ? (float)(arm_latency / count) /
+			(rte_get_timer_hz() / 1000000) : 0);
 	return 0;
 }
@@ -190,6 +191,7 @@ perf_event_timer_producer_burst(void *arg)
 	rte_delay_ms(1000);
 	printf("%s(): lcore %d Average event timer arm latency = %.3f us\n",
-			__func__, rte_lcore_id(), (float)(arm_latency / count) /
-			(rte_get_timer_hz() / 1000000));
+			__func__, rte_lcore_id(),
+			count ? (float)(arm_latency / count) /
+			(rte_get_timer_hz() / 1000000) : 0);
 	return 0;
 }
-- 
2.21.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-12-11 21:24:16.652574108 +0000
+++ 0050-app-eventdev-fix-divide-by-zero.patch	2019-12-11 21:24:12.709650349 +0000
@@ -1 +1 @@
-From 93b7794b83524b322d03634969f77d767dec13f1 Mon Sep 17 00:00:00 2001
+From e3edd018212bd1f91a69370b52012d4cea15a360 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 93b7794b83524b322d03634969f77d767dec13f1 ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
@@ -19 +20 @@
-index e7cf75a7d..b3af4bfec 100644
+index f93729a12..81553a7b1 100644
@@ -22 +23 @@
-@@ -134,6 +134,7 @@ perf_event_timer_producer(void *arg)
+@@ -129,6 +129,7 @@ perf_event_timer_producer(void *arg)
@@ -32 +33 @@
-@@ -195,6 +196,7 @@ perf_event_timer_producer_burst(void *arg)
+@@ -190,6 +191,7 @@ perf_event_timer_producer_burst(void *arg)



More information about the stable mailing list