Lines Matching refs:ht
85 struct tc_u_knode __rcu *ht[1]; member
112 struct tc_u_hnode *ht = rcu_dereference_bh(tp->root); in u32_classify() local
124 n = rcu_dereference_bh(ht->ht[sel]); in u32_classify()
164 ht = rcu_dereference_bh(n->ht_down); in u32_classify()
165 if (!ht) { in u32_classify()
198 ht = rcu_dereference_bh(n->ht_down); in u32_classify()
200 if (ht->divisor) { in u32_classify()
207 sel = ht->divisor & u32_hash_fold(*data, &n->sel, in u32_classify()
240 ht = rcu_dereference_bh(n->ht_up); in u32_classify()
255 struct tc_u_hnode *ht; in u32_lookup_ht() local
257 for (ht = rtnl_dereference(tp_c->hlist); in u32_lookup_ht()
258 ht; in u32_lookup_ht()
259 ht = rtnl_dereference(ht->next)) in u32_lookup_ht()
260 if (ht->handle == handle) in u32_lookup_ht()
263 return ht; in u32_lookup_ht()
267 u32_lookup_key(struct tc_u_hnode *ht, u32 handle) in u32_lookup_key() argument
273 if (sel > ht->divisor) in u32_lookup_key()
276 for (n = rtnl_dereference(ht->ht[sel]); in u32_lookup_key()
288 struct tc_u_hnode *ht; in u32_get() local
292 ht = rtnl_dereference(tp->root); in u32_get()
294 ht = u32_lookup_ht(tp_c, TC_U32_HTID(handle)); in u32_get()
296 if (!ht) in u32_get()
300 return (unsigned long)ht; in u32_get()
302 return (unsigned long)u32_lookup_key(ht, handle); in u32_get()
408 struct tc_u_hnode *ht = rtnl_dereference(key->ht_up); in u32_delete_key() local
410 if (ht) { in u32_delete_key()
411 kp = &ht->ht[TC_U32_HASH(key->handle)]; in u32_delete_key()
427 static void u32_clear_hnode(struct tcf_proto *tp, struct tc_u_hnode *ht) in u32_clear_hnode() argument
432 for (h = 0; h <= ht->divisor; h++) { in u32_clear_hnode()
433 while ((n = rtnl_dereference(ht->ht[h])) != NULL) { in u32_clear_hnode()
434 RCU_INIT_POINTER(ht->ht[h], in u32_clear_hnode()
442 static int u32_destroy_hnode(struct tcf_proto *tp, struct tc_u_hnode *ht) in u32_destroy_hnode() argument
448 WARN_ON(ht->refcnt); in u32_destroy_hnode()
450 u32_clear_hnode(tp, ht); in u32_destroy_hnode()
456 if (phn == ht) { in u32_destroy_hnode()
457 RCU_INIT_POINTER(*hn, ht->next); in u32_destroy_hnode()
458 kfree_rcu(ht, rcu); in u32_destroy_hnode()
466 static bool ht_empty(struct tc_u_hnode *ht) in ht_empty() argument
470 for (h = 0; h <= ht->divisor; h++) in ht_empty()
471 if (rcu_access_pointer(ht->ht[h])) in ht_empty()
498 struct tc_u_hnode *ht; in u32_destroy() local
500 for (ht = rtnl_dereference(tp_c->hlist); in u32_destroy()
501 ht; in u32_destroy()
502 ht = rtnl_dereference(ht->next)) in u32_destroy()
503 if (!ht_empty(ht)) in u32_destroy()
512 struct tc_u_hnode *ht; in u32_destroy() local
516 for (ht = rtnl_dereference(tp_c->hlist); in u32_destroy()
517 ht; in u32_destroy()
518 ht = rtnl_dereference(ht->next)) { in u32_destroy()
519 ht->refcnt--; in u32_destroy()
520 u32_clear_hnode(tp, ht); in u32_destroy()
523 while ((ht = rtnl_dereference(tp_c->hlist)) != NULL) { in u32_destroy()
524 RCU_INIT_POINTER(tp_c->hlist, ht->next); in u32_destroy()
525 kfree_rcu(ht, rcu); in u32_destroy()
537 struct tc_u_hnode *ht = (struct tc_u_hnode *)arg; in u32_delete() local
540 if (ht == NULL) in u32_delete()
543 if (TC_U32_KEY(ht->handle)) in u32_delete()
544 return u32_delete_key(tp, (struct tc_u_knode *)ht); in u32_delete()
546 if (root_ht == ht) in u32_delete()
549 if (ht->refcnt == 1) { in u32_delete()
550 ht->refcnt--; in u32_delete()
551 u32_destroy_hnode(tp, ht); in u32_delete()
560 static u32 gen_new_kid(struct tc_u_hnode *ht, u32 handle) in gen_new_kid() argument
569 for (n = rtnl_dereference(ht->ht[TC_U32_HASH(handle)]); in gen_new_kid()
593 unsigned long base, struct tc_u_hnode *ht, in u32_set_parms() argument
614 ht_down = u32_lookup_ht(ht->tp_c, handle); in u32_set_parms()
655 struct tc_u_hnode *ht; in u32_replace_knode() local
658 ht = rtnl_dereference(tp->root); in u32_replace_knode()
660 ht = u32_lookup_ht(tp_c, TC_U32_HTID(n->handle)); in u32_replace_knode()
662 ins = &ht->ht[TC_U32_HASH(n->handle)]; in u32_replace_knode()
731 struct tc_u_hnode *ht; in u32_change() local
787 ht = kzalloc(sizeof(*ht) + divisor*sizeof(void *), GFP_KERNEL); in u32_change()
788 if (ht == NULL) in u32_change()
790 ht->tp_c = tp_c; in u32_change()
791 ht->refcnt = 1; in u32_change()
792 ht->divisor = divisor; in u32_change()
793 ht->handle = handle; in u32_change()
794 ht->prio = tp->prio; in u32_change()
795 RCU_INIT_POINTER(ht->next, tp_c->hlist); in u32_change()
796 rcu_assign_pointer(tp_c->hlist, ht); in u32_change()
797 *arg = (unsigned long)ht; in u32_change()
804 ht = rtnl_dereference(tp->root); in u32_change()
805 htid = ht->handle; in u32_change()
807 ht = u32_lookup_ht(tp->data, TC_U32_HTID(htid)); in u32_change()
808 if (ht == NULL) in u32_change()
812 ht = rtnl_dereference(tp->root); in u32_change()
813 htid = ht->handle; in u32_change()
816 if (ht->divisor < TC_U32_HASH(htid)) in u32_change()
824 handle = gen_new_kid(ht, htid); in u32_change()
845 RCU_INIT_POINTER(n->ht_up, ht); in u32_change()
867 err = u32_set_parms(net, tp, base, ht, n, tb, tca[TCA_RATE], ovr); in u32_change()
872 ins = &ht->ht[TC_U32_HASH(handle)]; in u32_change()
900 struct tc_u_hnode *ht; in u32_walk() local
907 for (ht = rtnl_dereference(tp_c->hlist); in u32_walk()
908 ht; in u32_walk()
909 ht = rtnl_dereference(ht->next)) { in u32_walk()
910 if (ht->prio != tp->prio) in u32_walk()
913 if (arg->fn(tp, (unsigned long)ht, arg) < 0) { in u32_walk()
919 for (h = 0; h <= ht->divisor; h++) { in u32_walk()
920 for (n = rtnl_dereference(ht->ht[h]); in u32_walk()
954 struct tc_u_hnode *ht = (struct tc_u_hnode *)fh; in u32_dump() local
955 u32 divisor = ht->divisor + 1; in u32_dump()