From: Bruce Richardson <bruce.richardson@intel.com>
To: "Yeddula, Avinash" <ayeddula@ciena.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] RTE TIMER LIBRARY
Date: Fri, 19 Jun 2015 11:14:16 +0100 [thread overview]
Message-ID: <20150619101416.GB6880@bricha3-MOBL3> (raw)
In-Reply-To: <A1E50D8AD6310E47A6C10F075AEDC02201A0AB27FA@ONWVEXCHMB01.ciena.com>
On Thu, Jun 18, 2015 at 08:57:45PM -0400, Yeddula, Avinash wrote:
> Hello Dpdk-team,
>
> I have few very basic questions. In the DPDK timer sample application, the periodic timer0's callback function is not called unless "rte_timer_manage()" is called. I understand rte_timer_manage() function looks at all the expired timers in the core and runs them.
>
> Here are my questions:
>
> 1. If I comment out the rte_timer_manage() function in the code, time0_cb function is not getting called at all. Why is this ?
> I see some documentation saying if they are in Running state the timer would fail, what exactly does this mean, could you please provide more details.
>
> 2. Is it mandatory to call rte_timer_manage to trigger for the dpdk timers when they expire?
>
> 3. I see this point "The Timer library provides a timer service to Intel(r) DPDK execution units to enable execution of callback functions asynchronously." What does asynchronously means ?
>
> For example, I just have 1 worker thread in my application and the periodic timer expired and the corresponding call back function has to be executed. Now does the worker thread stop what it is doing now and starts executing timer's callback function or how does it work.
>
> I apologies if the questions are very basic and doesn't make sense.
>
> Thanks
> -Avinash
>
The timers in DPDK are asynchronous in the sense that the timers will fire at a
time given by the timeout command, and not at a guaranteed point in the code
execution. On the other hand, they are also synchronous in that the timers' callbacks
can only be executed at specific designated points in the code - the rte_timer_manage
calls.
This arrangement allows greater predictability of execution - as timer callbacks
fire at known points - and helps apps avoid race conditions e.g. if you are modifying
a setting on a port/queue in a callback, you can know that the core on which this
callback is executing is not performing packet IO on that port/queue at the same
time.
So overall, the rte_timer_manage functions are required in order to have timer
callbacks executed - since it is that function which itself triggers the callbacks,
at known points in the code.
/Bruce
next prev parent reply other threads:[~2015-06-19 10:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-19 0:57 Yeddula, Avinash
2015-06-19 10:14 ` Bruce Richardson [this message]
2015-06-19 14:55 ` 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=20150619101416.GB6880@bricha3-MOBL3 \
--to=bruce.richardson@intel.com \
--cc=ayeddula@ciena.com \
--cc=dev@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).