<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    On 4/15/22 05:28, Jiaqing Zhao wrote:<br>
    <blockquote type="cite"
      cite="mid:93ff730f-ee5c-b5a1-9e14-873248ff969f@linux.intel.com">
      <pre class="moz-quote-pre" wrap="">Hi, all

In phosphor-networkd, setting NICEnabled to false write "Unmanaged=yes" in network configuration file. There was an issue with this property and its VLAN. Reboot bmc after setting NICEnabled to false, its VLAN interfaces disappears, and if set it to true, all previously configured VLANs for this interfaces will be lost.

The reason is, since the interface is set to Unmanaged in config file, systemd-networkd will not configure the interface on boot, including creating VLANs. On the phosphor-networkd side, it creates its interface list from getifaddrs(), as VLAN interfaces are not created, they will not be added to the list. When setting NICEnabled back to true, it rewrites the config file with the VLANs in that list, so no VLAN is written, essentially removes the previously configured VLAN from the system with dangling vlan netdev and config files.

To solve this issue, my proposal is to write "ActivationPolicy=down" when NICEnabled is false, this option tells systemd-networkd not to bring up the interface on boot. But it is still managed, meaning that its VLAN interfaces will be created.</pre>
    </blockquote>
    <br>
    This control was the result of using the Unmanaged entry for
    disabling the NIC. The phosphor-network code needs to change to the
    ActivationPolicy configuration option, IMO.<br>
    <br>
    <blockquote type="cite"
      cite="mid:93ff730f-ee5c-b5a1-9e14-873248ff969f@linux.intel.com">
      <pre class="moz-quote-pre" wrap="">

But there is a question of this proposal, how to set nicEnabled property when creating the interface? Using "ActivationPolicy=down" still </pre>
    </blockquote>
    <br>
    What do you mean by "creating the interface"? <br>
    Are you referring to what the systemd-networkd service will do?<br>
    Are you referring to how phosphor-network captures the network
    configuration in the data structures used to manage systemd.network
    configuration files?<br>
    <br>
    <blockquote type="cite"
      cite="mid:93ff730f-ee5c-b5a1-9e14-873248ff969f@linux.intel.com">
      <pre class="moz-quote-pre" wrap="">has the issue mentioned in <a class="moz-txt-link-freetext" href="https://github.com/openbmc/phosphor-networkd/commit/26275a3f2ecffe62646b65646c00a9e56c75bff8">https://github.com/openbmc/phosphor-networkd/commit/26275a3f2ecffe62646b65646c00a9e56c75bff8</a>, however, unlike Unmanaged interfaces will have is AdministrativeState==managed, a interface that is down has AdministrativeState==configuring, which is also a possible value for interfaces needs to be brought up on boot, though it will become "configured" when it is up.

One idea I came up with is to us configParser to read the ActivationPolicy from config file. Any other ideas will be appreciated.

Thanks,
Jiaqing
</pre>
    </blockquote>
    <br>
    <div class="moz-signature">-- <br>
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <title></title>
      <font color="#1F497D"><font face="Century Gothic">Johnathan Mantey<br>
          <small>Senior Software Engineer</small><br>
          <big><font color="#555555"><small><b>azad te</b><b>chnology
                  partners</b></small><br>
              <small><font color="#1F497D"><small>Contributing to
                    Technology Innovation since 1992</small></font><small><br>
                  <font color="#1F497D">Phone: (503) 712-6764<br>
                    Email: <a href="mailto:johnathanx.mantey@intel.com"
                      class="moz-txt-link-freetext">johnathanx.mantey@intel.com</a></font></small><br>
                <br>
              </small></font></big></font></font> </div>
  </body>
</html>