Lines Matching refs:svc
69 static int ip_vs_wrr_gcd_weight(struct ip_vs_service *svc)
75 list_for_each_entry(dest, &svc->destinations, n_list) {
91 static int ip_vs_wrr_max_weight(struct ip_vs_service *svc)
96 list_for_each_entry(dest, &svc->destinations, n_list) {
106 static int ip_vs_wrr_init_svc(struct ip_vs_service *svc)
117 mark->cl = list_entry(&svc->destinations, struct ip_vs_dest, n_list);
118 mark->di = ip_vs_wrr_gcd_weight(svc);
119 mark->mw = ip_vs_wrr_max_weight(svc) - (mark->di - 1);
121 svc->sched_data = mark;
127 static void ip_vs_wrr_done_svc(struct ip_vs_service *svc)
129 struct ip_vs_wrr_mark *mark = svc->sched_data;
138 static int ip_vs_wrr_dest_changed(struct ip_vs_service *svc,
141 struct ip_vs_wrr_mark *mark = svc->sched_data;
143 spin_lock_bh(&svc->sched_lock);
144 mark->cl = list_entry(&svc->destinations, struct ip_vs_dest, n_list);
145 mark->di = ip_vs_wrr_gcd_weight(svc);
146 mark->mw = ip_vs_wrr_max_weight(svc) - (mark->di - 1);
151 spin_unlock_bh(&svc->sched_lock);
160 ip_vs_wrr_schedule(struct ip_vs_service *svc, const struct sk_buff *skb,
164 struct ip_vs_wrr_mark *mark = svc->sched_data;
169 spin_lock_bh(&svc->sched_lock);
178 &svc->destinations,
196 &last->n_list == &svc->destinations)
202 &last->n_list != &svc->destinations) {
221 spin_unlock_bh(&svc->sched_lock);
227 ip_vs_scheduler_err(svc, "no destination available");
233 ip_vs_scheduler_err(svc, "no destination available: "