dpif: Fix initialization order.
authorPravin B Shelar <pshelar@nicira.com>
Mon, 24 Nov 2014 23:07:23 +0000 (15:07 -0800)
committerPravin B Shelar <pshelar@nicira.com>
Tue, 25 Nov 2014 01:12:20 +0000 (17:12 -0800)
OVS router depends on tnl_conf_seq and all tunnel related
components should be initialized before registering dpif
implementations.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
lib/dpif.c
lib/netdev.c

index 33e32ef..d6de5a1 100644 (file)
@@ -39,6 +39,7 @@
 #include "packets.h"
 #include "poll-loop.h"
 #include "route-table.h"
+#include "seq.h"
 #include "shash.h"
 #include "sset.h"
 #include "timeval.h"
@@ -104,6 +105,9 @@ static void log_execute_message(struct dpif *, const struct dpif_execute *,
 static void log_flow_get_message(const struct dpif *,
                                  const struct dpif_flow_get *, int error);
 
+/* Incremented whenever tnl route, arp, etc changes. */
+struct seq *tnl_conf_seq;
+
 static void
 dp_initialize(void)
 {
@@ -112,14 +116,16 @@ dp_initialize(void)
     if (ovsthread_once_start(&once)) {
         int i;
 
-        for (i = 0; i < ARRAY_SIZE(base_dpif_classes); i++) {
-            dp_register_provider(base_dpif_classes[i]);
-        }
+        tnl_conf_seq = seq_create();
         dpctl_unixctl_register();
         tnl_port_map_init();
         tnl_arp_cache_init();
         route_table_register();
 
+        for (i = 0; i < ARRAY_SIZE(base_dpif_classes); i++) {
+            dp_register_provider(base_dpif_classes[i]);
+        }
+
         ovsthread_once_done(&once);
     }
 }
index e4e3b18..a6ab141 100644 (file)
@@ -77,9 +77,6 @@ static struct ovs_mutex netdev_class_mutex OVS_ACQ_BEFORE(netdev_mutex);
 static struct hmap netdev_classes OVS_GUARDED_BY(netdev_class_mutex)
     = HMAP_INITIALIZER(&netdev_classes);
 
-/* Incremented whenever tnl route, arp, etc changes. */
-struct seq *tnl_conf_seq;
-
 struct netdev_registered_class {
     /* In 'netdev_classes', by class->type. */
     struct hmap_node hmap_node OVS_GUARDED_BY(netdev_class_mutex);
@@ -155,7 +152,6 @@ netdev_initialize(void)
 #endif
         netdev_dpdk_register();
 
-        tnl_conf_seq = seq_create();
         ovsthread_once_done(&once);
     }
 }