Discussion:
[dpdk-dev] IPC/message passing between DPDK application and non-DPDK userspace application
(too old to reply)
Kamraan Nasim
2014-10-18 02:14:50 UTC
Permalink
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
Matthew Hall
2014-10-18 17:38:33 UTC
Permalink
Post by Kamraan Nasim
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.
Post by Kamraan Nasim
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.
Post by Kamraan Nasim
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.
Kamraan Nasim
2014-10-20 14:41:05 UTC
Permalink
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
Post by Kamraan Nasim
Post by Kamraan Nasim
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
Post by Kamraan Nasim
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.
Post by Kamraan Nasim
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
Post by Kamraan Nasim
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.
Post by Kamraan Nasim
Please let me know if others have come across this. Any help from the
DPDK
Post by Kamraan Nasim
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.
Continue reading on narkive:
Loading...