Shared memory between two primary DPDK processes
Dmitry Kozlyuk
dmitry.kozliuk at gmail.com
Thu Apr 14 21:01:48 CEST 2022
2022-04-14 10:20 (UTC+0200), Antonio Di Bacco:
[...]
> Ok, after having a look to memif I managed to exchange the fd between the
> two processes and it works.
> Anyway the procedure seems a little bit clunky and I think I'm going to use
> the new SYSCALL pidfd_getfd
> to achieve the same result. In your opinion this method (getfd_pidfd)
> could also work if the two DPDK processes
> are inside different docker containers?
Honestly, I've just learned about pidfd_getfd() from you.
But I know that containers use PID namespaces, so there's a question
how you will obtain the pidfd of a process in another container.
In general, any method of sharing FD will work.
Remember that you also need offset and size.
Given that some channel is required to share those,
I think Unix domain socket is still the preferred way.
> Or is there another mechanims like using handles to hugepages present in
> the filesystem to share between two
> different containers?
FD is needed for mmap().
You need to either pass the FD or open() the same hugepage file by path.
I advise against using paths because they are not a part of DPDK API contract.
More information about the users
mailing list