In-band control needs to open the bridge port as a netdev.  Before commit
acf60855126bcfa79, the bridge port always existed at the time the remotes
were configured, because it was created as part of creating the ofproto.
However, that commit changed bridge ports so that they are created in the
same way as ordinary ports, which means that creation can and sometimes is
deferred to allow the main loop to run.  When that happened, in-band
control failed to open its bridge port, which caused in-band control not
to work.

This commit fixes the problem by deferring the configuration of OpenFlow
remotes (which are what initializes in-band control) until all ports have
been created.  It fixes the problem in my testing.

This problem is one that I noticed in my own test environment.  I haven't
heard any similar reports from others.

Signed-off-by: Ben Pfaff <[email protected]>
---
 vswitchd/bridge.c |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index b1d2feb..ecaec08 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -558,9 +558,7 @@ bridge_reconfigure_ofp(void)
 static bool
 bridge_reconfigure_continue(const struct ovsrec_open_vswitch *ovs_cfg)
 {
-    struct sockaddr_in *managers;
     int sflow_bridge_number;
-    size_t n_managers;
     struct bridge *br;
     bool done;
 
@@ -569,7 +567,6 @@ bridge_reconfigure_continue(const struct 
ovsrec_open_vswitch *ovs_cfg)
 
     /* Complete the configuration. */
     sflow_bridge_number = 0;
-    collect_in_band_managers(ovs_cfg, &managers, &n_managers);
     HMAP_FOR_EACH (br, node, &all_bridges) {
         struct port *port;
 
@@ -592,15 +589,26 @@ bridge_reconfigure_continue(const struct 
ovsrec_open_vswitch *ovs_cfg)
         bridge_configure_flow_eviction_threshold(br);
         bridge_configure_forward_bpdu(br);
         bridge_configure_mac_idle_time(br);
-        bridge_configure_remotes(br, managers, n_managers);
         bridge_configure_netflow(br);
         bridge_configure_sflow(br, &sflow_bridge_number);
         bridge_configure_stp(br);
         bridge_configure_tables(br);
     }
-    free(managers);
 
     if (done) {
+        struct sockaddr_in *managers;
+        size_t n_managers;
+
+        /* Postpone configuration of OpenFlow remotes until we're done adding
+         * and removing datapath ports.  This is because, if in-band control is
+         * in use, then it needs to open the bridge port (e.g. br0), which must
+         * therefore be created before we can configure it. */
+        collect_in_band_managers(ovs_cfg, &managers, &n_managers);
+        HMAP_FOR_EACH (br, node, &all_bridges) {
+            bridge_configure_remotes(br, managers, n_managers);
+        }
+        free(managers);
+
         /* ovs-vswitchd has completed initialization, so allow the process that
          * forked us to exit successfully. */
         daemonize_complete();
-- 
1.7.2.5

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to