[dpdk-stable] patch 'app/testpmd: fix division by zero on socket memory dump' has been queued to stable release 20.11.2

Xueming Li xuemingl at nvidia.com
Sat Jun 12 01:02:21 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.11.2

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

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/6af34d2abd298a998de974fdc4d3cdb6f2d63453

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 6af34d2abd298a998de974fdc4d3cdb6f2d63453 Mon Sep 17 00:00:00 2001
From: "Min Hu (Connor)" <humin29 at huawei.com>
Date: Mon, 26 Apr 2021 19:57:57 +0800
Subject: [PATCH] app/testpmd: fix division by zero on socket memory dump
Cc: Luca Boccassi <bluca at debian.org>

[ upstream commit a767951e597964e6c02529097edd2b43b5aace4d ]

Variable total, which may be zero and result in segmentation fault.

This patch fixed it.

Fixes: 9b1249d9ff69 ("app/testpmd: support dumping socket memory")

Signed-off-by: Min Hu (Connor) <humin29 at huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>
---
 app/test-pmd/cmdline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 294031542a..3712daae7b 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -9557,7 +9557,7 @@ dump_socket_mem(FILE *f)
 	fprintf(f,
 		"Total   : size(M) total: %.6lf alloc: %.6lf(%.3lf%%) free: %.6lf \tcount alloc: %-4u free: %u\n",
 		(double)total / (1024 * 1024), (double)alloc / (1024 * 1024),
-		(double)alloc * 100 / (double)total,
+		total ? ((double)alloc * 100 / (double)total) : 0,
 		(double)free / (1024 * 1024),
 		n_alloc, n_free);
 	if (last_allocs)
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-06-12 06:53:57.874394000 +0800
+++ 0047-app-testpmd-fix-division-by-zero-on-socket-memory-du.patch	2021-06-12 06:53:56.230000000 +0800
@@ -1 +1 @@
-From a767951e597964e6c02529097edd2b43b5aace4d Mon Sep 17 00:00:00 2001
+From 6af34d2abd298a998de974fdc4d3cdb6f2d63453 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Luca Boccassi <bluca at debian.org>
+
+[ upstream commit a767951e597964e6c02529097edd2b43b5aace4d ]
@@ -11 +13,0 @@
-Cc: stable at dpdk.org
@@ -20 +22 @@
-index 5fdcc1ca18..29ee41da5f 100644
+index 294031542a..3712daae7b 100644
@@ -23 +25 @@
-@@ -9731,7 +9731,7 @@ dump_socket_mem(FILE *f)
+@@ -9557,7 +9557,7 @@ dump_socket_mem(FILE *f)


More information about the stable mailing list