[ovs-dev] [PATCH] ofproto-dpif: Delete system tunnel interface when remove ovs bridge

juyan at redhat.com juyan at redhat.com
Wed Oct 25 03:41:27 UTC 2017


When there is only one bridge,create tunnel in the bridge,
then delete the bridge directly. the system tunnel interface
still in.

Cause of only one bridge, backer->refcount values 1, when
delete bridge, "close_dpif_backer" will delete the backer,
so type_run will return directly, doesn't delete the interface.
This patch delete the system interface before free the backer.

Fixes: 921c370a9df5 ("dpif-netlink: Probe for out-of-tree tunnels, decides used interface")
Signed-off-by: JunhanYan <juyan at redhat.com>
---
 ofproto/ofproto-dpif.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 43d670a..72993a4 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -646,6 +646,8 @@ dealloc(struct ofproto *ofproto_)
 static void
 close_dpif_backer(struct dpif_backer *backer, bool del)
 {
+    struct simap_node *node;
+
     ovs_assert(backer->refcount > 0);
 
     if (--backer->refcount) {
@@ -654,6 +656,9 @@ close_dpif_backer(struct dpif_backer *backer, bool del)
 
     udpif_destroy(backer->udpif);
 
+    SIMAP_FOR_EACH (node, &backer->tnl_backers) {
+        dpif_port_del(backer->dpif, u32_to_odp(node->data));
+    }
     simap_destroy(&backer->tnl_backers);
     ovs_rwlock_destroy(&backer->odp_to_ofport_lock);
     hmap_destroy(&backer->odp_to_ofport_map);
-- 
2.9.5



More information about the dev mailing list