Lines Matching refs:exts
56 const struct tcf_exts *exts; member
77 tcf_exts_miss_cookie_base_alloc(struct tcf_exts *exts, struct tcf_proto *tp, in tcf_exts_miss_cookie_base_alloc() argument
95 n->exts = exts; in tcf_exts_miss_cookie_base_alloc()
103 exts->miss_cookie_node = n; in tcf_exts_miss_cookie_base_alloc()
111 static void tcf_exts_miss_cookie_base_destroy(struct tcf_exts *exts) in tcf_exts_miss_cookie_base_destroy() argument
115 if (!exts->miss_cookie_node) in tcf_exts_miss_cookie_base_destroy()
118 n = exts->miss_cookie_node; in tcf_exts_miss_cookie_base_destroy()
133 tcf_exts_miss_cookie_base_alloc(struct tcf_exts *exts, struct tcf_proto *tp, in tcf_exts_miss_cookie_base_alloc() argument
139 static void tcf_exts_miss_cookie_base_destroy(struct tcf_exts *exts) in tcf_exts_miss_cookie_base_destroy() argument
1733 struct tcf_exts *exts; in __tcf_classify() local
1750 exts = tp->ops->get_exts(tp, n->handle); in __tcf_classify()
1751 if (unlikely(!exts || n->exts != exts)) { in __tcf_classify()
1758 err = tcf_exts_exec_ex(skb, exts, act_index, res); in __tcf_classify()
3338 int tcf_exts_init_ex(struct tcf_exts *exts, struct net *net, int action, in tcf_exts_init_ex() argument
3345 exts->type = 0; in tcf_exts_init_ex()
3346 exts->nr_actions = 0; in tcf_exts_init_ex()
3347 exts->miss_cookie_node = NULL; in tcf_exts_init_ex()
3351 exts->net = net; in tcf_exts_init_ex()
3352 exts->actions = kzalloc_objs(struct tc_action *, TCA_ACT_MAX_PRIO); in tcf_exts_init_ex()
3353 if (!exts->actions) in tcf_exts_init_ex()
3357 exts->action = action; in tcf_exts_init_ex()
3358 exts->police = police; in tcf_exts_init_ex()
3363 err = tcf_exts_miss_cookie_base_alloc(exts, tp, handle); in tcf_exts_init_ex()
3370 tcf_exts_destroy(exts); in tcf_exts_init_ex()
3372 exts->actions = NULL; in tcf_exts_init_ex()
3378 void tcf_exts_destroy(struct tcf_exts *exts) in tcf_exts_destroy() argument
3380 tcf_exts_miss_cookie_base_destroy(exts); in tcf_exts_destroy()
3383 if (exts->actions) { in tcf_exts_destroy()
3384 tcf_action_destroy(exts->actions, TCA_ACT_UNBIND); in tcf_exts_destroy()
3385 kfree(exts->actions); in tcf_exts_destroy()
3387 exts->nr_actions = 0; in tcf_exts_destroy()
3393 struct nlattr *rate_tlv, struct tcf_exts *exts, in tcf_exts_validate_ex() argument
3402 if (exts->police && tb[exts->police]) { in tcf_exts_validate_ex()
3406 a_o = tc_action_load_ops(tb[exts->police], flags, in tcf_exts_validate_ex()
3410 act = tcf_action_init_1(net, tp, tb[exts->police], in tcf_exts_validate_ex()
3417 act->type = exts->type = TCA_OLD_COMPAT; in tcf_exts_validate_ex()
3418 exts->actions[0] = act; in tcf_exts_validate_ex()
3419 exts->nr_actions = 1; in tcf_exts_validate_ex()
3420 tcf_idr_insert_many(exts->actions, init_res); in tcf_exts_validate_ex()
3421 } else if (exts->action && tb[exts->action]) { in tcf_exts_validate_ex()
3425 err = tcf_action_init(net, tp, tb[exts->action], in tcf_exts_validate_ex()
3426 rate_tlv, exts->actions, init_res, in tcf_exts_validate_ex()
3431 exts->nr_actions = err; in tcf_exts_validate_ex()
3435 if ((exts->action && tb[exts->action]) || in tcf_exts_validate_ex()
3436 (exts->police && tb[exts->police])) { in tcf_exts_validate_ex()
3447 struct nlattr *rate_tlv, struct tcf_exts *exts, in tcf_exts_validate() argument
3450 return tcf_exts_validate_ex(net, tp, tb, rate_tlv, exts, in tcf_exts_validate()
3467 static struct tc_action *tcf_exts_first_act(struct tcf_exts *exts) in tcf_exts_first_act() argument
3469 if (exts->nr_actions == 0) in tcf_exts_first_act()
3472 return exts->actions[0]; in tcf_exts_first_act()
3476 int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts) in tcf_exts_dump() argument
3481 if (exts->action && tcf_exts_has_actions(exts)) { in tcf_exts_dump()
3487 if (exts->type != TCA_OLD_COMPAT) { in tcf_exts_dump()
3488 nest = nla_nest_start_noflag(skb, exts->action); in tcf_exts_dump()
3492 if (tcf_action_dump(skb, exts->actions, 0, 0, false) in tcf_exts_dump()
3496 } else if (exts->police) { in tcf_exts_dump()
3497 struct tc_action *act = tcf_exts_first_act(exts); in tcf_exts_dump()
3498 nest = nla_nest_start_noflag(skb, exts->police); in tcf_exts_dump()
3517 int tcf_exts_terse_dump(struct sk_buff *skb, struct tcf_exts *exts) in tcf_exts_terse_dump() argument
3522 if (!exts->action || !tcf_exts_has_actions(exts)) in tcf_exts_terse_dump()
3525 nest = nla_nest_start_noflag(skb, exts->action); in tcf_exts_terse_dump()
3529 if (tcf_action_dump(skb, exts->actions, 0, 0, true) < 0) in tcf_exts_terse_dump()
3543 int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts) in tcf_exts_dump_stats() argument
3546 struct tc_action *a = tcf_exts_first_act(exts); in tcf_exts_dump_stats()
3922 const struct tcf_exts *exts, in tc_setup_offload_action() argument
3928 if (!exts) in tc_setup_offload_action()
3931 miss_cookie_base = exts->miss_cookie_node ? in tc_setup_offload_action()
3932 exts->miss_cookie_node->miss_cookie_base : 0; in tc_setup_offload_action()
3933 return tc_setup_action(flow_action, exts->actions, miss_cookie_base, in tc_setup_offload_action()
3941 unsigned int tcf_exts_num_actions(struct tcf_exts *exts) in tcf_exts_num_actions() argument
3947 tcf_exts_for_each_action(i, act, exts) { in tcf_exts_num_actions()