Lines Matching refs:tp_c
256 static struct tc_u_hnode *u32_lookup_ht(struct tc_u_common *tp_c, u32 handle) in u32_lookup_ht() argument
260 for (ht = rtnl_dereference(tp_c->hlist); in u32_lookup_ht()
291 struct tc_u_common *tp_c = tp->data; in u32_get() local
296 ht = u32_lookup_ht(tp_c, TC_U32_HTID(handle)); in u32_get()
308 static u32 gen_new_htid(struct tc_u_common *tp_c, struct tc_u_hnode *ptr) in gen_new_htid() argument
310 int id = idr_alloc_cyclic(&tp_c->handle_idr, ptr, 1, 0x7FF, GFP_KERNEL); in gen_new_htid()
356 struct tc_u_common *tp_c = tc_u_common_find(key); in u32_init() local
363 root_ht->handle = tp_c ? gen_new_htid(tp_c, root_ht) : 0x80000000; in u32_init()
368 if (tp_c == NULL) { in u32_init()
369 tp_c = kzalloc(sizeof(*tp_c), GFP_KERNEL); in u32_init()
370 if (tp_c == NULL) { in u32_init()
374 tp_c->ptr = key; in u32_init()
375 INIT_HLIST_NODE(&tp_c->hnode); in u32_init()
376 idr_init(&tp_c->handle_idr); in u32_init()
378 hlist_add_head(&tp_c->hnode, tc_u_hash(key)); in u32_init()
381 tp_c->refcnt++; in u32_init()
382 RCU_INIT_POINTER(root_ht->next, tp_c->hlist); in u32_init()
383 rcu_assign_pointer(tp_c->hlist, root_ht); in u32_init()
387 tp->data = tp_c; in u32_init()
452 struct tc_u_common *tp_c = tp->data; in u32_delete_key() local
463 tp_c->knodes--; in u32_delete_key()
577 struct tc_u_common *tp_c = tp->data; in u32_clear_hnode() local
585 tp_c->knodes--; in u32_clear_hnode()
600 struct tc_u_common *tp_c = tp->data; in u32_destroy_hnode() local
608 hn = &tp_c->hlist; in u32_destroy_hnode()
615 idr_remove(&tp_c->handle_idr, ht->handle); in u32_destroy_hnode()
628 struct tc_u_common *tp_c = tp->data; in u32_destroy() local
636 if (--tp_c->refcnt == 0) { in u32_destroy()
639 hlist_del(&tp_c->hnode); in u32_destroy()
641 while ((ht = rtnl_dereference(tp_c->hlist)) != NULL) { in u32_destroy()
643 RCU_INIT_POINTER(tp_c->hlist, ht->next); in u32_destroy()
652 idr_destroy(&tp_c->handle_idr); in u32_destroy()
653 kfree(tp_c); in u32_destroy()
663 struct tc_u_common *tp_c = tp->data; in u32_delete() local
685 *last = tp_c->refcnt == 1 && tp_c->knodes == 0; in u32_delete()
785 static void u32_replace_knode(struct tcf_proto *tp, struct tc_u_common *tp_c, in u32_replace_knode() argument
795 ht = u32_lookup_ht(tp_c, TC_U32_HTID(n->handle)); in u32_replace_knode()
865 struct tc_u_common *tp_c = tp->data; in u32_change() local
944 u32_replace_knode(tp, tp_c, new); in u32_change()
976 err = idr_alloc_u32(&tp_c->handle_idr, ht, &handle, in u32_change()
992 idr_remove(&tp_c->handle_idr, handle); in u32_change()
997 RCU_INIT_POINTER(ht->next, tp_c->hlist); in u32_change()
998 rcu_assign_pointer(tp_c->hlist, ht); in u32_change()
1165 tp_c->knodes++; in u32_change()
1192 struct tc_u_common *tp_c = tp->data; in u32_walk() local
1200 for (ht = rtnl_dereference(tp_c->hlist); in u32_walk()
1277 struct tc_u_common *tp_c = tp->data; in u32_reoffload() local
1283 for (ht = rtnl_dereference(tp_c->hlist); in u32_reoffload()