All of lore.kernel.org
 help / color / mirror / Atom feed
* VLAN issue with NICEnabled property
@ 2022-04-15 12:28 Jiaqing Zhao
  2022-05-11 20:31 ` Johnathan Mantey
  0 siblings, 1 reply; 3+ messages in thread
From: Jiaqing Zhao @ 2022-04-15 12:28 UTC (permalink / raw)
  To: openbmc; +Cc: wak

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.

But there is a question of this proposal, how to set nicEnabled property when creating the interface? Using "ActivationPolicy=down" still has the issue mentioned in https://github.com/openbmc/phosphor-networkd/commit/26275a3f2ecffe62646b65646c00a9e56c75bff8, 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: VLAN issue with NICEnabled property
  2022-04-15 12:28 VLAN issue with NICEnabled property Jiaqing Zhao
@ 2022-05-11 20:31 ` Johnathan Mantey
  2022-05-12  8:09   ` Jiaqing Zhao
  0 siblings, 1 reply; 3+ messages in thread
From: Johnathan Mantey @ 2022-05-11 20:31 UTC (permalink / raw)
  To: Jiaqing Zhao, openbmc; +Cc: wak


[-- Attachment #1.1.1: Type: text/plain, Size: 2517 bytes --]

On 4/15/22 05:28, Jiaqing Zhao wrote:
> 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.

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.

>
> But there is a question of this proposal, how to set nicEnabled property when creating the interface? Using "ActivationPolicy=down" still

What do you mean by "creating the interface"?
Are you referring to what the systemd-networkd service will do?
Are you referring to how phosphor-network captures the network 
configuration in the data structures used to manage systemd.network 
configuration files?

> has the issue mentioned inhttps://github.com/openbmc/phosphor-networkd/commit/26275a3f2ecffe62646b65646c00a9e56c75bff8, 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

-- 
Johnathan Mantey
Senior Software Engineer
*azad te**chnology partners*
Contributing to Technology Innovation since 1992
Phone: (503) 712-6764
Email: johnathanx.mantey@intel.com


[-- Attachment #1.1.2: Type: text/html, Size: 4029 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: VLAN issue with NICEnabled property
  2022-05-11 20:31 ` Johnathan Mantey
@ 2022-05-12  8:09   ` Jiaqing Zhao
  0 siblings, 0 replies; 3+ messages in thread
From: Jiaqing Zhao @ 2022-05-12  8:09 UTC (permalink / raw)
  To: Johnathan Mantey, openbmc; +Cc: wak

On 2022-05-12 04:31, Johnathan Mantey wrote:
> On 4/15/22 05:28, Jiaqing Zhao wrote:
>> 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.
> 
> 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.

Another issue I met is the MAC address specified in systemd.network config is also lost after reboot as it is Unmanaged by systemd. Using ActivationPolicy will also solve this.

>>
>> But there is a question of this proposal, how to set nicEnabled property when creating the interface? Using "ActivationPolicy=down" still
> 
> What do you mean by "creating the interface"?
> Are you referring to what the systemd-networkd service will do?
> Are you referring to how phosphor-network captures the network configuration in the data structures used to manage systemd.network configuration files?

I mean creating the EthernetInterface object in phosphor-networkd. The value on DBus is initialized by querying the org.freedesktop.network1 DBus to see if the interface's AdministrativeState is unmanaged. This is not applicable when using ActivationPolicy.

The Redfish spec says the InterfaceEnabled (NICEnabled mapped to) property is "An indication of whether this interface is enabled". I'm not sure which one will be better? Querying the IFF_UP flag or simply read the ActivationPolicy from config file?

>> has the issue mentioned inhttps://github.com/openbmc/phosphor-networkd/commit/26275a3f2ecffe62646b65646c00a9e56c75bff8, 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
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-12  8:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-15 12:28 VLAN issue with NICEnabled property Jiaqing Zhao
2022-05-11 20:31 ` Johnathan Mantey
2022-05-12  8:09   ` Jiaqing Zhao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.