<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Georgia;
panose-1:2 4 5 2 5 4 5 2 3 3;}
@font-face
{font-family:Lato;}
@font-face
{font-family:Menlo;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hi Kiran –<o:p></o:p></p>
<p class="MsoNormal">It should be possible. DPDK documentation clearly shows two primary processes using memif to communicate.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="mso-margin-bottom-alt:auto;background:#FCFCFC"><b><span style="font-size:15.0pt;font-family:"Georgia",serif;color:#404040">32.2.1. Example: testpmd<o:p></o:p></span></b></p>
<p class="MsoNormal" style="margin-bottom:.25in;line-height:18.0pt;background:#FCFCFC">
<span style="font-size:12.0pt;font-family:"Lato",sans-serif;color:#404040">In this example we run two instances of testpmd application and transmit packets over memif.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:.25in;line-height:18.0pt;background:#FCFCFC">
<span style="font-size:12.0pt;font-family:"Lato",sans-serif;color:#404040">First create </span><span style="font-size:9.0pt;font-family:Menlo;color:#E74C3C;border:solid #E1E4E5 1.0pt;padding:2.0pt;background:white">master</span><span style="font-size:12.0pt;font-family:"Lato",sans-serif;color:#404040"> interface:<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#F8F8F8"><span style="font-size:9.0pt;font-family:Menlo;color:#404040">#./build/app/testpmd -l 0-1
<b>--proc-type=primary --file-prefix=pmd1</b> --vdev=net_memif,role=master -- -i<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#F8F8F8"><span style="font-size:9.0pt;font-family:Menlo;color:#404040"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:.25in;line-height:18.0pt;background:#FCFCFC">
<span style="font-size:12.0pt;font-family:"Lato",sans-serif;color:#404040">Now create </span><span style="font-size:9.0pt;font-family:Menlo;color:#E74C3C;border:solid #E1E4E5 1.0pt;padding:2.0pt;background:white">slave</span><span style="font-size:12.0pt;font-family:"Lato",sans-serif;color:#404040"> interface
(master must be already running so the slave will connect):<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#F8F8F8"><span style="font-size:9.0pt;font-family:Menlo;color:#404040">#./build/app/testpmd -l 2-3
<b>--proc-type=primary --file-prefix=pmd2</b> --vdev=net_memif -- -i<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Kiran Khatke <kirankhatke23may@gmail.com> <br>
<b>Sent:</b> Monday, June 6, 2022 9:24 AM<br>
<b>To:</b> Pathak, Pravin <pravin.pathak@intel.com><br>
<b>Cc:</b> users@dpdk.org<br>
<b>Subject:</b> Re: Memory sharing between two primary processes<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Hi Pravin, <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Both are DPDK application, so want to use DPDK Share memory i.e hugepages.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">How to share memory between two independent (Primary) application? Does memif PMD allows that ? <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Kiran <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Mon, Jun 6, 2022 at 5:58 AM Pathak, Pravin <<a href="mailto:pravin.pathak@intel.com">pravin.pathak@intel.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hi Kiran –<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Can your application create and manage shared memory on it own without using DPDK support ?<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Regards<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Pravin<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b>From:</b> Kiran Khatke <<a href="mailto:kirankhatke23may@gmail.com" target="_blank">kirankhatke23may@gmail.com</a>>
<br>
<b>Sent:</b> Monday, June 6, 2022 2:26 AM<br>
<b>To:</b> <a href="mailto:users@dpdk.org" target="_blank">users@dpdk.org</a><br>
<b>Subject:</b> Memory sharing between two primary processes<o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<p style="margin:0in"><span style="color:#313131">Hi,</span><o:p></o:p></p>
<p style="margin:0in;font-size:1rem;word-spacing:1px"><span style="color:#313131"> </span><o:p></o:p></p>
<p style="margin:0in;font-size:1rem;word-spacing:1px"><span style="color:#313131">Per DPDK Multiprocess, we know that, it is possible to share memory(hugepages) between a primary and secondary Process. Primary process allocates the memory and that is accessible
by the secondary (both are using same "--file-prefix=" parameter).</span><o:p></o:p></p>
<p style="margin:0in;word-spacing:1px"><span style="color:#313131"> </span><o:p></o:p></p>
<p style="margin:0in;font-size:1rem;word-spacing:1px"><span style="color:#313131">There is a need in our application, to have two primary processes (started with different file-prefix) and would like to know the options - To share memory (hugepage) between
two primaries and which can give us better throughputs.</span><o:p></o:p></p>
<p style="margin:0in;word-spacing:1px"><span style="color:#313131"> </span><o:p></o:p></p>
<p style="margin:0in;font-size:1rem;word-spacing:1px"><span style="color:#313131">During exploration, got to know about memif PMD, which allows for DPDK and any other client using memif (DPDK, libmemif) to communicate over shared memory. </span><o:p></o:p></p>
<p style="margin:0in;font-size:1rem;word-spacing:1px"><span style="color:#313131">Do you have any comments about memif performance ? Are there better options over memif to share memory between two primaries ?</span><o:p></o:p></p>
<p style="margin:0in;font-size:1rem;word-spacing:1px"><span style="color:#313131"> </span><o:p></o:p></p>
<p style="margin:0in;font-size:1rem;word-spacing:1px"><span style="color:#313131">Thanks ,</span><o:p></o:p></p>
<p style="margin:0in;font-size:1rem;word-spacing:1px"><span style="color:#313131">Kiran </span><o:p></o:p></p>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</body>
</html>