From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 742FAA054C for ; Fri, 14 Feb 2020 18:04:42 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 66D4E1F28; Fri, 14 Feb 2020 18:04:42 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id 41BAEF72 for ; Fri, 14 Feb 2020 18:04:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581699880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zIHtbpP3d51xwkNR8/WFXURwJYW5em5/vAGfJgYMksQ=; b=YaGiVOzMH01xGjcfVB9lhHGMcz5Euy9yBgr6dT6wuPf0M5iAHoK4KBNxoVuCrHVXyRys+r /x0aAEuVIvwyJOkDjDuY8cmJHuiINMmSR165Xd2G3TBcXyX6RcEsyLIdYHu3K1q8hZ4rMU GneXlZbWoc7cyX8WO6/RxySHKg3kIfA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-266-X4sodm4OOq2mTusJwxMz9Q-1; Fri, 14 Feb 2020 12:04:36 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 57C5B1084438; Fri, 14 Feb 2020 17:04:34 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 893658AC49; Fri, 14 Feb 2020 17:04:32 +0000 (UTC) From: Kevin Traynor To: Reshma Pattan Cc: dpdk stable Date: Fri, 14 Feb 2020 17:03:05 +0000 Message-Id: <20200214170337.25093-11-ktraynor@redhat.com> In-Reply-To: <20200214170337.25093-1-ktraynor@redhat.com> References: <20200214170337.25093-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: X4sodm4OOq2mTusJwxMz9Q-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'latency: fix calculation for multi-thread' has been queued to LTS release 18.11.7 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 rebasi= ng (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/bdb5ddd75221900440= 31376eacf3bfc35e0e99e0 Thanks. Kevin. --- >From bdb5ddd7522190044031376eacf3bfc35e0e99e0 Mon Sep 17 00:00:00 2001 From: Reshma Pattan 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 --- lib/librte_latencystats/rte_latencystats.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/librte_latencystats/rte_latencystats.c b/lib/librte_latenc= ystats/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 { =09float max_latency; /**< Maximum latency in nano seconds */ =09float jitter; /** Latency variation */ +=09rte_spinlock_t lock; /** Latency calculation lock */ }; =20 @@ -164,4 +165,5 @@ calc_latency(uint16_t pid __rte_unused, =09} =20 +=09rte_spinlock_lock(&glob_stats->lock); =09for (i =3D 0; i < cnt; i++) { =09=09/* @@ -193,4 +195,5 @@ calc_latency(uint16_t pid __rte_unused, =09=09prev_latency =3D latency[i]; =09} +=09rte_spinlock_unlock(&glob_stats->lock); =20 =09return nb_pkts; @@ -222,4 +225,5 @@ rte_latencystats_init(uint64_t app_samp_intvl, =20 =09glob_stats =3D mz->addr; +=09rte_spinlock_init(&glob_stats->lock); =09samp_intvl =3D app_samp_intvl * latencystat_cycles_per_ns(); =20 --=20 2.21.1 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092020-02-14 17:02:37.656399712 +0000 +++ 0011-latency-fix-calculation-for-multi-thread.patch=092020-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@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,