Commit 25442e06 authored by stephen hemminger's avatar stephen hemminger Committed by David S. Miller

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.
Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent aabef8b2
...@@ -128,7 +128,7 @@ void br_fdb_cleanup(unsigned long _data) ...@@ -128,7 +128,7 @@ void br_fdb_cleanup(unsigned long _data)
{ {
struct net_bridge *br = (struct net_bridge *)_data; struct net_bridge *br = (struct net_bridge *)_data;
unsigned long delay = hold_time(br); unsigned long delay = hold_time(br);
unsigned long next_timer = jiffies + br->forward_delay; unsigned long next_timer = jiffies + br->ageing_time;
int i; int i;
spin_lock_bh(&br->hash_lock); spin_lock_bh(&br->hash_lock);
...@@ -149,9 +149,7 @@ void br_fdb_cleanup(unsigned long _data) ...@@ -149,9 +149,7 @@ void br_fdb_cleanup(unsigned long _data)
} }
spin_unlock_bh(&br->hash_lock); spin_unlock_bh(&br->hash_lock);
/* Add HZ/4 to ensure we round the jiffies upwards to be after the next mod_timer(&br->gc_timer, round_jiffies_up(next_timer));
* timer, otherwise we might round down and will have no-op run. */
mod_timer(&br->gc_timer, round_jiffies(next_timer + HZ/4));
} }
/* Completely flush all dynamic entries in forwarding database.*/ /* Completely flush all dynamic entries in forwarding database.*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment