DPDK usage discussions
 help / color / Atom feed
* [dpdk-users] Calling timers from a library
@ 2020-04-09  6:07 Archit Pandey
  2020-04-09 14:57 ` Stephen Hemminger
  0 siblings, 1 reply; 5+ messages in thread
From: Archit Pandey @ 2020-04-09  6:07 UTC (permalink / raw)
  To: users, Mohit P. Tahiliani, Gokul Bargaje, Tarun Anand, sanjana.krishnam

Hello DPDK users,

I'm building a library for DPDK which utilizes periodically called
functions using the dpdk timer facility. Currently, I'm using the master
core on an application to call timer_manage() and run the scheduled timers.

My doubt is whether its possible to call timer_manage() from inside the
library to run the scheduled timers. This would allow for a much more
streamlined design. An issue which comes to mind is that my library is not
aware of the cores it is being run on, hence I cannot use
rte_eal_remote_launch() for a function that calls rte_timer_manage().

Any help on how I can do this would be greatly appreciated!

Thanks and regards,

-- 
Archit Pandey
Senior Year B.Tech.
Department of Computer Science and Engineering
National Institute of Technology Karnataka
Surathkal, India

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

* Re: [dpdk-users] Calling timers from a library
  2020-04-09  6:07 [dpdk-users] Calling timers from a library Archit Pandey
@ 2020-04-09 14:57 ` Stephen Hemminger
  2020-04-09 15:48   ` Archit Pandey
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2020-04-09 14:57 UTC (permalink / raw)
  To: Archit Pandey
  Cc: users, Mohit P. Tahiliani, Gokul Bargaje, Tarun Anand, sanjana.krishnam

On Thu, 9 Apr 2020 11:37:12 +0530
Archit Pandey <architpandeynitk@gmail.com> wrote:

> Hello DPDK users,
> 
> I'm building a library for DPDK which utilizes periodically called
> functions using the dpdk timer facility. Currently, I'm using the master
> core on an application to call timer_manage() and run the scheduled timers.
> 
> My doubt is whether its possible to call timer_manage() from inside the
> library to run the scheduled timers. This would allow for a much more
> streamlined design. An issue which comes to mind is that my library is not
> aware of the cores it is being run on, hence I cannot use
> rte_eal_remote_launch() for a function that calls rte_timer_manage().
> 
> Any help on how I can do this would be greatly appreciated!
> 
> Thanks and regards,
> 

In my experience, once you start running DPDK functions on
non-DPDK threads lots of things can break. The DPDK threads are pinned
to a core and therefore don't preempt each other. For non-DPDK threads
they are not pinned; therefore a DPDK library or other code using
rte_spinlocks can get preempted with and self-deadlock.

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

* Re: [dpdk-users] Calling timers from a library
  2020-04-09 14:57 ` Stephen Hemminger
@ 2020-04-09 15:48   ` Archit Pandey
  2020-04-09 18:36     ` Stephen Hemminger
  0 siblings, 1 reply; 5+ messages in thread
From: Archit Pandey @ 2020-04-09 15:48 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: users, Mohit P. Tahiliani, Gokul Bargaje, Tarun Anand, sanjana.krishnam

Thanks for the tip!

This was what I experienced when I ran a separate function with periodic
calls to rte_timer_manage(). The code would deadlock and stop executing
after a few seconds.

Is there a way to overcome this? Perhaps by passing the core numbers into
the library?

--
Archit Pandey
Senior Year Undergraduate Student
Department of Computer Science and Engineering
National Institute of Technology Karnataka
Surathkal, India

On Thu, 9 Apr 2020, 8:27 pm Stephen Hemminger, <stephen@networkplumber.org>
wrote:

> On Thu, 9 Apr 2020 11:37:12 +0530
> Archit Pandey <architpandeynitk@gmail.com> wrote:
>
> > Hello DPDK users,
> >
> > I'm building a library for DPDK which utilizes periodically called
> > functions using the dpdk timer facility. Currently, I'm using the master
> > core on an application to call timer_manage() and run the scheduled
> timers.
> >
> > My doubt is whether its possible to call timer_manage() from inside the
> > library to run the scheduled timers. This would allow for a much more
> > streamlined design. An issue which comes to mind is that my library is
> not
> > aware of the cores it is being run on, hence I cannot use
> > rte_eal_remote_launch() for a function that calls rte_timer_manage().
> >
> > Any help on how I can do this would be greatly appreciated!
> >
> > Thanks and regards,
> >
>
> In my experience, once you start running DPDK functions on
> non-DPDK threads lots of things can break. The DPDK threads are pinned
> to a core and therefore don't preempt each other. For non-DPDK threads
> they are not pinned; therefore a DPDK library or other code using
> rte_spinlocks can get preempted with and self-deadlock.
>

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

* Re: [dpdk-users] Calling timers from a library
  2020-04-09 15:48   ` Archit Pandey
@ 2020-04-09 18:36     ` Stephen Hemminger
  2020-04-10 16:27       ` Archit Pandey
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2020-04-09 18:36 UTC (permalink / raw)
  To: Archit Pandey
  Cc: users, Mohit P. Tahiliani, Gokul Bargaje, Tarun Anand, sanjana.krishnam

On Thu, 9 Apr 2020 21:18:45 +0530
Archit Pandey <architpandeynitk@gmail.com> wrote:

> Thanks for the tip!
> 
> This was what I experienced when I ran a separate function with periodic
> calls to rte_timer_manage(). The code would deadlock and stop executing
> after a few seconds.
> 
> Is there a way to overcome this? Perhaps by passing the core numbers into
> the library?

The best advice is to stick to the DPDK threads.
There are multiple ways to do multiple events in one thread.

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

* Re: [dpdk-users] Calling timers from a library
  2020-04-09 18:36     ` Stephen Hemminger
@ 2020-04-10 16:27       ` Archit Pandey
  0 siblings, 0 replies; 5+ messages in thread
From: Archit Pandey @ 2020-04-10 16:27 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: users, Mohit P. Tahiliani, Gokul Bargaje, Tarun Anand, sanjana.krishnam

Thanks for the inputs!

--
Archit Pandey
Senior Year Undergraduate Student
Department of Computer Science and Engineering
National Institute of Technology Karnataka
Surathkal, India

On Fri, 10 Apr 2020, 12:06 am Stephen Hemminger, <stephen@networkplumber.org>
wrote:

> On Thu, 9 Apr 2020 21:18:45 +0530
> Archit Pandey <architpandeynitk@gmail.com> wrote:
>
> > Thanks for the tip!
> >
> > This was what I experienced when I ran a separate function with periodic
> > calls to rte_timer_manage(). The code would deadlock and stop executing
> > after a few seconds.
> >
> > Is there a way to overcome this? Perhaps by passing the core numbers into
> > the library?
>
> The best advice is to stick to the DPDK threads.
> There are multiple ways to do multiple events in one thread.
>

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

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-09  6:07 [dpdk-users] Calling timers from a library Archit Pandey
2020-04-09 14:57 ` Stephen Hemminger
2020-04-09 15:48   ` Archit Pandey
2020-04-09 18:36     ` Stephen Hemminger
2020-04-10 16:27       ` Archit Pandey

DPDK usage discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/users/0 users/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 users users/ http://inbox.dpdk.org/users \
		users@dpdk.org
	public-inbox-index users


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.users


AGPL code for this site: git clone https://public-inbox.org/ public-inbox