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 A1B54A2E1B for ; Tue, 3 Sep 2019 06:51:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6CABB1C1F0; Tue, 3 Sep 2019 06:51:30 +0200 (CEST) Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) by dpdk.org (Postfix) with ESMTP id 02B611C1F0 for ; Tue, 3 Sep 2019 06:51:28 +0200 (CEST) Received: by mail-qk1-f179.google.com with SMTP id f13so14430186qkm.9 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=QJgPqKGgebYYt2VEIFeQwCu5x1m0qtswoGp4+TzI0pcqARYd3qZ/0RQZatzFP/QgX5 ZWarlHTiPmjU4+SwUEfnsJQKo1bXeCRacvipsN77U5xNF3sMEj/7aloyU8en/naMLnBM vkpJ79EGRCXuARi9Vh9ABG+1eQDFEnwlmNNc5iTFIH2k5Wb2REOAuQQ1ql5++iE3vl33 5sszjtNezzleQk2SD/Bh/DWQK4iM5S+g19CuGSz68F/cBW5Wk+BUSohzQRAsvZhN4e3c VEeKkp/AJVOItITDutGpL6l4PTWivz7TKMEluZ4k0wYtm97JiSDUju9rh5wRVSDMFMQv A0ag== X-Gm-Message-State: APjAAAUQUVBu3ZRxjkQLTDQexXx096obe21jYJrZZ9EmQGrZL0ZAl/r/ txE1Fp/JngKQhwmM0Ti27J0fYD2fjm5iX2DIYU6mfw== 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-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" 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