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 0819CA04B1 for ; Thu, 5 Nov 2020 13:42:06 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 01E92C31D; Thu, 5 Nov 2020 13:42:05 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by dpdk.org (Postfix) with ESMTP id 746F4C31D for ; Thu, 5 Nov 2020 13:42:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604580120; 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=WM7AKPbx3AXi8+M9o97HC/Cp3KNf2obW/M3n00J+86A=; b=O9D/P0UGwvdrKq4ln7Es77/AdvjyHDW41n4laTj+UDSk19KYEBCoQi30fy8LsK4S648W9X pTfnU3ca9yuOPCNhlWOCZ1kMeLBQcZsPBRcgFR95RFeeeRGscn9eSBGrvd6uhVnPFiGGG2 r1FXa44m9lMt6l3grCcMa1yA4LVw/F4= 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-97-7ijIEtozNEWmH7zFlW2jHA-1; Thu, 05 Nov 2020 07:41:56 -0500 X-MC-Unique: 7ijIEtozNEWmH7zFlW2jHA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2379F186841A; Thu, 5 Nov 2020 12:41:55 +0000 (UTC) Received: from rh.redhat.com (ovpn-113-249.ams2.redhat.com [10.36.113.249]) by smtp.corp.redhat.com (Postfix) with ESMTP id 17CCE5C3E1; Thu, 5 Nov 2020 12:41:53 +0000 (UTC) From: Kevin Traynor To: Erik Gabriel Carrillo Cc: Honnappa Nagarahalli , dpdk stable Date: Thu, 5 Nov 2020 12:39:55 +0000 Message-Id: <20201105124015.306404-48-ktraynor@redhat.com> In-Reply-To: <20201105124015.306404-1-ktraynor@redhat.com> References: <20201105124015.306404-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Subject: [dpdk-stable] patch 'timer: add limitation note for sync stop and reset' has been queued to LTS release 18.11.11 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.11 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/10/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/71605786253853b3363e181c780e35a3744e0f5d Thanks. Kevin. --- >From 71605786253853b3363e181c780e35a3744e0f5d Mon Sep 17 00:00:00 2001 From: Erik Gabriel Carrillo Date: Wed, 9 Sep 2020 09:41:14 -0500 Subject: [PATCH] timer: add limitation note for sync stop and reset [ upstream commit 0875ec4dd55a548a1f8a27674b1c136c0800d73d ] If a timer's callback function calls rte_timer_reset_sync() or rte_timer_stop_sync() on another timer that is in the RUNNING state and owned by the current lcore, the *_sync() calls will loop indefinitely. Relatedly, if a timer's callback function calls *_sync() on another timer that is in the RUNNING state and is owned by a different lcore, but a timer callback function runs on that different lcore and calls *_sync() on a timer that is in the RUNNING state and owned by the current lcore, the two lcores will loop indefinitely. Add a note in the rte_timer_stop_sync and rte_timer_reset_sync documentation that indicates that these APIs should not be used inside timer callback functions in order to avoid the hangs described above, and suggests an alternative. Bugzilla ID: 491 Signed-off-by: Erik Gabriel Carrillo Reviewed-by: Honnappa Nagarahalli --- lib/librte_timer/rte_timer.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/librte_timer/rte_timer.h b/lib/librte_timer/rte_timer.h index 9b95cd2c98..d3b06bc8e8 100644 --- a/lib/librte_timer/rte_timer.h +++ b/lib/librte_timer/rte_timer.h @@ -224,4 +224,10 @@ int rte_timer_reset(struct rte_timer *tim, uint64_t ticks, * @param arg * The user argument of the callback function. + * + * @note + * This API should not be called inside a timer's callback function to + * reset another timer; doing so could hang in certain scenarios. Instead, + * the rte_timer_reset() API can be called directly and its return code + * can be checked for success or failure. */ void @@ -264,4 +270,10 @@ int rte_timer_stop(struct rte_timer *tim); * @param tim * The timer handle. + * + * @note + * This API should not be called inside a timer's callback function to + * stop another timer; doing so could hang in certain scenarios. Instead, the + * rte_timer_stop() API can be called directly and its return code can + * be checked for success or failure. */ void rte_timer_stop_sync(struct rte_timer *tim); -- 2.26.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-11-05 12:38:55.157265677 +0000 +++ 0048-timer-add-limitation-note-for-sync-stop-and-reset.patch 2020-11-05 12:38:54.246896024 +0000 @@ -1 +1 @@ -From 0875ec4dd55a548a1f8a27674b1c136c0800d73d Mon Sep 17 00:00:00 2001 +From 71605786253853b3363e181c780e35a3744e0f5d Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 0875ec4dd55a548a1f8a27674b1c136c0800d73d ] + @@ -22 +23,0 @@ -Cc: stable@dpdk.org @@ -31 +32 @@ -index 7af83783b0..22a27aa08d 100644 +index 9b95cd2c98..d3b06bc8e8 100644 @@ -34 +35 @@ -@@ -263,4 +263,10 @@ int rte_timer_reset(struct rte_timer *tim, uint64_t ticks, +@@ -224,4 +224,10 @@ int rte_timer_reset(struct rte_timer *tim, uint64_t ticks, @@ -45 +46 @@ -@@ -302,4 +308,10 @@ int rte_timer_stop(struct rte_timer *tim); +@@ -264,4 +270,10 @@ int rte_timer_stop(struct rte_timer *tim);