Commit 14e1d0fa authored by Sorin Dumitru's avatar Sorin Dumitru Committed by David S. Miller

vxlan: release lock after each bucket in vxlan_cleanup

We're seeing some softlockups from this function when there
are a lot fdb entries on a vxlan device. Taking the lock for
each bucket instead of the whole table is enough to fix that.
Signed-off-by: default avatarSorin Dumitru <sdumitru@ixiacom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 07f4c900
...@@ -2131,9 +2131,10 @@ static void vxlan_cleanup(unsigned long arg) ...@@ -2131,9 +2131,10 @@ static void vxlan_cleanup(unsigned long arg)
if (!netif_running(vxlan->dev)) if (!netif_running(vxlan->dev))
return; return;
spin_lock_bh(&vxlan->hash_lock);
for (h = 0; h < FDB_HASH_SIZE; ++h) { for (h = 0; h < FDB_HASH_SIZE; ++h) {
struct hlist_node *p, *n; struct hlist_node *p, *n;
spin_lock_bh(&vxlan->hash_lock);
hlist_for_each_safe(p, n, &vxlan->fdb_head[h]) { hlist_for_each_safe(p, n, &vxlan->fdb_head[h]) {
struct vxlan_fdb *f struct vxlan_fdb *f
= container_of(p, struct vxlan_fdb, hlist); = container_of(p, struct vxlan_fdb, hlist);
...@@ -2152,8 +2153,8 @@ static void vxlan_cleanup(unsigned long arg) ...@@ -2152,8 +2153,8 @@ static void vxlan_cleanup(unsigned long arg)
} else if (time_before(timeout, next_timer)) } else if (time_before(timeout, next_timer))
next_timer = timeout; next_timer = timeout;
} }
spin_unlock_bh(&vxlan->hash_lock);
} }
spin_unlock_bh(&vxlan->hash_lock);
mod_timer(&vxlan->age_timer, next_timer); mod_timer(&vxlan->age_timer, next_timer);
} }
......
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