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 A30C9A052A; Fri, 10 Jul 2020 17:19:22 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 03F521DA24; Fri, 10 Jul 2020 17:19:21 +0200 (CEST) Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by dpdk.org (Postfix) with ESMTP id D21B01DA1C for ; Fri, 10 Jul 2020 17:19:19 +0200 (CEST) Received: by mail-pg1-f194.google.com with SMTP id l63so2650868pge.12 for ; Fri, 10 Jul 2020 08:19:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZhiXI+IAAoehh5Qw53xEgjkn8Ep2NK6UunCTtBh7Fhs=; b=cU4z2zJIA/FAxHxa85pKueI19sn2CUJJOKNLAltb1XkI8RGmG2C4HRp7+L6l3/V4sS HQnYU3R8jN6e/RNSBdiswP4hMGWGHF+ghOyWeasRGZvdUZOlE1xb061VSg/0oLnEeUrf DqSbNqhphWPujtO4fpFxnXdDGIyj15GAI9MHGvMZqiVL0y9eOF3IFrfYwPbu3bgNgNEm R1SL+vmBDooaFNZ8dHmWKKwPcHbCi6Iurr91KzEg59k8myfiFcnXHoIZ7ImzwdQBbzXv gAi79pOgRF02Tw5mc66RCiqiA4gvUVfbcwIY/w0jzO0tZTxQWrzkEH9mF1rvkvAWVzTb L2kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZhiXI+IAAoehh5Qw53xEgjkn8Ep2NK6UunCTtBh7Fhs=; b=OZWTMAP/o39cqQQ1ahdP9kwXVYlUazDBPG1SohW5gnadDNwTjBqtb7PfmCSLgZvtND u/CEizGy78r3NhkUVDYgSoHh07zxrHo3TPsSF8b0DLzrV5PRnevNnG6qG9jID9ebNvpT 4RbN4eEFBa14ZgFPgxtFqWK073bQpuT6fwtldmpT5uJBxl7OgSZlFF0mCbGcaWNvQYk0 j839JrvnGpjCYr4kQ0EX7kQUBs/uzs8HFzAXuXDDu/LJR2DUV3aE85Bgm0p4RoC9VbfX 9MPKJiwEf9kl1PbnMH9wyZr2HTL1It6O+HmkKGthqT/4pnS+rHK6JaHHF0CDA6ib1n2K Zihw== X-Gm-Message-State: AOAM532st9uYNZQmuiMDXaWlKRE/HRvWt7M57sqiQAhveqbotYcLNyi/ L1VIuAQSYIT6fySSVRskD8Sh0w== X-Google-Smtp-Source: ABdhPJz4nHa8dj8oMZ+SGFgKvaunn9KQXEcetqsZ9BYu69jD6Qqp75IL6MgAC92MD0/lSmEl6+Qr7Q== X-Received: by 2002:aa7:934a:: with SMTP id 10mr26369180pfn.302.1594394358668; Fri, 10 Jul 2020 08:19:18 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id s12sm5865183pgp.54.2020.07.10.08.19.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2020 08:19:18 -0700 (PDT) Date: Fri, 10 Jul 2020 08:19:10 -0700 From: Stephen Hemminger To: Sarosh Arif Cc: rsanford@akamai.com, erik.g.carrillo@intel.com, dev@dpdk.org, stable@dpdk.org, h.mikita89@gmail.com Message-ID: <20200710081910.442d3248@hermes.lan> In-Reply-To: <20200710065954.4937-1-sarosh.arif@emumba.com> References: <20200707090320.2463-1-sarosh.arif@emumba.com> <20200710065954.4937-1-sarosh.arif@emumba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v3] lib/librte_timer:fix corruption with reset 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" On Fri, 10 Jul 2020 11:59:54 +0500 Sarosh Arif wrote: > 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. > > The soloution to this problem is to return -1 from > rte_timer_reset_sync/rte_timer_stop_sync in case the user tries to > reset/stop some other timer in it's callback function. > > Bugzilla ID: 491 > Fixes: 20d159f20543 ("timer: fix corruption with reset") > Cc: h.mikita89@gmail.com > Signed-off-by: Sarosh Arif > --- > v2: remove line continuations > v3: separate code and declarations If you want to change the return value, you need to go through the steps in the API/ABI policy. Maybe even symbol versioning. Sorry, I know it is painful but we committed to the rules. And changing the return value can never go to stable.