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