Commit 9184092a authored by Wensong Zhang's avatar Wensong Zhang Committed by David S. Miller

[IPVS]: Fix that the WRR scheduler works correctly when server is updated or overloaded

Here is the patch to make the WRR scheduler work correctly when server is 
updated with new weight or marked overloaded. Please check and apply it to 
kernel 2.6.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cf611a8d
......@@ -126,6 +126,8 @@ static int ip_vs_wrr_update_svc(struct ip_vs_service *svc)
mark->cl = &svc->destinations;
mark->mw = ip_vs_wrr_max_weight(svc);
mark->di = ip_vs_wrr_gcd_weight(svc);
if (mark->cw > mark->mw)
mark->cw = 0;
return 0;
}
......@@ -186,7 +188,7 @@ ip_vs_wrr_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
}
}
if (mark->cl == p) {
if (mark->cl == p && mark->cw == mark->di) {
/* back to the start, and no dest is found.
It is only possible when all dests are OVERLOADED */
dest = NULL;
......
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