Lines Matching refs:exts
58 const struct tcf_exts *exts; member
79 tcf_exts_miss_cookie_base_alloc(struct tcf_exts *exts, struct tcf_proto *tp, in tcf_exts_miss_cookie_base_alloc() argument
97 n->exts = exts; in tcf_exts_miss_cookie_base_alloc()
105 exts->miss_cookie_node = n; in tcf_exts_miss_cookie_base_alloc()
113 static void tcf_exts_miss_cookie_base_destroy(struct tcf_exts *exts) in tcf_exts_miss_cookie_base_destroy() argument
117 if (!exts->miss_cookie_node) in tcf_exts_miss_cookie_base_destroy()
120 n = exts->miss_cookie_node; in tcf_exts_miss_cookie_base_destroy()
135 tcf_exts_miss_cookie_base_alloc(struct tcf_exts *exts, struct tcf_proto *tp, in tcf_exts_miss_cookie_base_alloc() argument
141 static void tcf_exts_miss_cookie_base_destroy(struct tcf_exts *exts) in tcf_exts_miss_cookie_base_destroy() argument
1672 struct tcf_exts *exts; in __tcf_classify() local
1686 exts = tp->ops->get_exts(tp, n->handle); in __tcf_classify()
1687 if (unlikely(!exts || n->exts != exts)) in __tcf_classify()
1691 err = tcf_exts_exec_ex(skb, exts, act_index, res); in __tcf_classify()
3205 int tcf_exts_init_ex(struct tcf_exts *exts, struct net *net, int action, in tcf_exts_init_ex() argument
3212 exts->type = 0; in tcf_exts_init_ex()
3213 exts->nr_actions = 0; in tcf_exts_init_ex()
3217 exts->net = net; in tcf_exts_init_ex()
3218 exts->actions = kcalloc(TCA_ACT_MAX_PRIO, sizeof(struct tc_action *), in tcf_exts_init_ex()
3220 if (!exts->actions) in tcf_exts_init_ex()
3224 exts->action = action; in tcf_exts_init_ex()
3225 exts->police = police; in tcf_exts_init_ex()
3230 err = tcf_exts_miss_cookie_base_alloc(exts, tp, handle); in tcf_exts_init_ex()
3237 tcf_exts_destroy(exts); in tcf_exts_init_ex()
3242 void tcf_exts_destroy(struct tcf_exts *exts) in tcf_exts_destroy() argument
3244 tcf_exts_miss_cookie_base_destroy(exts); in tcf_exts_destroy()
3247 if (exts->actions) { in tcf_exts_destroy()
3248 tcf_action_destroy(exts->actions, TCA_ACT_UNBIND); in tcf_exts_destroy()
3249 kfree(exts->actions); in tcf_exts_destroy()
3251 exts->nr_actions = 0; in tcf_exts_destroy()
3257 struct nlattr *rate_tlv, struct tcf_exts *exts, in tcf_exts_validate_ex() argument
3266 if (exts->police && tb[exts->police]) { in tcf_exts_validate_ex()
3269 a_o = tc_action_load_ops(tb[exts->police], true, in tcf_exts_validate_ex()
3275 act = tcf_action_init_1(net, tp, tb[exts->police], in tcf_exts_validate_ex()
3282 act->type = exts->type = TCA_OLD_COMPAT; in tcf_exts_validate_ex()
3283 exts->actions[0] = act; in tcf_exts_validate_ex()
3284 exts->nr_actions = 1; in tcf_exts_validate_ex()
3285 tcf_idr_insert_many(exts->actions); in tcf_exts_validate_ex()
3286 } else if (exts->action && tb[exts->action]) { in tcf_exts_validate_ex()
3290 err = tcf_action_init(net, tp, tb[exts->action], in tcf_exts_validate_ex()
3291 rate_tlv, exts->actions, init_res, in tcf_exts_validate_ex()
3296 exts->nr_actions = err; in tcf_exts_validate_ex()
3300 if ((exts->action && tb[exts->action]) || in tcf_exts_validate_ex()
3301 (exts->police && tb[exts->police])) { in tcf_exts_validate_ex()
3312 struct nlattr *rate_tlv, struct tcf_exts *exts, in tcf_exts_validate() argument
3315 return tcf_exts_validate_ex(net, tp, tb, rate_tlv, exts, in tcf_exts_validate()
3332 static struct tc_action *tcf_exts_first_act(struct tcf_exts *exts) in tcf_exts_first_act() argument
3334 if (exts->nr_actions == 0) in tcf_exts_first_act()
3337 return exts->actions[0]; in tcf_exts_first_act()
3341 int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts) in tcf_exts_dump() argument
3346 if (exts->action && tcf_exts_has_actions(exts)) { in tcf_exts_dump()
3352 if (exts->type != TCA_OLD_COMPAT) { in tcf_exts_dump()
3353 nest = nla_nest_start_noflag(skb, exts->action); in tcf_exts_dump()
3357 if (tcf_action_dump(skb, exts->actions, 0, 0, false) in tcf_exts_dump()
3361 } else if (exts->police) { in tcf_exts_dump()
3362 struct tc_action *act = tcf_exts_first_act(exts); in tcf_exts_dump()
3363 nest = nla_nest_start_noflag(skb, exts->police); in tcf_exts_dump()
3382 int tcf_exts_terse_dump(struct sk_buff *skb, struct tcf_exts *exts) in tcf_exts_terse_dump() argument
3387 if (!exts->action || !tcf_exts_has_actions(exts)) in tcf_exts_terse_dump()
3390 nest = nla_nest_start_noflag(skb, exts->action); in tcf_exts_terse_dump()
3394 if (tcf_action_dump(skb, exts->actions, 0, 0, true) < 0) in tcf_exts_terse_dump()
3408 int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts) in tcf_exts_dump_stats() argument
3411 struct tc_action *a = tcf_exts_first_act(exts); in tcf_exts_dump_stats()
3787 const struct tcf_exts *exts, in tc_setup_offload_action() argument
3793 if (!exts) in tc_setup_offload_action()
3796 miss_cookie_base = exts->miss_cookie_node ? in tc_setup_offload_action()
3797 exts->miss_cookie_node->miss_cookie_base : 0; in tc_setup_offload_action()
3798 return tc_setup_action(flow_action, exts->actions, miss_cookie_base, in tc_setup_offload_action()
3806 unsigned int tcf_exts_num_actions(struct tcf_exts *exts) in tcf_exts_num_actions() argument
3812 tcf_exts_for_each_action(i, act, exts) { in tcf_exts_num_actions()