Skip to contentSkip to conversation

bridge: fdb cleanup runs too often

PATCH In review Stephen Hemminger 2 participants 2 messages Jun 15, 2010 – Jun 17, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bridge: fdb cleanup runs too often

It is common in end-node, non STP bridges to set forwarding delay to zero; which causes the forwarding database cleanup to run every clock tick. Change to run only as soon as needed or at next ageing timer interval which ever is sooner.

Use round_jiffies_up macro rather than attempting round up by changing value.

---
This is 2.6.35 bug fix, and should also be considered for stable because of the performance impact.

net/bridge/br_fdb.c +2 -4
@@ -128,7 +128,7 @@ void br_fdb_cleanup(unsigned long _data)
 {
 	struct net_bridge *br = (struct net_bridge *)_data;
 	unsigned long delay = hold_time(br);
-	unsigned long next_timer = jiffies + br->forward_delay;
+	unsigned long next_timer = jiffies + br->ageing_time;
 	int i;
 
 	spin_lock_bh(&br->hash_lock);
@@ -149,9 +149,7 @@ void br_fdb_cleanup(unsigned long _data)
 	}
 	spin_unlock_bh(&br->hash_lock);
 
-	/* Add HZ/4 to ensure we round the jiffies upwards to be after the next
-	 * timer, otherwise we might round down and will have no-op run. */
-	mod_timer(&br->gc_timer, round_jiffies(next_timer + HZ/4));
+	mod_timer(&br->gc_timer, round_jiffies_up(next_timer));
 }
 
 /* Completely flush all dynamic entries in forwarding database.*/
maintainer
#1 lore raw

From: Stephen Hemminger <[email protected]>
Date: Tue, 15 Jun 2010 09:14:12 -0700

Quoted 10 lines

It is common in end-node, non STP bridges to set forwarding delay to zero; which causes the forwarding database cleanup to run every clock tick. Change to run only as soon as needed or at next ageing timer interval which ever is sooner.

Use round_jiffies_up macro rather than attempting round up by changing value.

Applied and queued up for -stable, thanks.