[ovs-dev] [PATCH 3/3] netdev: Warn on opening netdev as unexpected type.
wryan at vmware.com
Mon May 5 21:18:03 UTC 2014
I've seen this issue before as well when adding RCU locking to xlate. It happens because refs to a netdev still exist (in this case, likely the tunnel has a ref to the netdev) when the main thread tries to delete the netdev. Thus, the netdev never gets deleted and the netdev cannot be recreated with a new type. I tested out the fix and it works with my patch as well.
Member of Technical Staff
wryan at vmware.com
3401 Hillview Avenue, Palo Alto, CA
On May 4, 2014, at 4:18 PM, Joe Stringer <joestringer at nicira.com> wrote:
> On 3 May 2014 02:56, Ben Pfaff <blp at nicira.com> wrote:
> On Fri, May 02, 2014 at 01:13:43PM +1200, Joe Stringer wrote:
> > Previously, it was possible to open a netdevice as one type, then
> > proceed to open it as a different type without first closing it. The
> > bridge code would expect it to be opened as the latter type and try to
> > apply configuration to it. This patch catches the problem earlier by
> > detecting the case in netdev_open() and logging a warning message.
> > Bug #1198386.
> > Signed-off-by: Joe Stringer <joestringer at nicira.com>
> > ---
> > I'm not sure if this case is meant to be possible, but I've observed it,
> > and this patch makes the error more obvious in the logs.
> You might want to test this against usage patterns that would try to
> reuse a netdev name quickly for a different kind of device. e.g.:
> # Create myport as internal port.
> ovs-vsctl add-port br0 myport -- set interface myport type=internal
> # Change myport to a tunnel.
> ovs-vsctl set interface myport type=gre options:remote_ip=18.104.22.168
> (I believe that this currently works. It should; it used to.)
> This case seems to work fine. However, if you start with two tunnel ports, then changing the configuration for one does not always work. This appears to be a long-standing bug.
> A full example which I would expect to work, but doesn't:
> * ovs-vsctl add-port br0 p0 -- set int p0 type=gre options:remote_ip=22.214.171.124
> * ovs-vsctl add-port br0 p1 -- set int p1 type=internal
> * ovs-vsctl set int p1 type=gre options:remote_ip=126.96.36.199
> * ovs-vsctl set int p1 type=internal
> The last step here fails: before this patch, it cannot apply gre settings to the device (even though it is configuring to type internal). With this patch, we see EEXIST and the error message added by this patch. For some reason, having the other gre port around means that p1 is not completely unreferenced before reconfiguration. Subsequently, when we reopen p1 as a different type, we receive the original (gre) netdev. Although ovs-vsctl reflects the change in type, the actual netdev class being used is the gre one.
> I've proposed a fix for this bug here:
> dev mailing list
> dev at openvswitch.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the dev