From: Pravin B Shelar Date: Mon, 24 Nov 2014 23:07:23 +0000 (-0800) Subject: dpif: Fix initialization order. X-Git-Tag: v2.4.0~878 X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Fovs.git;a=commitdiff_plain;h=36f29fb1a763e167fa971ac695b727296ad9f811 dpif: Fix initialization order. 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 Acked-by: Jarno Rajahalme --- diff --git a/lib/dpif.c b/lib/dpif.c index 33e32ef3f..d6de5a1b3 100644 --- a/lib/dpif.c +++ b/lib/dpif.c @@ -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); } } diff --git a/lib/netdev.c b/lib/netdev.c index e4e3b18e9..a6ab141c6 100644 --- a/lib/netdev.c +++ b/lib/netdev.c @@ -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); } }