[ovs-dev] [next 06/35] bridge: Avoid extra iteration through all "struct iface"s.

Ben Pfaff blp at nicira.com
Wed May 4 17:11:52 UTC 2011


On Mon, May 02, 2011 at 11:06:07AM -0700, Ethan Jackson wrote:
> > ? ? ? ? ? ? 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);
> > + ? ? ? ? ? ? ? ?if (iface->dp_ifidx != ODPP_LOCAL
> > + ? ? ? ? ? ? ? ? ? ?&& !strcmp(iface->type, "internal")) {
> > + ? ? ? ? ? ? ? ? ? ?iface_set_mac(iface);
> 
> I think it makes more sense to always call iface_set_mac() rather than
> checking.  It already has logic for dealing with the case where it's
> ODPP_LOCAL or has type internal.

Thanks, it looks like I rebased against master and missed the
following change from commit ede2fd6d7876 "bridge: Reintroduce log
message that was lost (and wrong).  I've applied it now.

@@ -440,17 +440,15 @@
     /* 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. */
-    if (iface->dp_ifidx != ODPP_LOCAL && !strcmp(iface->type, "internal")) {
-        iface_set_mac(iface);
-    }
+    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. */



More information about the dev mailing list