Lines Matching defs:tp

105 				   const struct tcf_proto *tp,
113 struct tc_u_hnode *ht = rcu_dereference_bh(tp->root);
288 static void *u32_get(struct tcf_proto *tp, u32 handle)
291 struct tc_u_common *tp_c = tp->data;
294 ht = rtnl_dereference(tp->root);
321 static void *tc_u_common_ptr(const struct tcf_proto *tp)
323 struct tcf_block *block = tp->chain->block;
352 static int u32_init(struct tcf_proto *tp)
355 void *key = tc_u_common_ptr(tp);
364 root_ht->prio = tp->prio;
388 rcu_assign_pointer(tp->root, root_ht);
389 tp->data = tp_c;
452 static int u32_delete_key(struct tcf_proto *tp, struct tc_u_knode *key)
454 struct tc_u_common *tp_c = tp->data;
467 tcf_unbind_filter(tp, &key->res);
479 static void u32_clear_hw_hnode(struct tcf_proto *tp, struct tc_u_hnode *h,
482 struct tcf_block *block = tp->chain->block;
485 tc_cls_common_offload_init(&cls_u32.common, tp, h->flags, extack);
494 static int u32_replace_hw_hnode(struct tcf_proto *tp, struct tc_u_hnode *h,
497 struct tcf_block *block = tp->chain->block;
503 tc_cls_common_offload_init(&cls_u32.common, tp, flags, extack);
511 u32_clear_hw_hnode(tp, h, NULL);
523 static void u32_remove_hw_knode(struct tcf_proto *tp, struct tc_u_knode *n,
526 struct tcf_block *block = tp->chain->block;
529 tc_cls_common_offload_init(&cls_u32.common, tp, n->flags, extack);
533 tc_setup_cb_destroy(block, tp, TC_SETUP_CLSU32, &cls_u32, false,
537 static int u32_replace_hw_knode(struct tcf_proto *tp, struct tc_u_knode *n,
541 struct tcf_block *block = tp->chain->block;
546 tc_cls_common_offload_init(&cls_u32.common, tp, flags, extack);
563 err = tc_setup_cb_add(block, tp, TC_SETUP_CLSU32, &cls_u32, skip_sw,
566 u32_remove_hw_knode(tp, n, NULL);
576 static void u32_clear_hnode(struct tcf_proto *tp, struct tc_u_hnode *ht,
579 struct tc_u_common *tp_c = tp->data;
588 tcf_unbind_filter(tp, &n->res);
589 u32_remove_hw_knode(tp, n, extack);
599 static int u32_destroy_hnode(struct tcf_proto *tp, struct tc_u_hnode *ht,
602 struct tc_u_common *tp_c = tp->data;
606 u32_clear_hnode(tp, ht, extack);
613 u32_clear_hw_hnode(tp, ht, extack);
625 static void u32_destroy(struct tcf_proto *tp, bool rtnl_held,
628 struct tc_u_common *tp_c = tp->data;
629 struct tc_u_hnode *root_ht = rtnl_dereference(tp->root);
634 u32_destroy_hnode(tp, root_ht, extack);
642 u32_clear_hnode(tp, ht, extack);
656 tp->data = NULL;
659 static int u32_delete(struct tcf_proto *tp, void *arg, bool *last,
663 struct tc_u_common *tp_c = tp->data;
667 u32_remove_hw_knode(tp, (struct tc_u_knode *)ht, extack);
668 ret = u32_delete_key(tp, (struct tc_u_knode *)ht);
678 u32_destroy_hnode(tp, ht, extack);
715 static void u32_unbind_filter(struct tcf_proto *tp, struct tc_u_knode *n,
719 tcf_unbind_filter(tp, &n->res);
722 static void u32_bind_filter(struct tcf_proto *tp, struct tc_u_knode *n,
727 tcf_bind_filter(tp, &n->res, base);
731 static int u32_set_parms(struct net *net, struct tcf_proto *tp,
738 err = tcf_exts_validate_ex(net, tp, tb, est, &n->exts, flags,
759 ht_down = u32_lookup_ht(tp->data, handle);
785 static void u32_replace_knode(struct tcf_proto *tp, struct tc_u_common *tp_c,
793 ht = rtnl_dereference(tp->root);
812 static struct tc_u_knode *u32_init_knode(struct net *net, struct tcf_proto *tp,
861 struct tcf_proto *tp, unsigned long base, u32 handle,
865 struct tc_u_common *tp_c = tp->data;
912 new = u32_init_knode(net, tp, n);
916 err = u32_set_parms(net, tp, new, tb, tca[TCA_RATE],
924 u32_bind_filter(tp, new, base, tb);
926 err = u32_replace_hw_knode(tp, new, flags, extack);
928 u32_unbind_filter(tp, new, tb);
944 u32_replace_knode(tp, tp_c, new);
945 tcf_unbind_filter(tp, &n->res);
970 handle = gen_new_htid(tp->data, ht);
986 ht->prio = tp->prio;
990 err = u32_replace_hw_hnode(tp, ht, userflags, extack);
1007 ht = rtnl_dereference(tp->root);
1010 ht = u32_lookup_ht(tp->data, TC_U32_HTID(htid));
1017 ht = rtnl_dereference(tp->root);
1141 err = u32_set_parms(net, tp, n, tb, tca[TCA_RATE],
1144 u32_bind_filter(tp, n, base, tb);
1150 err = u32_replace_hw_knode(tp, n, flags, extack);
1171 u32_unbind_filter(tp, n, tb);
1189 static void u32_walk(struct tcf_proto *tp, struct tcf_walker *arg,
1192 struct tc_u_common *tp_c = tp->data;
1203 if (ht->prio != tp->prio)
1206 if (!tc_cls_stats_dump(tp, arg, ht))
1213 if (!tc_cls_stats_dump(tp, arg, n))
1220 static int u32_reoffload_hnode(struct tcf_proto *tp, struct tc_u_hnode *ht,
1227 tc_cls_common_offload_init(&cls_u32.common, tp, ht->flags, extack);
1240 static int u32_reoffload_knode(struct tcf_proto *tp, struct tc_u_knode *n,
1245 struct tcf_block *block = tp->chain->block;
1248 tc_cls_common_offload_init(&cls_u32.common, tp, n->flags, extack);
1269 return tc_setup_cb_reoffload(block, tp, add, cb, TC_SETUP_CLSU32,
1274 static int u32_reoffload(struct tcf_proto *tp, bool add, flow_setup_cb_t *cb,
1277 struct tc_u_common *tp_c = tp->data;
1286 if (ht->prio != tp->prio)
1294 err = u32_reoffload_hnode(tp, ht, add, cb, cb_priv,
1307 err = u32_reoffload_knode(tp, n, add, cb,
1315 u32_reoffload_hnode(tp, ht, add, cb, cb_priv, extack);
1329 static int u32_dump(struct net *net, struct tcf_proto *tp, void *fh,