All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [SPDK] Timer subsystem in SPDK application framework?
@ 2017-01-24 16:14 Walker, Benjamin
  0 siblings, 0 replies; 3+ messages in thread
From: Walker, Benjamin @ 2017-01-24 16:14 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 1626 bytes --]

On Tue, 2017-01-24 at 00:31 -0800, Naoki Iwakami wrote:
> Hi there,
> 
> I am using SPDK application framework (spdk_app_init() and so on),
> and struggling with figuring out the way to insert DPDK timer sub-
> system in the framework.
> 
> According to the DPDK documentation, you have to call function
> rte_timer_manage() periodically in lcores main_loop() in order to
> make the timer sub-system functioning properly.
> Could anyone advice where where I can find the lcore main loop in the
> SPDK app framework, and what is the recommended way to insert the
> rte_timer_manage() function?

The SPDK app framework spawns one thread per core for each core in the
core mask provided in the initialization options (called reactor_mask).
Each thread then sits in a tight loop polling queues for incoming
events and executing pollers. The implementation is in
lib/event/reactor.c.

Our app framework implements its own timers, so you don't need to use
the DPDK timers. You can just call

/**
 * \brief Register a poller on the given lcore.
 */
void spdk_poller_register(struct spdk_poller **ppoller,
			  spdk_poller_fn fn,
			  void *arg,
			  uint32_t lcore,
			  uint64_t period_microseconds);

and pass it a non-zero period.

If you really do need to use a DPDK timer, just register a poller using
the above function with a period of 0 and inside the spdk_poller_fn you
provide, call rte_timer_manage.

> 
> Regards,
> -- Naoki
> 
> _______________________________________________
> SPDK mailing list
> SPDK(a)lists.01.org
> https://lists.01.org/mailman/listinfo/spdk

[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 3274 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [SPDK] Timer subsystem in SPDK application framework?
@ 2017-01-25  3:38 Naoki Iwakami
  0 siblings, 0 replies; 3+ messages in thread
From: Naoki Iwakami @ 2017-01-25  3:38 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 2249 bytes --]

Thank you, Benjamin, I didn't notice you can use the poller for a periodic
task scheduler. I tried registering my task by spdk_poll_register and found
it works fine.
Thank you again for your help.

Regards,
-- Naoki

On Tue, Jan 24, 2017 at 8:14 AM, Walker, Benjamin <benjamin.walker(a)intel.com
> wrote:

> On Tue, 2017-01-24 at 00:31 -0800, Naoki Iwakami wrote:
> > Hi there,
> >
> > I am using SPDK application framework (spdk_app_init() and so on),
> > and struggling with figuring out the way to insert DPDK timer sub-
> > system in the framework.
> >
> > According to the DPDK documentation, you have to call function
> > rte_timer_manage() periodically in lcores main_loop() in order to
> > make the timer sub-system functioning properly.
> > Could anyone advice where where I can find the lcore main loop in the
> > SPDK app framework, and what is the recommended way to insert the
> > rte_timer_manage() function?
>
> The SPDK app framework spawns one thread per core for each core in the
> core mask provided in the initialization options (called reactor_mask).
> Each thread then sits in a tight loop polling queues for incoming
> events and executing pollers. The implementation is in
> lib/event/reactor.c.
>
> Our app framework implements its own timers, so you don't need to use
> the DPDK timers. You can just call
>
> /**
>  * \brief Register a poller on the given lcore.
>  */
> void spdk_poller_register(struct spdk_poller **ppoller,
>                           spdk_poller_fn fn,
>                           void *arg,
>                           uint32_t lcore,
>                           uint64_t period_microseconds);
>
> and pass it a non-zero period.
>
> If you really do need to use a DPDK timer, just register a poller using
> the above function with a period of 0 and inside the spdk_poller_fn you
> provide, call rte_timer_manage.
>
> >
> > Regards,
> > -- Naoki
> >
> > _______________________________________________
> > SPDK mailing list
> > SPDK(a)lists.01.org
> > https://lists.01.org/mailman/listinfo/spdk
>
> _______________________________________________
> SPDK mailing list
> SPDK(a)lists.01.org
> https://lists.01.org/mailman/listinfo/spdk
>
>

[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 3103 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [SPDK] Timer subsystem in SPDK application framework?
@ 2017-01-24  8:31 Naoki Iwakami
  0 siblings, 0 replies; 3+ messages in thread
From: Naoki Iwakami @ 2017-01-24  8:31 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 542 bytes --]

Hi there,

I am using SPDK application framework (spdk_app_init() and so on), and struggling with figuring out the way to insert DPDK timer sub-system in the framework.

According to the DPDK documentation, you have to call function rte_timer_manage() periodically in lcores main_loop() in order to make the timer sub-system functioning properly.
Could anyone advice where where I can find the lcore main loop in the SPDK app framework, and what is the recommended way to insert the rte_timer_manage() function?

Regards,
-- Naoki


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-01-25  3:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-24 16:14 [SPDK] Timer subsystem in SPDK application framework? Walker, Benjamin
  -- strict thread matches above, loose matches on Subject: below --
2017-01-25  3:38 Naoki Iwakami
2017-01-24  8:31 Naoki Iwakami

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.