Lines Matching refs:tbl

331 ip_vs_lblcr_hash(struct ip_vs_lblcr_table *tbl, struct ip_vs_lblcr_entry *en)
335 hlist_add_head_rcu(&en->list, &tbl->bucket[hash]);
336 atomic_inc(&tbl->entries);
342 ip_vs_lblcr_get(int af, struct ip_vs_lblcr_table *tbl,
348 hlist_for_each_entry_rcu(en, &tbl->bucket[hash], list)
361 ip_vs_lblcr_new(struct ip_vs_lblcr_table *tbl, const union nf_inet_addr *daddr,
366 en = ip_vs_lblcr_get(af, tbl, daddr);
382 ip_vs_lblcr_hash(tbl, en);
397 struct ip_vs_lblcr_table *tbl = svc->sched_data;
403 tbl->dead = true;
405 hlist_for_each_entry_safe(en, next, &tbl->bucket[i], list) {
423 struct ip_vs_lblcr_table *tbl = svc->sched_data;
429 for (i = 0, j = tbl->rover; i < IP_VS_LBLCR_TAB_SIZE; i++) {
433 hlist_for_each_entry_safe(en, next, &tbl->bucket[j], list) {
439 atomic_dec(&tbl->entries);
443 tbl->rover = j;
460 struct ip_vs_lblcr_table *tbl = from_timer(tbl, t, periodic_timer);
461 struct ip_vs_service *svc = tbl->svc;
468 if ((tbl->counter % COUNT_FOR_FULL_EXPIRATION) == 0) {
471 tbl->counter = 1;
475 if (atomic_read(&tbl->entries) <= tbl->max_size) {
476 tbl->counter++;
480 goal = (atomic_read(&tbl->entries) - tbl->max_size)*4/3;
481 if (goal > tbl->max_size/2)
482 goal = tbl->max_size/2;
484 for (i = 0, j = tbl->rover; i < IP_VS_LBLCR_TAB_SIZE; i++) {
488 hlist_for_each_entry_safe(en, next, &tbl->bucket[j], list) {
493 atomic_dec(&tbl->entries);
500 tbl->rover = j;
503 mod_timer(&tbl->periodic_timer, jiffies+CHECK_EXPIRE_INTERVAL);
509 struct ip_vs_lblcr_table *tbl;
514 tbl = kmalloc(sizeof(*tbl), GFP_KERNEL);
515 if (tbl == NULL)
518 svc->sched_data = tbl;
520 "current service\n", sizeof(*tbl));
526 INIT_HLIST_HEAD(&tbl->bucket[i]);
528 tbl->max_size = IP_VS_LBLCR_TAB_SIZE*16;
529 tbl->rover = 0;
530 tbl->counter = 1;
531 tbl->dead = false;
532 tbl->svc = svc;
533 atomic_set(&tbl->entries, 0);
538 timer_setup(&tbl->periodic_timer, ip_vs_lblcr_check_expire, 0);
539 mod_timer(&tbl->periodic_timer, jiffies + CHECK_EXPIRE_INTERVAL);
547 struct ip_vs_lblcr_table *tbl = svc->sched_data;
550 timer_shutdown_sync(&tbl->periodic_timer);
556 kfree_rcu(tbl, rcu_head);
558 sizeof(*tbl));
648 struct ip_vs_lblcr_table *tbl = svc->sched_data;
655 en = ip_vs_lblcr_get(svc->af, tbl, &iph->daddr);
690 if (!tbl->dead)
705 if (!tbl->dead)
706 ip_vs_lblcr_new(tbl, &iph->daddr, svc->af, dest);