[ipxe-devel] [PATCH 1/2] Prevent a netdevice (VLAN) to open/close twice.

Wissam Shoukair wissams at mellanox.com
Wed Mar 5 15:21:03 UTC 2014


For the opening issue, you are right, and it’s a more simpler solution.
Regarding the close flow, I now understand what was my mistake.
Thanks.

-----Original Message-----
From: Michael Brown [mailto:mcb30 at ipxe.org] 
Sent: יום ד 05 מרץ 2014 16:57
To: Wissam Shoukair; ipxe-devel at ipxe.org
Subject: Re: [PATCH 1/2] Prevent a netdevice (VLAN) to open/close twice.

On 05/03/14 14:44, Wissam Shoukair wrote:
> I wanted to do this fix (that you attached), but I saw in the patch 
> 8ab2f51997db80c88d098844ad5a9af5736d1c9e (Mark devices as open only if 
> opening succeeds) that this fixed some issue in the netdev_close, so I 
> wanted to go more on the safe side and add 2 more states

The problem addressed by 8ab2f51 was that a failed open would leave the device flagged as open.  My previously-attached patch avoids this problem by clearing the open flag if opening fails.

> also for the following reason:
>
> In the close flow:
> call netdev_close(vlan_dev) ->
>       mark vlan_dev as closed
>       call vlan_close(vlan_dev) ->
>          call netdev_notify(vlan dev)
>               call vlan_sync(trunk_dev) ->
>                     Open vlan because the trunk is open (not yet closed).

netdev_notify(vlan_dev) will call vlan_notify(vlan_dev) which will do nothing, since vlan_notify only acts in response to changes to a trunk device.  vlan_sync() will not be called on this path.

Michael



More information about the ipxe-devel mailing list