[dpdk-stable] patch 'latency: fix calculation for multi-thread' has been queued to LTS release 18.11.7
Kevin Traynor
ktraynor at redhat.com
Fri Feb 14 18:03:05 CET 2020
Hi,
FYI, your patch has been queued to LTS release 18.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 02/20/20. 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/bdb5ddd7522190044031376eacf3bfc35e0e99e0
Thanks.
Kevin.
---
>From bdb5ddd7522190044031376eacf3bfc35e0e99e0 Mon Sep 17 00:00:00 2001
From: Reshma Pattan <reshma.pattan at intel.com>
Date: Thu, 5 Dec 2019 17:18:11 +0000
Subject: [PATCH] latency: fix calculation for multi-thread
[ upstream commit 2a178702c00f2a8b547358fedc7107d376f8825e ]
Make latency calculation multithread safe by
using spinlock.
Fixes: 5cd3cac9ed ("latency: added new library for latency stats")
Signed-off-by: Reshma Pattan <reshma.pattan at intel.com>
---
lib/librte_latencystats/rte_latencystats.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/librte_latencystats/rte_latencystats.c b/lib/librte_latencystats/rte_latencystats.c
index 5715549e46..0212be9a89 100644
--- a/lib/librte_latencystats/rte_latencystats.c
+++ b/lib/librte_latencystats/rte_latencystats.c
@@ -42,4 +42,5 @@ struct rte_latency_stats {
float max_latency; /**< Maximum latency in nano seconds */
float jitter; /** Latency variation */
+ rte_spinlock_t lock; /** Latency calculation lock */
};
@@ -164,4 +165,5 @@ calc_latency(uint16_t pid __rte_unused,
}
+ rte_spinlock_lock(&glob_stats->lock);
for (i = 0; i < cnt; i++) {
/*
@@ -193,4 +195,5 @@ calc_latency(uint16_t pid __rte_unused,
prev_latency = latency[i];
}
+ rte_spinlock_unlock(&glob_stats->lock);
return nb_pkts;
@@ -222,4 +225,5 @@ rte_latencystats_init(uint64_t app_samp_intvl,
glob_stats = mz->addr;
+ rte_spinlock_init(&glob_stats->lock);
samp_intvl = app_samp_intvl * latencystat_cycles_per_ns();
--
2.21.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2020-02-14 17:02:37.656399712 +0000
+++ 0011-latency-fix-calculation-for-multi-thread.patch 2020-02-14 17:02:36.936408251 +0000
@@ -1 +1 @@
-From 2a178702c00f2a8b547358fedc7107d376f8825e Mon Sep 17 00:00:00 2001
+From bdb5ddd7522190044031376eacf3bfc35e0e99e0 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 2a178702c00f2a8b547358fedc7107d376f8825e ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -18 +19 @@
-index 98e018939e..ba2fff3bcb 100644
+index 5715549e46..0212be9a89 100644
@@ -21 +22 @@
-@@ -43,4 +43,5 @@ struct rte_latency_stats {
+@@ -42,4 +42,5 @@ struct rte_latency_stats {
@@ -27 +28 @@
-@@ -165,4 +166,5 @@ calc_latency(uint16_t pid __rte_unused,
+@@ -164,4 +165,5 @@ calc_latency(uint16_t pid __rte_unused,
@@ -33 +34 @@
-@@ -194,4 +196,5 @@ calc_latency(uint16_t pid __rte_unused,
+@@ -193,4 +195,5 @@ calc_latency(uint16_t pid __rte_unused,
@@ -39 +40 @@
-@@ -224,4 +227,5 @@ rte_latencystats_init(uint64_t app_samp_intvl,
+@@ -222,4 +225,5 @@ rte_latencystats_init(uint64_t app_samp_intvl,
More information about the stable
mailing list