Il giorno gio 14 apr 2022 alle ore 21:01 Dmitry Kozlyuk < dmitry.kozliuk@gmail.com> ha scritto: > 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. > Thank you very much Dmitry, your answers are always enlightening. I'm going to ask a different question on the dpdk.org about the best practice to share memory between two dpdk processes running in different containers.