From: Ben Pfaff Date: Fri, 18 Mar 2011 00:12:40 +0000 (-0700) Subject: bridge: Expire bond slave assignments when their loads decay to 0. X-Git-Tag: v1.1.0~91 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=332e0d030b522828b6b93152f860c2bc08bfbbf8;p=sliver-openvswitch.git bridge: Expire bond slave assignments when their loads decay to 0. 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. --- diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 34c0e78f1..c1a0945b5 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -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: