From patchwork Tue Aug 4 03:51:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sarosh Arif X-Patchwork-Id: 75156 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5225EA053A; Tue, 4 Aug 2020 05:52:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1CA981BFFE; Tue, 4 Aug 2020 05:52:31 +0200 (CEST) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by dpdk.org (Postfix) with ESMTP id B1BF31BFFA for ; Tue, 4 Aug 2020 05:52:29 +0200 (CEST) Received: by mail-wr1-f67.google.com with SMTP id 88so35986320wrh.3 for ; Mon, 03 Aug 2020 20:52:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emumba-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7K7rA+TXzqhD1dtx95bQ7KbK9OymHxWw6ER0U1HfJkw=; b=1NDp+SWpiBf01Y7Xg2gCZEnDzkCESf1Q0dAtDHgEB6QuC3gQzFzFBY/tY3IXJW2Ibt Bne5H9iEvZG8+u85GkbV2D1I18NCShE4hN5Pi4EqUWY+G7M26vxQ8QMs1S5nbVTMn/ZQ o6VUgAlljngHDvPXU99CUXpWajwHQxrh63WnqFCrXB4f18enabsl+7j4HGRjqGuBrgI3 vnEDmsRwypVfolaSjSa1FULdFM7S5A2NO4l/dco/MjuHFD3OSj3SOOtZPf1a52tv8tc6 blLcIU+a2INRqesdZdBNUeahFoCSktsxhhAxW0PvIkt2/0wc/XpnaVp3epb2Q1oOGg5Z hNAg== 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; bh=7K7rA+TXzqhD1dtx95bQ7KbK9OymHxWw6ER0U1HfJkw=; b=TAfNIYZ2OYqeTOCalktWpIjB2g0R1aCiDTgkqC5FqQAG797VyF+vTXIEuDzOuaLiFl vCWZXaRdRWCffm/wFucqwnRP2ABu6idSmmDLyGL7MdOuuo7e6YkOH8GJ4o+a/43FjzWb UGa45SIKlmK4/0hHuO34hYr9b+Dtg6Z1VwPg+HeZnI3Mu1Y05cd5FaVGCBUG4wuEgu8j pNy2vXzu+V/HPlfWZlCKM5p0T1ySfOTHUd4VK+cdURlA1N3/WTS0O5f4tcN+lDiRrv1B abOSO8Ut24TvpA5MrhqdGgWC/UMMfk3WofhK3zEImGXMY6rsKRr5Jzt8Z8xMaS2WBAta jdgg== X-Gm-Message-State: AOAM533O156OX19gmMN4L++SbjQl9Qs2vKM9jXyppB996/+q8OI84kpi zto0fXEtZV608kbsqkDdVaBijA== X-Google-Smtp-Source: ABdhPJxQDG8IUOOC43YwDl1BoHCTVmqO8UktAEeZoJO8uqmLiVVSD/Du+whZ7ICCddxMyZ7DfXeBIA== X-Received: by 2002:adf:ab05:: with SMTP id q5mr16724569wrc.46.1596513149401; Mon, 03 Aug 2020 20:52:29 -0700 (PDT) Received: from localhost.localdomain ([101.50.93.133]) by smtp.gmail.com with ESMTPSA id o125sm2918188wma.27.2020.08.03.20.52.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2020 20:52:28 -0700 (PDT) From: Sarosh Arif To: erik.g.carrillo@intel.com, rsanford@akamai.com Cc: dev@dpdk.org, Sarosh Arif Date: Tue, 4 Aug 2020 08:51:35 +0500 Message-Id: <20200804035135.7526-1-sarosh.arif@emumba.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200803112059.23328-1-sarosh.arif@emumba.com> References: <20200803112059.23328-1-sarosh.arif@emumba.com> Subject: [dpdk-dev] [PATCH v2] doc: announce API change in timer X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" If the user tries to reset/stop some other timer in it's callback function, which is also about to expire, using rte_timer_reset_sync/rte_timer_stop_sync the application goes into an infinite loop. This happens because rte_timer_reset_sync/rte_timer_stop_sync loop until the timer resets/stops and there is check inside timer_set_config_state which prevents a running timer from being reset/stopped by not it's own timer_cb. Therefore timer_set_config_state returns -1 due to which rte_timer_reset returns -1 and rte_timer_reset_sync goes into an infinite loop To to prevent this rte_timer_reset_sync and rte_timer_stop_sync should have int return types, so that -1 can be returned if the above condition occurs Signed-off-by: Sarosh Arif --- v2: rephrase and fix typo --- doc/guides/rel_notes/deprecation.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index ea4cfa7a4..227950165 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -151,3 +151,9 @@ Deprecation Notices Python 2 support will be completely removed in 20.11. In 20.08, explicit deprecation warnings will be displayed when running scripts with Python 2. + +* timer: Timers can get stuck in an infinite loop if their callback tries to + synchronously reset/stop some other timer that is also about to expire. The + functions ``rte_timer_reset_sync`` and ``rte_timer_stop_sync`` will be updated + with an int return type so that an error code can be returned when this + condition occurs.