Lines Matching refs:tp_c
254 static struct tc_u_hnode *u32_lookup_ht(struct tc_u_common *tp_c, u32 handle)
258 for (ht = rtnl_dereference(tp_c->hlist);
289 struct tc_u_common *tp_c = tp->data;
294 ht = u32_lookup_ht(tp_c, TC_U32_HTID(handle));
306 static u32 gen_new_htid(struct tc_u_common *tp_c, struct tc_u_hnode *ptr)
308 int id = idr_alloc_cyclic(&tp_c->handle_idr, ptr, 1, 0x7FF, GFP_KERNEL);
354 struct tc_u_common *tp_c = tc_u_common_find(key);
361 root_ht->handle = tp_c ? gen_new_htid(tp_c, root_ht) : 0x80000000;
366 if (tp_c == NULL) {
367 tp_c = kzalloc(sizeof(*tp_c), GFP_KERNEL);
368 if (tp_c == NULL) {
372 tp_c->ptr = key;
373 INIT_HLIST_NODE(&tp_c->hnode);
374 idr_init(&tp_c->handle_idr);
376 hlist_add_head(&tp_c->hnode, tc_u_hash(key));
379 tp_c->refcnt++;
380 RCU_INIT_POINTER(root_ht->next, tp_c->hlist);
381 rcu_assign_pointer(tp_c->hlist, root_ht);
385 tp->data = tp_c;
450 struct tc_u_common *tp_c = tp->data;
461 tp_c->knodes--;
575 struct tc_u_common *tp_c = tp->data;
583 tp_c->knodes--;
598 struct tc_u_common *tp_c = tp->data;
606 hn = &tp_c->hlist;
613 idr_remove(&tp_c->handle_idr, ht->handle);
626 struct tc_u_common *tp_c = tp->data;
634 if (--tp_c->refcnt == 0) {
637 hlist_del(&tp_c->hnode);
639 while ((ht = rtnl_dereference(tp_c->hlist)) != NULL) {
641 RCU_INIT_POINTER(tp_c->hlist, ht->next);
650 idr_destroy(&tp_c->handle_idr);
651 kfree(tp_c);
661 struct tc_u_common *tp_c = tp->data;
683 *last = tp_c->refcnt == 1 && tp_c->knodes == 0;
771 static void u32_replace_knode(struct tcf_proto *tp, struct tc_u_common *tp_c,
781 ht = u32_lookup_ht(tp_c, TC_U32_HTID(n->handle));
851 struct tc_u_common *tp_c = tp->data;
919 u32_replace_knode(tp, tp_c, new);
951 err = idr_alloc_u32(&tp_c->handle_idr, ht, &handle,
967 idr_remove(&tp_c->handle_idr, handle);
972 RCU_INIT_POINTER(ht->next, tp_c->hlist);
973 rcu_assign_pointer(tp_c->hlist, ht);
1133 tp_c->knodes++;
1158 struct tc_u_common *tp_c = tp->data;
1166 for (ht = rtnl_dereference(tp_c->hlist);
1258 struct tc_u_common *tp_c = tp->data;
1264 for (ht = rtnl_dereference(tp_c->hlist);