From: Ben Pfaff Date: Wed, 4 May 2011 17:12:03 +0000 (-0700) Subject: bridge: Avoid extra iteration through all "struct iface"s. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7ae792355f8854f54f0d169b91c5f2ee10b368f1;p=openvswitch bridge: Avoid extra iteration through all "struct iface"s. There's no reason to do these separately as far as I can see. --- diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 9e9566cc..5dfc1141 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -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. */