<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno gio 14 apr 2022 alle ore 21:01 Dmitry Kozlyuk <<a href="mailto:dmitry.kozliuk@gmail.com">dmitry.kozliuk@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">2022-04-14 10:20 (UTC+0200), Antonio Di Bacco:<br>
[...]<br>
> Ok, after having a look to memif I managed to exchange the fd between the<br>
> two processes and it works.<br>
> Anyway the procedure seems a little bit clunky and I think I'm going to use<br>
> the new SYSCALL pidfd_getfd<br>
> to achieve the same result. In your opinion this method (getfd_pidfd)<br>
> could also work if the two DPDK processes<br>
> are inside different docker containers?<br>
<br>
Honestly, I've just learned about pidfd_getfd() from you.<br>
But I know that containers use PID namespaces, so there's a question<br>
how you will obtain the pidfd of a process in another container.<br>
<br>
In general, any method of sharing FD will work.<br>
Remember that you also need offset and size.<br>
Given that some channel is required to share those,<br>
I think Unix domain socket is still the preferred way.<br>
<br>
> Or is there another mechanims like using handles to hugepages present in<br>
> the filesystem to share between two<br>
> different containers?<br>
<br>
FD is needed for mmap().<br>
You need to either pass the FD or open() the same hugepage file by path.<br>
I advise against using paths because they are not a part of DPDK API contract.<br></blockquote><div><br></div><div>Thank you very much Dmitry, your answers are always enlightening.</div><div>I'm going to ask a different question on the <a href="http://dpdk.org">dpdk.org</a> about the best practice to share memory between two dpdk processes running in different containers. </div></div></div>