patch 'app/fib: fix division by zero' has been queued to stable release 20.11.5

luca.boccassi at gmail.com luca.boccassi at gmail.com
Fri Feb 18 13:39:14 CET 2022


Hi,

FYI, your patch has been queued to stable release 20.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/20/22. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/32d2194f4f405db4a046200ce0ffa4fd2372377a

Thanks.

Luca Boccassi

---
>From 32d2194f4f405db4a046200ce0ffa4fd2372377a Mon Sep 17 00:00:00 2001
From: Vladimir Medvedkin <vladimir.medvedkin at intel.com>
Date: Thu, 27 Jan 2022 18:08:53 +0000
Subject: [PATCH] app/fib: fix division by zero

[ upstream commit a01070dac90b76f735e3c8805c3b78357b078518 ]

This patch fixes the division by 0, which occurs if the number of
routes is less than 10.
Can be triggered by passing -n argument with value < 10:

./dpdk-test-fib -- -n 9
...
Floating point exception (core dumped)

Fixes: 103809d032cd ("app/test-fib: add test application for FIB")

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin at intel.com>
Acked-by: Kevin Traynor <ktraynor at redhat.com>
---
 app/test-fib/main.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/app/test-fib/main.c b/app/test-fib/main.c
index ebf37652ab..17569ece07 100644
--- a/app/test-fib/main.c
+++ b/app/test-fib/main.c
@@ -711,6 +711,10 @@ parse_opts(int argc, char **argv)
 				print_usage();
 				rte_exit(-EINVAL, "Invalid option -n\n");
 			}
+
+			if (config.nb_routes < config.print_fract)
+				config.print_fract = config.nb_routes;
+
 			break;
 		case 'd':
 			distrib_string = optarg;
@@ -1240,6 +1244,10 @@ main(int argc, char **argv)
 		config.nb_routes = 0;
 		while (fgets(line, sizeof(line), fr) != NULL)
 			config.nb_routes++;
+
+		if (config.nb_routes < config.print_fract)
+			config.print_fract = config.nb_routes;
+
 		rewind(fr);
 	}
 
-- 
2.30.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-18 12:37:41.828601943 +0000
+++ 0105-app-fib-fix-division-by-zero.patch	2022-02-18 12:37:37.838795226 +0000
@@ -1 +1 @@
-From a01070dac90b76f735e3c8805c3b78357b078518 Mon Sep 17 00:00:00 2001
+From 32d2194f4f405db4a046200ce0ffa4fd2372377a Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a01070dac90b76f735e3c8805c3b78357b078518 ]
+
@@ -15 +16,0 @@
-Cc: stable at dpdk.org
@@ -24 +25 @@
-index 622703dce8..830c32cc44 100644
+index ebf37652ab..17569ece07 100644
@@ -38 +39 @@
-@@ -1242,6 +1246,10 @@ main(int argc, char **argv)
+@@ -1240,6 +1244,10 @@ main(int argc, char **argv)


More information about the stable mailing list