aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Lettieri <g.lettieri@iet.unipi.it>2012-05-09 12:17:15 +0200
committerBen Pfaff <blp@nicira.com>2012-05-16 10:00:44 -0700
commit776cf91b42f631b4929fffe8ddd2aa06b40ea24c (patch)
tree6a8ed6302fb448a7c2a2efb08791b1b07a10da91
parentec386d857c9c03374347141b7c8c76bd98b8fa49 (diff)
dpif-netdev: allow for proper destruction of netdev datapaths
Until now, bridges with datapath_type=netdev did not destroy the datapath when deleted. In particular, the tap device implementing the internal interface was not close()d, and therefore the tap persists until ovs-vswitchd exit()s. This behaviour was caused by the missing callback for 'enumerate' in the dpif-netdev class. Without this callback 'bridge_reconfigure' failed to realize that there are datapaths with no bridge, and thus cannot destroy them. Providing an 'enumerate' callback fixes this. Signed-off-by: Giuseppe Lettieri <g.lettieri@iet.unipi.it> Signed-off-by: Ben Pfaff <blp@nicira.com>
-rw-r--r--AUTHORS1
-rw-r--r--lib/dpif-netdev.c13
2 files changed, 13 insertions, 1 deletions
diff --git a/AUTHORS b/AUTHORS
index 8d3c172f..a5b522fc 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -19,6 +19,7 @@ Dominic Curran dominic.curran@citrix.com
Edward Tomasz NapieraƂa trasz@freebsd.org
Ethan Jackson ethan@nicira.com
Gaetano Catalli gaetano.catalli@gmail.com
+Giuseppe Lettieri g.lettieri@iet.unipi.it
Glen Gibb grg@stanford.edu
Hao Zheng hzheng@nicira.com
Ian Campbell Ian.Campbell@citrix.com
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 2c416e35..1dc98171 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -167,6 +167,17 @@ get_dp_netdev(const struct dpif *dpif)
return dpif_netdev_cast(dpif)->dp;
}
+static int
+dpif_netdev_enumerate(struct sset *all_dps)
+{
+ struct shash_node *node;
+
+ SHASH_FOR_EACH(node, &dp_netdevs) {
+ sset_add(all_dps, node->name);
+ }
+ return 0;
+}
+
static struct dpif *
create_dpif_netdev(struct dp_netdev *dp)
{
@@ -1329,7 +1340,7 @@ dp_netdev_execute_actions(struct dp_netdev *dp,
const struct dpif_class dpif_netdev_class = {
"netdev",
- NULL, /* enumerate */
+ dpif_netdev_enumerate,
dpif_netdev_open,
dpif_netdev_close,
dpif_netdev_destroy,