mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-02-17 08:46:40 +07:00
neigh: recompute reachabletime before returning from neigh_periodic_work()
If the neigh table's entries is less than gc_thresh1, the function will return directly, and the reachabletime will not be recompute, so the reachabletime can be guessed. Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
352063c839
commit
feff9ab2e7
@ -766,9 +766,6 @@ static void neigh_periodic_work(struct work_struct *work)
|
|||||||
nht = rcu_dereference_protected(tbl->nht,
|
nht = rcu_dereference_protected(tbl->nht,
|
||||||
lockdep_is_held(&tbl->lock));
|
lockdep_is_held(&tbl->lock));
|
||||||
|
|
||||||
if (atomic_read(&tbl->entries) < tbl->gc_thresh1)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* periodically recompute ReachableTime from random function
|
* periodically recompute ReachableTime from random function
|
||||||
*/
|
*/
|
||||||
@ -781,6 +778,9 @@ static void neigh_periodic_work(struct work_struct *work)
|
|||||||
neigh_rand_reach_time(NEIGH_VAR(p, BASE_REACHABLE_TIME));
|
neigh_rand_reach_time(NEIGH_VAR(p, BASE_REACHABLE_TIME));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (atomic_read(&tbl->entries) < tbl->gc_thresh1)
|
||||||
|
goto out;
|
||||||
|
|
||||||
for (i = 0 ; i < (1 << nht->hash_shift); i++) {
|
for (i = 0 ; i < (1 << nht->hash_shift); i++) {
|
||||||
np = &nht->hash_buckets[i];
|
np = &nht->hash_buckets[i];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user