<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">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.<div><br></div><div><div>
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><b>Ryan Wilson</b><br><i style="font-weight: normal; ">Member of Technical Staff</i><br><a href="mailto:wryan@vmware.com">wryan@vmware.com</a><br>3401 Hillview Avenue, Palo Alto, CA<br>650.427.1511 Office<br>916.588.7783 Mobile</div>
</div>
<br><div><div>On May 4, 2014, at 4:18 PM, Joe Stringer &lt;<a href="mailto:joestringer@nicira.com">joestringer@nicira.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 3 May 2014 02:56, Ben Pfaff <span dir="ltr">&lt;<a href="mailto:blp@nicira.com" target="_blank">blp@nicira.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">







<div>On Fri, May 02, 2014 at 01:13:43PM +1200, Joe Stringer wrote:<br>
&gt; Previously, it was possible to open a netdevice as one type, then<br>
&gt; proceed to open it as a different type without first closing it. The<br>
&gt; bridge code would expect it to be opened as the latter type and try to<br>
&gt; apply configuration to it. This patch catches the problem earlier by<br>
&gt; detecting the case in netdev_open() and logging a warning message.<br>
&gt;<br>
&gt; Bug #1198386.<br>
&gt;<br>
&gt; Signed-off-by: Joe Stringer &lt;<a href="mailto:joestringer@nicira.com" target="_blank">joestringer@nicira.com</a>&gt;<br>
&gt; ---<br>
&gt; I'm not sure if this case is meant to be possible, but I've observed it,<br>
&gt; and this patch makes the error more obvious in the logs.<br>
<br>
</div>You might want to test this against usage patterns that would try to<br>
reuse a netdev name quickly for a different kind of device. &nbsp;e.g.:<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; # Create myport as internal port.<br>
&nbsp; &nbsp; &nbsp; &nbsp; ovs-vsctl add-port br0 myport -- set interface myport type=internal<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; # Change myport to a tunnel.<br>
&nbsp; &nbsp; &nbsp; &nbsp; ovs-vsctl set interface myport type=gre options:remote_ip=1.2.3.4<br>
<br>
(I believe that this currently works. &nbsp;It should; it used to.)<br></blockquote><div><br></div><div>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.</div>


<div><br></div><div><br></div><div>A full example which I would expect to work, but doesn't:</div><div><br></div><div>* ovs-vsctl add-port br0 p0 -- set int p0 type=gre options:remote_ip=1.2.3.4</div><div>* ovs-vsctl add-port br0 p1 -- set int p1 type=internal<br>


</div>* ovs-vsctl set int p1 type=gre options:remote_ip=1.2.3.4<div>*&nbsp;ovs-vsctl set int p1 type=internal</div><div><br></div><div>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.</div>


<div><br></div><div><br></div><div>I've proposed a fix for this bug here:&nbsp;</div><div><a href="https://urldefense.proofpoint.com/v1/url?u=http://openvswitch.org/pipermail/dev/2014-May/039755.html&amp;k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&amp;r=TfBS78Vw3dzttvXidhbffg%3D%3D%0A&amp;m=av4pG3HTLdorDKsrLxxaUUZHLH%2Bm5WyoFfhanzvZx4E%3D%0A&amp;s=4aa7e68890b46bf389c587e83dfd25f54d5cbd9cf52cf1f35b46179447655b4d">http://openvswitch.org/pipermail/dev/2014-May/039755.html</a><br>

</div></div></div></div>
_______________________________________________<br>dev mailing list<br><a href="mailto:dev@openvswitch.org">dev@openvswitch.org</a><br>https://urldefense.proofpoint.com/v1/url?u=http://openvswitch.org/mailman/listinfo/dev&amp;k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&amp;r=TfBS78Vw3dzttvXidhbffg%3D%3D%0A&amp;m=av4pG3HTLdorDKsrLxxaUUZHLH%2Bm5WyoFfhanzvZx4E%3D%0A&amp;s=867aea33cbeaee0ce83bec77ca97321a68419328a264d09bf3c60698f50f89e0<br></blockquote></div><br></div></body></html>