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 712A6A2E1B for ; Tue, 3 Sep 2019 06:51:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6189F1D446; Tue, 3 Sep 2019 06:51:32 +0200 (CEST) Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) by dpdk.org (Postfix) with ESMTP id 029A61C0DC for ; Tue, 3 Sep 2019 06:51:28 +0200 (CEST) Received: by mail-qk1-f176.google.com with SMTP id 4so14479736qki.6 for ; Mon, 02 Sep 2019 21:51:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iith.ac.in; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3hC+qUK4ybm4gK1n5xbuuwqYqbEJ7ce0tdsyRXWRBeU=; b=Ch9ccrR73uUL0ExKtdEiVCl/DDAaQU9tKsd/ORD25slQcf2MzESNmI/KFP5394Dfx5 Y/Oi1jjXXxsiF6zWuwDggD8kH4b7EFV27PimKSvOtCgqBD3dfmDbB1VTvRUUCOPpmnQI UUcq1iAkOH6tIVSiOFWRHgY8LRsC4CwJSUWzs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3hC+qUK4ybm4gK1n5xbuuwqYqbEJ7ce0tdsyRXWRBeU=; b=K7H4evg3h63xFvLnzfi5pJQahXtYsHsKk7noUQGEfa6tZpLsEyhbo36rVe6ADMsb5h WV9i0NFbLtE0SAVFWd1A+9+FgdU2A37zbWTt5/QiRIGB1dpBNE+eU9KZHYAzUhNZG3XF udF+f2ilej9sOkVUMlkkiWqGyFHef3O/mPJ9XtEMk5zLboSRs93dbAD/eiSXdDAElfQB oz+L0ppHe0GaL7Ly7ZVwHyGJ4sYa7LD115hjeljuKa9o105VsZN4Eus6kDhXvWAt87Df RatMjmEKOM7xSYOQ318uLjsVEju0uJslK+SS/WTl5qOgsx9UF3IdhwN9pbcf6F9BXEsj S3vg== X-Gm-Message-State: APjAAAXTUxEgEW4jtAbVYfi07sJz3OqWqGTILHKEhmvDyjzkcUGSoxIh MHV9p/IdK0HUP90k7G8uYkBOqXiQs2Jub1Nd9BQg7Q== X-Google-Smtp-Source: APXvYqzy8Wlo6hqfvzlCu+TVTK0v50svIafA6m3+HdWc+GH9qbALVYzvUwm2wp2WUGK6Oghp0GQ7uIASNfzKEctv4PM= X-Received: by 2002:a37:9fce:: with SMTP id i197mr30788967qke.175.1567486288148; Mon, 02 Sep 2019 21:51:28 -0700 (PDT) MIME-Version: 1.0 References: <20190902112214.GA631@bricha3-MOBL.ger.corp.intel.com> <20190902151429.GB631@bricha3-MOBL.ger.corp.intel.com> In-Reply-To: <20190902151429.GB631@bricha3-MOBL.ger.corp.intel.com> From: Suraj R Gupta Date: Tue, 3 Sep 2019 10:21:17 +0530 Message-ID: To: Bruce Richardson Cc: users@dpdk.org, dev@dpdk.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-users] [dpdk-dev] Stopping DPDK Timer [RTE-Timers] X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org Sender: "users" These are the links to Timers documentation. https://doc.dpdk.org/api/rte__timer_8h.html https://doc.dpdk.org/guides/prog_guide/timer_lib.html As per my understanding of the documentation, PENDING means timer is scheduled to run but not started.(in a list) RUNNING means timer is presently running. STOPPED means timer has stopped and callback processed. rte_timer_stop() can be used from callbacks for stopping the timer even in case of periodical(multishot timers) my use case is for a single shot , where i have to stop the timer in middle. On Mon, Sep 2, 2019 at 8:44 PM Bruce Richardson wrote: > 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 > -- Thanks and Regards Suraj R Gupta