mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 04:31:50 +00:00
mac80211: mesh: only switch path when new metric is at least 10% better
This helps to reduce frequent path switches when multiple path candidates have the same or very similar path metrics. Signed-off-by: Julan Hsu <julanhsu@google.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
67fc05549c
commit
a8d418d9ac
@ -447,7 +447,10 @@ static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata,
|
|||||||
(mpath->flags & MESH_PATH_SN_VALID)) {
|
(mpath->flags & MESH_PATH_SN_VALID)) {
|
||||||
if (SN_GT(mpath->sn, orig_sn) ||
|
if (SN_GT(mpath->sn, orig_sn) ||
|
||||||
(mpath->sn == orig_sn &&
|
(mpath->sn == orig_sn &&
|
||||||
new_metric >= mpath->metric)) {
|
(rcu_access_pointer(mpath->next_hop) !=
|
||||||
|
sta ?
|
||||||
|
mult_frac(new_metric, 10, 9) :
|
||||||
|
new_metric) >= mpath->metric)) {
|
||||||
process = false;
|
process = false;
|
||||||
fresh_info = false;
|
fresh_info = false;
|
||||||
}
|
}
|
||||||
@ -515,8 +518,10 @@ static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata,
|
|||||||
if (mpath) {
|
if (mpath) {
|
||||||
spin_lock_bh(&mpath->state_lock);
|
spin_lock_bh(&mpath->state_lock);
|
||||||
if ((mpath->flags & MESH_PATH_FIXED) ||
|
if ((mpath->flags & MESH_PATH_FIXED) ||
|
||||||
((mpath->flags & MESH_PATH_ACTIVE) &&
|
((mpath->flags & MESH_PATH_ACTIVE) &&
|
||||||
(last_hop_metric > mpath->metric)))
|
((rcu_access_pointer(mpath->next_hop) != sta ?
|
||||||
|
mult_frac(last_hop_metric, 10, 9) :
|
||||||
|
last_hop_metric) > mpath->metric)))
|
||||||
fresh_info = false;
|
fresh_info = false;
|
||||||
} else {
|
} else {
|
||||||
mpath = mesh_path_add(sdata, ta);
|
mpath = mesh_path_add(sdata, ta);
|
||||||
|
Loading…
Reference in New Issue
Block a user