Lines Matching refs:tp_c

254 static struct tc_u_hnode *u32_lookup_ht(struct tc_u_common *tp_c, u32 handle)  in u32_lookup_ht()  argument
258 for (ht = rtnl_dereference(tp_c->hlist); in u32_lookup_ht()
289 struct tc_u_common *tp_c = tp->data; in u32_get() local
294 ht = u32_lookup_ht(tp_c, TC_U32_HTID(handle)); in u32_get()
306 static u32 gen_new_htid(struct tc_u_common *tp_c, struct tc_u_hnode *ptr) in gen_new_htid() argument
308 int id = idr_alloc_cyclic(&tp_c->handle_idr, ptr, 1, 0x7FF, GFP_KERNEL); in gen_new_htid()
354 struct tc_u_common *tp_c = tc_u_common_find(key); in u32_init() local
361 root_ht->handle = tp_c ? gen_new_htid(tp_c, root_ht) : 0x80000000; in u32_init()
366 if (tp_c == NULL) { in u32_init()
367 tp_c = kzalloc(struct_size(tp_c, hlist->ht, 1), GFP_KERNEL); in u32_init()
368 if (tp_c == NULL) { in u32_init()
372 tp_c->ptr = key; in u32_init()
373 INIT_HLIST_NODE(&tp_c->hnode); in u32_init()
374 idr_init(&tp_c->handle_idr); in u32_init()
376 hlist_add_head(&tp_c->hnode, tc_u_hash(key)); in u32_init()
379 tp_c->refcnt++; in u32_init()
380 RCU_INIT_POINTER(root_ht->next, tp_c->hlist); in u32_init()
381 rcu_assign_pointer(tp_c->hlist, root_ht); in u32_init()
385 tp->data = tp_c; in u32_init()
450 struct tc_u_common *tp_c = tp->data; in u32_delete_key() local
461 tp_c->knodes--; in u32_delete_key()
575 struct tc_u_common *tp_c = tp->data; in u32_clear_hnode() local
583 tp_c->knodes--; in u32_clear_hnode()
598 struct tc_u_common *tp_c = tp->data; in u32_destroy_hnode() local
606 hn = &tp_c->hlist; in u32_destroy_hnode()
613 idr_remove(&tp_c->handle_idr, ht->handle); in u32_destroy_hnode()
626 struct tc_u_common *tp_c = tp->data; in u32_destroy() local
634 if (--tp_c->refcnt == 0) { in u32_destroy()
637 hlist_del(&tp_c->hnode); in u32_destroy()
639 while ((ht = rtnl_dereference(tp_c->hlist)) != NULL) { in u32_destroy()
641 RCU_INIT_POINTER(tp_c->hlist, ht->next); in u32_destroy()
650 idr_destroy(&tp_c->handle_idr); in u32_destroy()
651 kfree(tp_c); in u32_destroy()
661 struct tc_u_common *tp_c = tp->data; in u32_delete() local
683 *last = tp_c->refcnt == 1 && tp_c->knodes == 0; in u32_delete()
770 static void u32_replace_knode(struct tcf_proto *tp, struct tc_u_common *tp_c, in u32_replace_knode() argument
780 ht = u32_lookup_ht(tp_c, TC_U32_HTID(n->handle)); in u32_replace_knode()
851 struct tc_u_common *tp_c = tp->data; in u32_change() local
920 u32_replace_knode(tp, tp_c, new); in u32_change()
952 err = idr_alloc_u32(&tp_c->handle_idr, ht, &handle, in u32_change()
968 idr_remove(&tp_c->handle_idr, handle); in u32_change()
973 RCU_INIT_POINTER(ht->next, tp_c->hlist); in u32_change()
974 rcu_assign_pointer(tp_c->hlist, ht); in u32_change()
1094 tp_c->knodes++; in u32_change()
1119 struct tc_u_common *tp_c = tp->data; in u32_walk() local
1127 for (ht = rtnl_dereference(tp_c->hlist); in u32_walk()
1204 struct tc_u_common *tp_c = tp->data; in u32_reoffload() local
1210 for (ht = rtnl_dereference(tp_c->hlist); in u32_reoffload()