<html 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=us-ascii">
<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:Aptos;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:12.0pt;
        font-family:"Aptos",sans-serif;
        mso-ligatures:standardcontextual;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        font-size:12.0pt;
        font-family:"Aptos",sans-serif;
        mso-ligatures:standardcontextual;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Aptos",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:815686172;
        mso-list-type:hybrid;
        mso-list-template-ids:1851837318 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style>
</head>
<body lang="EN-US" link="#467886" vlink="#96607D" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Query regarding phosphor-networkd:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">With the openbmc version 2.18, I have written a custom software module that registers a callback to monitor the Dbus interface signals: “InterfacesAdded” and “InterfacesRemoved” from the phosphor-networkd.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I tried switching my ethernet interface eth0 on AST2600 SoC from DHCP to Static IP.
<br>
<br>
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I could assign static IP successfully to eth0 interface and DHCP IP resource is released. But, I have several observations:<o:p></o:p></span></p>
<ol style="margin-top:0in" start="1" type="1">
<li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1"><span style="font-size:11.0pt">I see “InterfaceAdded” Dbus signal emitted
<b>first</b> from the phosphor-network for DHCP->Static transition. I believe it represents a creation of a dbus static IP object, interface, and properties.<o:p></o:p></span></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1"><span style="font-size:11.0pt">Followed with it, “InterfaceRemoved” signal is emitted from the phosphor-network that deletes existing DHCP IP object.<o:p></o:p></span></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1"><span style="font-size:11.0pt">In the signal callback handlers, I have a custom implementation that consists of a mutex lock for my database that is acquired when the “InterfaceRemoved”
 signal is received and same lock is released when “InterfaceAdded” signal is received. Additionally, I did several database updates based on the signal received.<o:p></o:p></span></li></ol>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Now, I see an issue where this database lock is always acquired after DHCP->Static transition. Additionally, some of the database properties are corrupted. After root cause analysis for both the issues, i
 concluded that it is due to the order of the signals mentioned in point 1 and 2. Consistently, I see a similar order of the signals from phosphor-network i.e. “InterfacAdded” first followed by "InterfaceRemoved”<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I want to understand if there is a mechanism to control this order of the “InterfaceAdded” and “InterfaceRemoved” signals from phosphor-network to achieve consistent behavior align to my expectations. My expectation
 in this case is “IntefaceRemoved” shall always be emitted first and then “InterfaceAdded”.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Pankaj Patil<o:p></o:p></span></p>
</div>
<!-- Confidentiality notice banner -->
<table border="0" cellspacing="0" cellpadding="0" align="left" width="100%">
<tbody>
<tr>
<!-- Remove the next line if you don't want the Gray bar on the left side -->
<td style="background:#313131;padding:5pt 2pt 5pt 2pt"></td>
<td width="100%" cellpadding="7px 6px 7px 15px" style="background:#fbfbfb;padding:5pt 4pt 5pt 12pt;word-wrap:break-word">
<div style="color:#222222; font-family: Arial, italic; font-size: 7pt;"><!-- Adjust the font family and size here --><span style="color:#222; font-weight:bold;">CONFIDENTIALITY NOTICE:</span> The information contained in this message is confidential or protected
 by law. If you are not the intended recipient please contact the sender and delete this message. Any unauthorized copying of this message or unauthorized distribution of the information contained herein is prohibited.
</div>
</td>
</tr>
</tbody>
</table>
<br>
</body>
</html>