# This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/02/15 00:44:17+08:00 wensong@xxxxxxxxxxxx # [IPVS] Fixed that the WRR scheduler works correctly when server is updated or overloaded. # # Thanks must go to Kees Hoekzema for disovering the # problem and providing a patch. Thanks go to Julian and Horms for discussion # and making this patch. # # net/ipv4/ipvs/ip_vs_wrr.c # 2005/02/15 00:43:50+08:00 wensong@xxxxxxxxxxxx +3 -1 # fixed to reset mark->cw if mark->cw is greater than maximum weight while updating service; # fixed to return NULL only when all the servers are not available at any weight. # # diff -Nru a/net/ipv4/ipvs/ip_vs_wrr.c b/net/ipv4/ipvs/ip_vs_wrr.c --- a/net/ipv4/ipvs/ip_vs_wrr.c 2005-02-15 00:46:05 +08:00 +++ b/net/ipv4/ipvs/ip_vs_wrr.c 2005-02-15 00:46:05 +08:00 @@ -126,6 +126,8 @@ 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 @@ } } - 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;