patch 'trace: fix race in debug dump' has been queued to stable release 20.11.7

luca.boccassi at gmail.com luca.boccassi at gmail.com
Sat Nov 5 18:11:04 CET 2022


Hi,

FYI, your patch has been queued to stable release 20.11.7

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

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

Thanks.

Luca Boccassi

---
>From f4cb97882bf55eaa58a1d627bd7fe912cfa0a420 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand at redhat.com>
Date: Wed, 14 Sep 2022 13:45:42 +0200
Subject: [PATCH] trace: fix race in debug dump

[ upstream commit 782dbf1791911eece2557b1a4b6f7c0ea57ea690 ]

trace->nb_trace_mem_list access must be under trace->lock to avoid
races with threads allocating/freeing their trace buffers.

Fixes: f6b2d65dcd5d ("trace: implement debug dump")

Signed-off-by: David Marchand <david.marchand at redhat.com>
Acked-by: Jerin Jacob <jerinj at marvell.com>
Acked-by: Sunil Kumar Kori <skori at marvell.com>
---
 lib/librte_eal/common/eal_common_trace.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/librte_eal/common/eal_common_trace.c b/lib/librte_eal/common/eal_common_trace.c
index 8594893a82..f9b26ab3ca 100644
--- a/lib/librte_eal/common/eal_common_trace.c
+++ b/lib/librte_eal/common/eal_common_trace.c
@@ -255,10 +255,9 @@ trace_lcore_mem_dump(FILE *f)
 	struct __rte_trace_header *header;
 	uint32_t count;
 
+	rte_spinlock_lock(&trace->lock);
 	if (trace->nb_trace_mem_list == 0)
-		return;
-
-	rte_spinlock_lock(&trace->lock);
+		goto out;
 	fprintf(f, "nb_trace_mem_list = %d\n", trace->nb_trace_mem_list);
 	fprintf(f, "\nTrace mem info\n--------------\n");
 	for (count = 0; count < trace->nb_trace_mem_list; count++) {
@@ -269,6 +268,7 @@ trace_lcore_mem_dump(FILE *f)
 		header->stream_header.lcore_id,
 		header->stream_header.thread_name);
 	}
+out:
 	rte_spinlock_unlock(&trace->lock);
 }
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-11-05 17:11:09.204111079 +0000
+++ 0005-trace-fix-race-in-debug-dump.patch	2022-11-05 17:11:08.570940409 +0000
@@ -1 +1 @@
-From 782dbf1791911eece2557b1a4b6f7c0ea57ea690 Mon Sep 17 00:00:00 2001
+From f4cb97882bf55eaa58a1d627bd7fe912cfa0a420 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 782dbf1791911eece2557b1a4b6f7c0ea57ea690 ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -16 +17 @@
- lib/eal/common/eal_common_trace.c | 6 +++---
+ lib/librte_eal/common/eal_common_trace.c | 6 +++---
@@ -19,5 +20,5 @@
-diff --git a/lib/eal/common/eal_common_trace.c b/lib/eal/common/eal_common_trace.c
-index 6aa11a3b50..ec168e37b3 100644
---- a/lib/eal/common/eal_common_trace.c
-+++ b/lib/eal/common/eal_common_trace.c
-@@ -259,10 +259,9 @@ trace_lcore_mem_dump(FILE *f)
+diff --git a/lib/librte_eal/common/eal_common_trace.c b/lib/librte_eal/common/eal_common_trace.c
+index 8594893a82..f9b26ab3ca 100644
+--- a/lib/librte_eal/common/eal_common_trace.c
++++ b/lib/librte_eal/common/eal_common_trace.c
+@@ -255,10 +255,9 @@ trace_lcore_mem_dump(FILE *f)
@@ -36 +37 @@
-@@ -273,6 +272,7 @@ trace_lcore_mem_dump(FILE *f)
+@@ -269,6 +268,7 @@ trace_lcore_mem_dump(FILE *f)


More information about the stable mailing list