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 8C6D0A2E1B for ; Mon, 2 Sep 2019 17:14:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B139C1EA52; Mon, 2 Sep 2019 17:14:35 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 6DC2C1E9C2; Mon, 2 Sep 2019 17:14:34 +0200 (CEST) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Sep 2019 08:14:33 -0700 X-IronPort-AV: E=Sophos;i="5.64,459,1559545200"; d="scan'208";a="176339968" Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.46]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Sep 2019 08:14:32 -0700 Date: Mon, 2 Sep 2019 16:14:29 +0100 From: Bruce Richardson To: Suraj R Gupta Cc: users@dpdk.org, dev@dpdk.org Message-ID: <20190902151429.GB631@bricha3-MOBL.ger.corp.intel.com> References: <20190902112214.GA631@bricha3-MOBL.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) Subject: Re: [dpdk-dev] Stopping DPDK Timer [RTE-Timers] 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 Mon, Sep 02, 2019 at 05:12:36PM +0530, Suraj R Gupta wrote: > Hi, > If I am right, rte_timer_stop() stops the timer after the call back > execution. > It is said that if rte_timer_stop() is called during timer running, > function will fail. > I want to know if timer can be stopped in middle abruptly? i.e If I > have timer started for 500 ms and i want to stop it in 100ms > Thanks > IIRC when a timer has been configured but the time has not yet expired it is in the PENDING state, where is can be safely stopped. I believe the running state is for timers which have expired and are about to have their callbacks processed, or are currently having their callbacks processed on another core. Therefore, in the normal case, using stop will do what you want. If this is not the case, it seems like something we should fix. Regards, /Bruce > On Mon, Sep 2, 2019 at 4:52 PM Bruce Richardson > <[1]bruce.richardson@intel.com> wrote: > > On Mon, Sep 02, 2019 at 11:02:16AM +0530, Suraj R Gupta wrote: > > Hi all, > > I am working with DPDK timers. > > In the documentation of timers, it has been said that dpdk based > rte-timers > > cannot stopped while running. I would like to know if there is any > way to > > stop it in middle or any workaround is possible. > > > > For e.g.: If I have timer started for 500 ms and i want to stop > it in 100 > > ms due to an event/interrupt. > > > > Note:I am not talking of stopping timer after callback execution, > before > > timer expiry in middle > > Thanks in advance. > > > I think rte_timer_stop() is what you are looking for. > /Bruce > > -- > > Thanks and Regards > Suraj R Gupta > > References > > 1. mailto:bruce.richardson@intel.com