<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:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@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:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:"\@SimSun";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:12.0pt;
font-family:SimSun;
mso-fareast-language:ZH-CN;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
font-size:12.0pt;
font-family:SimSun;
mso-fareast-language:ZH-CN;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;
mso-fareast-language:ZH-CN;}
span.EmailStyle22
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
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-GB" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-IE" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">It should be theoretically possible, but it is not supported in DPDK and I suspect be a large bit of work to implement.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-IE" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-IE" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">I would suggest you look into alternatives here. For example, the easiest solution I can think of here is to use a "dummy" primary process,
which initializes the devices and then just "goes to sleep" and does nothing other than manage the memory mapping requests etc. for secondary processes. All ovs-vswitchd processes could then be made to run as secondaries, so that if one crashes there are no
complications on restart.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-IE" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-IE" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">/Bruce<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-IE" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">
</span><span lang="ZH-CN" style="font-size:11.0pt">赖香武</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> <15310488637@163.com>
<br>
<b>Sent:</b> Friday, November 5, 2021 2:53 AM<br>
<b>To:</b> Burakov, Anatoly <anatoly.burakov@intel.com><br>
<b>Cc:</b> David Marchand <david.marchand@redhat.com>; users <users@dpdk.org>; Richardson, Bruce <bruce.richardson@intel.com><br>
<b>Subject:</b> Re:RE: Re:RE: Aboud DPDK Multi-Process<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black">Thank you for your answer. <o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black">I have a question, how to enable the new and old dpdk processes to initialize (manage) the same device?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black">Is this theoretically feasible?<o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p style="margin:0cm"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black">thanks.<o:p></o:p></span></p>
</div>
<p style="margin:0cm"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black"><o:p> </o:p></span></p>
<p><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black">At 2021-11-04 23:04:31, "Burakov, Anatoly" <<a href="mailto:anatoly.burakov@intel.com">anatoly.burakov@intel.com</a>> wrote:<o:p></o:p></span></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm" id="isReplyContent">
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Hi,</span><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"> </span><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">It does not become primary process. It’s not possible with current API.
I mean, you can try, but mot probably it simply will not work and cause things to break. This is not a supported use case.</span><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"> </span><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Thanks,</span><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Anatoly</span><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"> </span><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black"><o:p></o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">
</span><span lang="ZH-CN" style="font-size:11.0pt;color:black">赖香武</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"> <<a href="mailto:15310488637@163.com">15310488637@163.com</a>>
<br>
<b>Sent:</b> Thursday, November 4, 2021 1:54 PM<br>
<b>To:</b> Burakov, Anatoly <<a href="mailto:anatoly.burakov@intel.com">anatoly.burakov@intel.com</a>><br>
<b>Cc:</b> David Marchand <<a href="mailto:david.marchand@redhat.com">david.marchand@redhat.com</a>>; users <<a href="mailto:users@dpdk.org">users@dpdk.org</a>>; Richardson, Bruce <<a href="mailto:bruce.richardson@intel.com">bruce.richardson@intel.com</a>><br>
<b>Subject:</b> Re:RE: Aboud DPDK Multi-Process</span><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black"><o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black"> <o:p></o:p></span></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black">Thank you for all your answer.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black">I asked this question because I want to use dual processes to complete the hot upgrade of ovs-vswitchd.
When ovs-dpdk starts, rte_eal_init will be called to complete dpdk initialization. <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black">The old process dpdk uses primary to start, and the new process dpdk uses secondary to start and upgrade.
After completion, the old process exits, that is, the primary exits. At this time, how does the secondary process become the primary process without disconnecting the network?<o:p></o:p></span></p>
</div>
<p style="margin:0cm"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black"> <o:p></o:p></span></p>
<p style="margin:0cm"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black"> <o:p></o:p></span></p>
<p style="margin:0cm"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black"> <o:p></o:p></span></p>
<p style="margin:0cm"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black"> <o:p></o:p></span></p>
<div>
<p style="margin:0cm"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black">--<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="ZH-CN" style="font-size:10.5pt;color:black">它山之石,可以攻玉。</span><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<p style="margin:0cm"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black"> <o:p></o:p></span></p>
<pre><span style="color:black"><br><span lang="ZH-CN">在</span> 2021-11-04 17:41:02<span lang="ZH-CN">,</span>"Burakov, Anatoly" <<a href="mailto:anatoly.burakov@intel.com">anatoly.burakov@intel.com</a>> <span lang="ZH-CN">写道:</span><o:p></o:p></span></pre>
<pre><span style="color:black">>> -----Original Message-----<o:p></o:p></span></pre>
<pre><span style="color:black">>> From: David Marchand <<a href="mailto:david.marchand@redhat.com">david.marchand@redhat.com</a>><o:p></o:p></span></pre>
<pre><span style="color:black">>> Sent: Thursday, November 4, 2021 8:30 AM<o:p></o:p></span></pre>
<pre><span style="color:black">>> To: <span lang="ZH-CN">赖香武</span> <<a href="mailto:15310488637@163.com">15310488637@163.com</a>><o:p></o:p></span></pre>
<pre><span style="color:black">>> Cc: users <<a href="mailto:users@dpdk.org">users@dpdk.org</a>>; Burakov, Anatoly<o:p></o:p></span></pre>
<pre><span style="color:black">>> <<a href="mailto:anatoly.burakov@intel.com">anatoly.burakov@intel.com</a>>; Richardson, Bruce<o:p></o:p></span></pre>
<pre><span style="color:black">>> <<a href="mailto:bruce.richardson@intel.com">bruce.richardson@intel.com</a>><o:p></o:p></span></pre>
<pre><span style="color:black">>> Subject: Re: Aboud DPDK Multi-Process<o:p></o:p></span></pre>
<pre><span style="color:black">>> <o:p></o:p></span></pre>
<pre><span style="color:black">>> On Thu, Nov 4, 2021 at 9:21 AM <span lang="ZH-CN">赖香武</span> <<a href="mailto:15310488637@163.com">15310488637@163.com</a>> wrote:<o:p></o:p></span></pre>
<pre><span style="color:black">>> ><o:p></o:p></span></pre>
<pre><span style="color:black">>> > Hello, I have a question about dpdk multi-process. After starting the<o:p></o:p></span></pre>
<pre><span style="color:black">>> > primary process and the secondary process, when the current primary<o:p></o:p></span></pre>
<pre><span style="color:black">>> > process exits, how does the secondary process become a new primary<o:p></o:p></span></pre>
<pre><span style="color:black">>> > process to make the program continue? Hope to get your answer, thank<o:p></o:p></span></pre>
<pre><span style="color:black">>> > you<span lang="ZH-CN">!</span><o:p></o:p></span></pre>
<pre><span style="color:black">>> <o:p></o:p></span></pre>
<pre><span style="color:black">>> Not sure why you need this, but DPDK won't do for you.<o:p></o:p></span></pre>
<pre><span style="color:black">>> <o:p></o:p></span></pre>
<pre><span style="color:black">>> The process type is decided once at DPDK init, and that is something that<o:p></o:p></span></pre>
<pre><span style="color:black">>> affects how your program behaves after.<o:p></o:p></span></pre>
<pre><span style="color:black">>> Switching type while running would break assumptions in the DPDK drivers<o:p></o:p></span></pre>
<pre><span style="color:black">>> and libraries.<o:p></o:p></span></pre>
<pre><span style="color:black">>> <o:p></o:p></span></pre>
<pre><span style="color:black">>> One thing that comes to mind, is that you could try to call<o:p></o:p></span></pre>
<pre><span style="color:black">>> rte_eal_cleanup() and call rte_eal_init() again.<o:p></o:p></span></pre>
<pre><span style="color:black">>> This is probably something that is not tested (so I'd expect issues, maybe<o:p></o:p></span></pre>
<pre><span style="color:black">>> leaks etc..).<o:p></o:p></span></pre>
<pre><span style="color:black">>> <o:p></o:p></span></pre>
<pre><span style="color:black">>> But then, you probably want to restart your process entirely.<o:p></o:p></span></pre>
<pre><span style="color:black">> <o:p></o:p></span></pre>
<pre><span style="color:black">>[[AB]] <o:p></o:p></span></pre>
<pre><span style="color:black">>Calling rte_eal_init() twice would be a terrible idea, because not everything (not even remotely!) gets cleaned up with rte_eal_cleanup(), and a lot of stuff is allocated statically.<o:p></o:p></span></pre>
<pre><span style="color:black">> <o:p></o:p></span></pre>
<pre><span style="color:black">>So, as far as I'm concerned, this usage scenario is considered to be unsupported.<o:p></o:p></span></pre>
<pre><span style="color:black">> <o:p></o:p></span></pre>
<pre><span style="color:black">>> <o:p></o:p></span></pre>
<pre><span style="color:black">>> <o:p></o:p></span></pre>
<pre><span style="color:black">>> --<o:p></o:p></span></pre>
<pre><span style="color:black">>> David Marchand<o:p></o:p></span></pre>
<pre><span style="color:black">> <o:p></o:p></span></pre>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black"> <o:p></o:p></span></p>
<p><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black"><br>
<o:p></o:p></span></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<p><br>
<o:p></o:p></p>
</div>
</div>
</body>
</html>