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 37039A04DD for ; Wed, 28 Oct 2020 11:52:13 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D3BF8CA14; Wed, 28 Oct 2020 11:52:11 +0100 (CET) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by dpdk.org (Postfix) with ESMTP id ED3E8C9F6 for ; Wed, 28 Oct 2020 11:52:10 +0100 (CET) Received: by mail-wr1-f67.google.com with SMTP id n18so5166705wrs.5 for ; Wed, 28 Oct 2020 03:52:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AGhjun1wynq7p85//N6ddHJkN8rOekynplR/pT5DB68=; b=JcV0YbvL9WKLx7lRkM5ulp2uul3s9svYzsCWnKy5IGZy0a/ju+45KUFb5zf1PR6XV9 mHWGTUCFa7lHhRzizQGm6BLqeaI1ZKUxC8I9aRoP1onCk9Vt20+m/n0U29eEfKEVVmKY 2i69oEeNYR+arFldNNyfpqdS9MkOnU0xGF5WL/2kNhh5QB6gag/iJ4hSkUTFHSp9EZfs wNYBrpfMAkulaB456gKuDE3EZD/xpAIt6lzDlDYP2whLzgE6sBmj/5INp2tauXBtZzl3 dxl+Q4Ei52UsF3ZGPRhOW4cptxTHPa5b9q3BjjVpSa6hlwIUFuteaqcQWvpjwtLs6wvO kaKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AGhjun1wynq7p85//N6ddHJkN8rOekynplR/pT5DB68=; b=lPbJboXXnPPBDJYpDsqukTx6N2y2lIl9Fm+jMfbJOLkmaw9DSf9jtuX4RVbX+U+YB1 exdLkBAmYu0/S5YrTZ+gI0RQJK4DsRL/yQdE4HjQ52Pz62F6z3kfH3sHsgrN2BXEzPFI vVbgyvWamUZtOdyNzPfYZCHzhkTjU6yNdHtVYEwTbDgBkIi1/tbKsV0jwNvPWMmsacbY 6woeegFpADS6lMC0QpzwvphbdAEz/rNF1bVhhT+zwfDiQX/5wy8yaOEbIqYHczvkXKRg znGuuaF6QoFaPRtS/JcCK8Q8Q4zy9eHUzZa95G+dGru+musXrKTlLJa2LQq90AZFKiKw 1NOQ== X-Gm-Message-State: AOAM533mZJ+KIeBwgcByNajuK4Tc2uELjyWb+fQE21NwAT7inZoDnMuy rZCn3J1I2SffBgTfWAd+sc8= X-Google-Smtp-Source: ABdhPJzMnP+zwxb8Hj8didL6ZJCHrdCMhq2jIuhmXUKI4m3mcG/BUO5eTGF9Bf/sDjePDUSDqkvXuw== X-Received: by 2002:a5d:6a0a:: with SMTP id m10mr8341269wru.189.1603882329699; Wed, 28 Oct 2020 03:52:09 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id w1sm6091139wrp.95.2020.10.28.03.52.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 03:52:09 -0700 (PDT) From: luca.boccassi@gmail.com To: Erik Gabriel Carrillo Cc: Honnappa Nagarahalli , dpdk stable Date: Wed, 28 Oct 2020 10:44:33 +0000 Message-Id: <20201028104606.3504127-114-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201028104606.3504127-1-luca.boccassi@gmail.com> References: <20201028104606.3504127-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'timer: add limitation note for sync stop and reset' has been queued to stable release 19.11.6 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 stable release 19.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/30/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. Thanks. Luca Boccassi --- >From 92749fc95c9c53d6eef799b70af2d0e1246c3bf6 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 9dc5fc3092..88cc267686 100644 --- a/lib/librte_timer/rte_timer.h +++ b/lib/librte_timer/rte_timer.h @@ -274,6 +274,12 @@ int rte_timer_reset(struct rte_timer *tim, uint64_t ticks, * The callback function of the timer. * @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 rte_timer_reset_sync(struct rte_timer *tim, uint64_t ticks, @@ -313,6 +319,12 @@ 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.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-10-28 10:35:15.296554170 +0000 +++ 0114-timer-add-limitation-note-for-sync-stop-and-reset.patch 2020-10-28 10:35:11.668832438 +0000 @@ -1,8 +1,10 @@ -From 0875ec4dd55a548a1f8a27674b1c136c0800d73d Mon Sep 17 00:00:00 2001 +From 92749fc95c9c53d6eef799b70af2d0e1246c3bf6 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. @@ -19,7 +21,6 @@ and suggests an alternative. Bugzilla ID: 491 -Cc: stable@dpdk.org Signed-off-by: Erik Gabriel Carrillo Reviewed-by: Honnappa Nagarahalli @@ -28,10 +29,10 @@ 1 file changed, 12 insertions(+) diff --git a/lib/librte_timer/rte_timer.h b/lib/librte_timer/rte_timer.h -index 7af83783b0..22a27aa08d 100644 +index 9dc5fc3092..88cc267686 100644 --- a/lib/librte_timer/rte_timer.h +++ b/lib/librte_timer/rte_timer.h -@@ -262,6 +262,12 @@ int rte_timer_reset(struct rte_timer *tim, uint64_t ticks, +@@ -274,6 +274,12 @@ int rte_timer_reset(struct rte_timer *tim, uint64_t ticks, * The callback function of the timer. * @param arg * The user argument of the callback function. @@ -44,7 +45,7 @@ */ void rte_timer_reset_sync(struct rte_timer *tim, uint64_t ticks, -@@ -301,6 +307,12 @@ int rte_timer_stop(struct rte_timer *tim); +@@ -313,6 +319,12 @@ int rte_timer_stop(struct rte_timer *tim); * * @param tim * The timer handle.