From 332e0d030b522828b6b93152f860c2bc08bfbbf8 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 17 Mar 2011 17:12:40 -0700 Subject: [PATCH] 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. --- vswitchd/bridge.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 34c0e78f..c1a0945b 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: -- 2.30.2