<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div style="margin: 0;">Thank you for your answer. </div><div style="margin: 0;"><div style="margin: 0;">I have a question, how to enable the new and old dpdk processes to initialize (manage) the same device?</div><div style="margin: 0;">Is this theoretically feasible?</div></div><div style="margin: 0;"><br></div><div style="position:relative;zoom:1"><p style="margin: 0">thanks.</p><div style="clear:both"></div></div><div id="divNeteaseMailCard"></div><p style="margin: 0;"><br></p><p>At 2021-11-04 23:04:31, "Burakov, Anatoly" <anatoly.burakov@intel.com> wrote:</p><blockquote id="isReplyContent" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">



<style></style>


<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Anatoly<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">
</span><span lang="ZH-CN" style="font-size:11.0pt">赖香武</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> <15310488637@163.com>
<br>
<b>Sent:</b> Thursday, November 4, 2021 1:54 PM<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: 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 all your answer.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><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"><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:0in"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black"><o:p> </o:p></span></p>
<p style="margin:0in"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black"><o:p> </o:p></span></p>
<p style="margin:0in"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black"><o:p> </o:p></span></p>
<p style="margin:0in"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black"><o:p> </o:p></span></p>
<div>
<p style="margin:0in"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black">--<o:p></o:p></span></p>
<p class="MsoNormal"><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:0in"><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="margin-bottom:12.0pt"><o:p> </o:p></p>
<p><br>
 <o:p></o:p></p>
</div>
</div>


</blockquote></div><br><br><span title="neteasefooter"><p><br/> </p></span>