bridge: Avoid extra iteration through all "struct iface"s.
authorBen Pfaff <blp@nicira.com>
Wed, 4 May 2011 17:12:03 +0000 (10:12 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 4 May 2011 17:12:03 +0000 (10:12 -0700)
There's no reason to do these separately as far as I can see.

vswitchd/bridge.c

index 9e9566cc3ea17368abb7e9362a241dd113f101dc..5dfc1141f88b3e8c0aba384c1f7f99445cfbdc10 100644 (file)
@@ -439,23 +439,6 @@ check_iface(struct bridge *br, struct iface *iface, void *aux OVS_UNUSED)
     return true;
 }
 
-/* Callback for iterate_and_prune_ifaces(). */
-static bool
-set_iface_properties(struct bridge *br OVS_UNUSED, struct iface *iface,
-                     void *aux OVS_UNUSED)
-{
-    /* Set policing attributes. */
-    netdev_set_policing(iface->netdev,
-                        iface->cfg->ingress_policing_rate,
-                        iface->cfg->ingress_policing_burst);
-
-    /* Set MAC address of internal interfaces other than the local
-     * interface. */
-    iface_set_mac(iface);
-
-    return true;
-}
-
 /* Calls 'cb' for each interfaces in 'br', passing along the 'aux' argument.
  * Deletes from 'br' all the interfaces for which 'cb' returns false, and then
  * deletes from 'br' any ports that no longer have any interfaces. */
@@ -904,12 +887,13 @@ bridge_reconfigure(const struct ovsrec_open_vswitch *ovs_cfg)
 
             LIST_FOR_EACH (iface, port_elem, &port->ifaces) {
                 iface_update_qos(iface, port->cfg->qos);
+                netdev_set_policing(iface->netdev,
+                                    iface->cfg->ingress_policing_rate,
+                                    iface->cfg->ingress_policing_burst);
+                iface_set_mac(iface);
             }
         }
     }
-    LIST_FOR_EACH (br, node, &all_bridges) {
-        iterate_and_prune_ifaces(br, set_iface_properties, NULL);
-    }
 
     /* Some reconfiguration operations require the bridge to have been run at
      * least once.  */