Lines Matching refs:exts

56 	const struct tcf_exts *exts;
65 * action index in the exts tc actions array.
77 tcf_exts_miss_cookie_base_alloc(struct tcf_exts *exts, struct tcf_proto *tp,
95 n->exts = exts;
103 exts->miss_cookie_node = n;
111 static void tcf_exts_miss_cookie_base_destroy(struct tcf_exts *exts)
115 if (!exts->miss_cookie_node)
118 n = exts->miss_cookie_node;
133 tcf_exts_miss_cookie_base_alloc(struct tcf_exts *exts, struct tcf_proto *tp,
139 static void tcf_exts_miss_cookie_base_destroy(struct tcf_exts *exts)
1679 struct tcf_exts *exts;
1686 * check if any of tp,chain,exts was replaced by the
1693 exts = tp->ops->get_exts(tp, n->handle);
1694 if (unlikely(!exts || n->exts != exts))
1698 err = tcf_exts_exec_ex(skb, exts, act_index, res);
3214 int tcf_exts_init_ex(struct tcf_exts *exts, struct net *net, int action,
3221 exts->type = 0;
3222 exts->nr_actions = 0;
3223 exts->miss_cookie_node = NULL;
3227 exts->net = net;
3228 exts->actions = kcalloc(TCA_ACT_MAX_PRIO, sizeof(struct tc_action *),
3230 if (!exts->actions)
3234 exts->action = action;
3235 exts->police = police;
3240 err = tcf_exts_miss_cookie_base_alloc(exts, tp, handle);
3247 tcf_exts_destroy(exts);
3249 exts->actions = NULL;
3255 void tcf_exts_destroy(struct tcf_exts *exts)
3257 tcf_exts_miss_cookie_base_destroy(exts);
3260 if (exts->actions) {
3261 tcf_action_destroy(exts->actions, TCA_ACT_UNBIND);
3262 kfree(exts->actions);
3264 exts->nr_actions = 0;
3270 struct nlattr *rate_tlv, struct tcf_exts *exts,
3279 if (exts->police && tb[exts->police]) {
3282 a_o = tc_action_load_ops(tb[exts->police], true,
3288 act = tcf_action_init_1(net, tp, tb[exts->police],
3295 act->type = exts->type = TCA_OLD_COMPAT;
3296 exts->actions[0] = act;
3297 exts->nr_actions = 1;
3298 tcf_idr_insert_many(exts->actions);
3299 } else if (exts->action && tb[exts->action]) {
3303 err = tcf_action_init(net, tp, tb[exts->action],
3304 rate_tlv, exts->actions, init_res,
3309 exts->nr_actions = err;
3313 if ((exts->action && tb[exts->action]) ||
3314 (exts->police && tb[exts->police])) {
3325 struct nlattr *rate_tlv, struct tcf_exts *exts,
3328 return tcf_exts_validate_ex(net, tp, tb, rate_tlv, exts,
3345 static struct tc_action *tcf_exts_first_act(struct tcf_exts *exts)
3347 if (exts->nr_actions == 0)
3350 return exts->actions[0];
3354 int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts)
3359 if (exts->action && tcf_exts_has_actions(exts)) {
3365 if (exts->type != TCA_OLD_COMPAT) {
3366 nest = nla_nest_start_noflag(skb, exts->action);
3370 if (tcf_action_dump(skb, exts->actions, 0, 0, false)
3374 } else if (exts->police) {
3375 struct tc_action *act = tcf_exts_first_act(exts);
3376 nest = nla_nest_start_noflag(skb, exts->police);
3395 int tcf_exts_terse_dump(struct sk_buff *skb, struct tcf_exts *exts)
3400 if (!exts->action || !tcf_exts_has_actions(exts))
3403 nest = nla_nest_start_noflag(skb, exts->action);
3407 if (tcf_action_dump(skb, exts->actions, 0, 0, true) < 0)
3421 int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts)
3424 struct tc_action *a = tcf_exts_first_act(exts);
3800 const struct tcf_exts *exts,
3806 if (!exts)
3809 miss_cookie_base = exts->miss_cookie_node ?
3810 exts->miss_cookie_node->miss_cookie_base : 0;
3811 return tc_setup_action(flow_action, exts->actions, miss_cookie_base,
3819 unsigned int tcf_exts_num_actions(struct tcf_exts *exts)
3825 tcf_exts_for_each_action(i, act, exts) {