bridge: Expire bond slave assignments when their loads decay to 0.
authorBen Pfaff <blp@nicira.com>
Fri, 18 Mar 2011 00:12:40 +0000 (17:12 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 22 Mar 2011 00:01:49 +0000 (17:01 -0700)
Until now, if a given MAC ever transmitted, then it would always show up
in bond information output.  There's no benefit to that if the MAC has
gone away permanently.  This commit causes them to be deleted when their
load has gone to 0.  This takes a fairly long time: if a MAC has sent, say,
one million bytes and then stops transmitting entirely, then it will take
about 20 rebalancing intervals (200 seconds) before it decays to 0 and
gets deleted.

Bug #2157.

vswitchd/bridge.c

index 34c0e78..c1a0945 100644 (file)
@@ -3382,6 +3382,9 @@ bond_rebalance_port(struct port *port)
      * historical data to decay to <1% in 7 rebalancing runs.  */
     for (e = &port->bond_hash[0]; e <= &port->bond_hash[BOND_MASK]; e++) {
         e->tx_bytes /= 2;
+        if (!e->tx_bytes) {
+            e->iface_idx = -1;
+        }
     }
 
 exit: