DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] IPC/message passing between DPDK application and non-DPDK userspace application
@ 2014-10-18  2:14 Kamraan Nasim
  2014-10-18 17:38 ` Matthew Hall
  0 siblings, 1 reply; 3+ messages in thread
From: Kamraan Nasim @ 2014-10-18  2:14 UTC (permalink / raw)
  To: dev

Greetings,

I am still a DPDK newbie so not really sure how to go about doing this...

I have a DPI daemon running in userspace which uses libpcap for packet RX
that I would like to replace with DPDK ethernet PMD. However it is not
feasible to convert the entire application to run within the DPDK framework
which is why I would like to split packet RX to use DPDK and have my
applications higher order functions continue using Linux pthread.

Is it possible to exchange data between DPDK processes and regular
userspace processes via some shared mem or IPC mechanism? I am not sure if
the SW ring buffers that DPDK provides can be used in this context?

Please let me know if others have come across this. Any help from the DPDK
community would be greatly appreciated :)

--Kam

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

* Re: [dpdk-dev] IPC/message passing between DPDK application and non-DPDK userspace application
  2014-10-18  2:14 [dpdk-dev] IPC/message passing between DPDK application and non-DPDK userspace application Kamraan Nasim
@ 2014-10-18 17:38 ` Matthew Hall
  2014-10-20 14:41   ` Kamraan Nasim
  0 siblings, 1 reply; 3+ messages in thread
From: Matthew Hall @ 2014-10-18 17:38 UTC (permalink / raw)
  To: Kamraan Nasim; +Cc: dev

On Fri, Oct 17, 2014 at 10:14:50PM -0400, Kamraan Nasim wrote:
> I have a DPI daemon running in userspace which uses libpcap for packet RX
> that I would like to replace with DPDK ethernet PMD. However it is not
> feasible to convert the entire application to run within the DPDK framework
> which is why I would like to split packet RX to use DPDK and have my
> applications higher order functions continue using Linux pthread.

The DPDK's lcore threads are just Linux pthreads bound onto specific cores. 
They aren't doing any secret stuff there really.

So you could configure the DPDK to do stuff on some cores, and do your own 
stuff on other cores using the DPDK's "coremask" setting to say which cores it 
should launch itself on.

> Is it possible to exchange data between DPDK processes and regular
> userspace processes via some shared mem or IPC mechanism? I am not sure if
> the SW ring buffers that DPDK provides can be used in this context?

You can put extra threads in DPDK processes... the DPDK timer does this for 
example. Or you can pass stuff around... they have some example apps which 
have a master app and slave apps as separate Linux processes which can 
exchange data using the rings.

> Please let me know if others have come across this. Any help from the DPDK
> community would be greatly appreciated :)

Yes, check through the various sample apps and see if there's something you 
can borrow from them. Good luck!

Matthew.

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

* Re: [dpdk-dev] IPC/message passing between DPDK application and non-DPDK userspace application
  2014-10-18 17:38 ` Matthew Hall
@ 2014-10-20 14:41   ` Kamraan Nasim
  0 siblings, 0 replies; 3+ messages in thread
From: Kamraan Nasim @ 2014-10-20 14:41 UTC (permalink / raw)
  To: Matthew Hall; +Cc: dev

Thank you Matthew.

On closer inspection, I see that DPDK is simply using pthreads and
pthread_get/set_affinity() to bind to particular cores(as specified in
coremask) so no real magic there as you said...

Looking at the load_balancer app for inspiration.

--Kam

On Sat, Oct 18, 2014 at 1:38 PM, Matthew Hall <mhall@mhcomputing.net> wrote:

> On Fri, Oct 17, 2014 at 10:14:50PM -0400, Kamraan Nasim wrote:
> > I have a DPI daemon running in userspace which uses libpcap for packet RX
> > that I would like to replace with DPDK ethernet PMD. However it is not
> > feasible to convert the entire application to run within the DPDK
> framework
> > which is why I would like to split packet RX to use DPDK and have my
> > applications higher order functions continue using Linux pthread.
>
> The DPDK's lcore threads are just Linux pthreads bound onto specific cores.
> They aren't doing any secret stuff there really.
>
> So you could configure the DPDK to do stuff on some cores, and do your own
> stuff on other cores using the DPDK's "coremask" setting to say which
> cores it
> should launch itself on.
>
> > Is it possible to exchange data between DPDK processes and regular
> > userspace processes via some shared mem or IPC mechanism? I am not sure
> if
> > the SW ring buffers that DPDK provides can be used in this context?
>
> You can put extra threads in DPDK processes... the DPDK timer does this for
> example. Or you can pass stuff around... they have some example apps which
> have a master app and slave apps as separate Linux processes which can
> exchange data using the rings.
>
> > Please let me know if others have come across this. Any help from the
> DPDK
> > community would be greatly appreciated :)
>
> Yes, check through the various sample apps and see if there's something you
> can borrow from them. Good luck!
>
> Matthew.
>

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

end of thread, other threads:[~2014-10-20 14:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-18  2:14 [dpdk-dev] IPC/message passing between DPDK application and non-DPDK userspace application Kamraan Nasim
2014-10-18 17:38 ` Matthew Hall
2014-10-20 14:41   ` Kamraan Nasim

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/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 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


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