Lines Matching refs:svc

123 			      struct ip_vs_service *svc)
138 p = &svc->destinations;
140 while ((p = p->next) != &svc->destinations) {
143 ds->offset = ip_vs_mh_hashkey(svc->af, &dest->addr,
146 ds->skip = ip_vs_mh_hashkey(svc->af, &dest->addr,
160 struct ip_vs_service *svc)
181 p = &svc->destinations;
185 if (p == &svc->destinations)
189 while (p != &svc->destinations) {
235 ip_vs_mh_get(struct ip_vs_service *svc, struct ip_vs_mh_state *s,
238 unsigned int hash = ip_vs_mh_hashkey(svc->af, addr, port, &s->hash1, 0)
247 ip_vs_mh_get_fallback(struct ip_vs_service *svc, struct ip_vs_mh_state *s,
255 ihash = ip_vs_mh_hashkey(svc->af, addr, port,
271 hash = ip_vs_mh_hashkey(svc->af, addr, port, &s->hash1,
289 struct ip_vs_service *svc)
293 if (svc->num_dests > IP_VS_MH_TAB_SIZE)
296 if (svc->num_dests >= 1) {
297 s->dest_setup = kcalloc(svc->num_dests,
304 ip_vs_mh_permutate(s, svc);
306 ret = ip_vs_mh_populate(s, svc);
311 IP_VS_DBG_ADDR(svc->af, &svc->addr),
312 ntohs(svc->port));
315 if (svc->num_dests >= 1) {
322 static int ip_vs_mh_gcd_weight(struct ip_vs_service *svc)
328 list_for_each_entry(dest, &svc->destinations, n_list) {
343 static int ip_vs_mh_shift_weight(struct ip_vs_service *svc, int gcd)
356 list_for_each_entry(dest, &svc->destinations, n_list) {
381 static int ip_vs_mh_init_svc(struct ip_vs_service *svc)
399 s->gcd = ip_vs_mh_gcd_weight(svc);
400 s->rshift = ip_vs_mh_shift_weight(svc, s->gcd);
407 ret = ip_vs_mh_reassign(s, svc);
415 svc->sched_data = s;
419 static void ip_vs_mh_done_svc(struct ip_vs_service *svc)
421 struct ip_vs_mh_state *s = svc->sched_data;
431 static int ip_vs_mh_dest_changed(struct ip_vs_service *svc,
434 struct ip_vs_mh_state *s = svc->sched_data;
436 s->gcd = ip_vs_mh_gcd_weight(svc);
437 s->rshift = ip_vs_mh_shift_weight(svc, s->gcd);
440 return ip_vs_mh_reassign(s, svc);
474 ip_vs_mh_schedule(struct ip_vs_service *svc, const struct sk_buff *skb,
486 if (svc->flags & IP_VS_SVC_F_SCHED_MH_PORT)
489 s = (struct ip_vs_mh_state *)svc->sched_data;
491 if (svc->flags & IP_VS_SVC_F_SCHED_MH_FALLBACK)
492 dest = ip_vs_mh_get_fallback(svc, s, hash_addr, port);
494 dest = ip_vs_mh_get(svc, s, hash_addr, port);
497 ip_vs_scheduler_err(svc, "no destination available");
502 IP_VS_DBG_ADDR(svc->af, hash_addr),