[ovs-dev] [add-remove 7/7] vswitchd: Better tolerate changes in datapath ports.

Jesse Gross jesse at nicira.com
Tue Sep 28 22:54:20 UTC 2010


On Tue, Sep 28, 2010 at 11:58 AM, Ben Pfaff <blp at nicira.com> wrote:
> Until now, a command that removed and added ports in a single change to
> the database, e.g.:
>        ovs-vsctl del-port br0 vif1.0 -- add-port br0 vif2.0
> typically failed, because of this sequence of events:
>
> 1. Bridge code removes vif1.0 from br0.
> 2. Bridge code adds vif2.0 to br0.
> 3. ofproto_run() receives kernel notification that vif1.0 was deleted, so
>   it notifies the bridge by calling back to bridge_port_changed_ofhook_cb,
>   which sees that it has an interface with the specified port number, and
>   deletes it.  Oops--this is where the problem occurs.  For completeness:
> 4. ofproto_run() receives kernel notification that vif2.0 was added, so
>   it notifies the bridge by calling back to ,
>   which sees that it has no interface with the specified port number, and
>   does nothing.
>
> This commit fixes the problem by adding the ifindex to the callbacks.  In
> step 3, bridge_port_changed_ofhook_cb sees that the port that was deleted
> was not the same as the one that it has in its interface and ignores it.
>
> Thanks to Jesse Gross for identifying the problem.
>
> Bug #3671.

I've only skimmed through this set very quickly, so this isn't a full
review yet and it is possible that I missed something.  However,
ifindex is only available for devices that exist in the system but not
virtual ports that we create.  Therefore, won't this reject all
virtual ports because they always return -EOPNOTSUPP when their
ifindex is requested?




More information about the dev mailing list