DPDK usage discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Suraj R Gupta <surajrgupta@iith.ac.in>
Cc: users@dpdk.org, dev@dpdk.org
Subject: Re: [dpdk-users] [dpdk-dev] Stopping DPDK Timer [RTE-Timers]
Date: Mon, 2 Sep 2019 16:14:29 +0100	[thread overview]
Message-ID: <20190902151429.GB631@bricha3-MOBL.ger.corp.intel.com> (raw)
In-Reply-To: <CAMfGv3mayOQkir=Csi+AZY1ZLmhLwaEoG6fUivHobsrB9L5tnA@mail.gmail.com>

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

  reply	other threads:[~2019-09-02 15:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-02  5:32 [dpdk-users] Stopping DPDK Timer [dpdk-dev] [RTE-Timers] Suraj R Gupta
2019-09-02 11:22 ` [dpdk-users] [dpdk-dev] Stopping DPDK Timer [RTE-Timers] Bruce Richardson
2019-09-02 11:42   ` Suraj R Gupta
2019-09-02 15:14     ` Bruce Richardson [this message]
2019-09-03  4:51       ` Suraj R Gupta
2019-09-03  6:04         ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190902151429.GB631@bricha3-MOBL.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=surajrgupta@iith.ac.in \
    --cc=users@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).