bridge: When ports disappear from a datapath, add them back.
Before commit
2a73b1d73d4bdb (bridge: Reconfigure in single pass.), if a
port disappeared, for one reason or another, from a datapath, the next
bridge reconfiguration pass would notice and, if the port was still
configured in the database, add the port back to the datapath. That
commit, however, removed the logic from bridge_refresh_ofp_port() that
did that and failed to add the same logic to the replacement function
bridge_delete_or_reconfigure_ports(). This commit fixes the problem.
To see this problem on a Linux kernel system:
ovs-vsctl add-br br0 # 1
tunctl -t tap # 2
ovs-vsctl add-port br0 tap # 3
ovs-dpctl show # 4
tunctl -d tap # 5
ovs-dpctl show # 6
tunctl -t tap # 7
ovs-vsctl del-port tap -- add-port br0 tap # 8
ovs-dpctl show # 9
Steps 1-4 create a bridge and a tap and add it to the bridge and
demonstrate that the tap is part of the datapath. Step 5 and 6 delete
the tap and demonstrate that it has therefore disappeared from the
datapath. Step 7 recreates a tap with the same name, and step 8
forces ovs-vswitchd to reconfigure. Step 9 shows the effect of the
fix: without the fix, the new tap is not added back to the datapath;
with this fix, it is.
Special thanks to Gurucharan Shetty <gshetty@nicira.com> for finding a
simple reproduction case and then bisecting to find the commit that
introduced the problem.
Bug #1238467.
Reported-by: Ronald Lee <ronaldlee@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>