Lines Matching defs: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)
1739 struct tcf_exts *exts;
1746 * check if any of tp,chain,exts was replaced by the
1756 exts = tp->ops->get_exts(tp, n->handle);
1757 if (unlikely(!exts || n->exts != exts)) {
1764 err = tcf_exts_exec_ex(skb, exts, act_index, res);
3301 int tcf_exts_init_ex(struct tcf_exts *exts, struct net *net, int action,
3308 exts->type = 0;
3309 exts->nr_actions = 0;
3310 exts->miss_cookie_node = NULL;
3314 exts->net = net;
3315 exts->actions = kcalloc(TCA_ACT_MAX_PRIO, sizeof(struct tc_action *),
3317 if (!exts->actions)
3321 exts->action = action;
3322 exts->police = police;
3327 err = tcf_exts_miss_cookie_base_alloc(exts, tp, handle);
3334 tcf_exts_destroy(exts);
3336 exts->actions = NULL;
3342 void tcf_exts_destroy(struct tcf_exts *exts)
3344 tcf_exts_miss_cookie_base_destroy(exts);
3347 if (exts->actions) {
3348 tcf_action_destroy(exts->actions, TCA_ACT_UNBIND);
3349 kfree(exts->actions);
3351 exts->nr_actions = 0;
3357 struct nlattr *rate_tlv, struct tcf_exts *exts,
3366 if (exts->police && tb[exts->police]) {
3370 a_o = tc_action_load_ops(tb[exts->police], flags,
3374 act = tcf_action_init_1(net, tp, tb[exts->police],
3381 act->type = exts->type = TCA_OLD_COMPAT;
3382 exts->actions[0] = act;
3383 exts->nr_actions = 1;
3384 tcf_idr_insert_many(exts->actions, init_res);
3385 } else if (exts->action && tb[exts->action]) {
3389 err = tcf_action_init(net, tp, tb[exts->action],
3390 rate_tlv, exts->actions, init_res,
3395 exts->nr_actions = err;
3399 if ((exts->action && tb[exts->action]) ||
3400 (exts->police && tb[exts->police])) {
3411 struct nlattr *rate_tlv, struct tcf_exts *exts,
3414 return tcf_exts_validate_ex(net, tp, tb, rate_tlv, exts,
3431 static struct tc_action *tcf_exts_first_act(struct tcf_exts *exts)
3433 if (exts->nr_actions == 0)
3436 return exts->actions[0];
3440 int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts)
3445 if (exts->action && tcf_exts_has_actions(exts)) {
3451 if (exts->type != TCA_OLD_COMPAT) {
3452 nest = nla_nest_start_noflag(skb, exts->action);
3456 if (tcf_action_dump(skb, exts->actions, 0, 0, false)
3460 } else if (exts->police) {
3461 struct tc_action *act = tcf_exts_first_act(exts);
3462 nest = nla_nest_start_noflag(skb, exts->police);
3481 int tcf_exts_terse_dump(struct sk_buff *skb, struct tcf_exts *exts)
3486 if (!exts->action || !tcf_exts_has_actions(exts))
3489 nest = nla_nest_start_noflag(skb, exts->action);
3493 if (tcf_action_dump(skb, exts->actions, 0, 0, true) < 0)
3507 int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts)
3510 struct tc_action *a = tcf_exts_first_act(exts);
3890 const struct tcf_exts *exts,
3896 if (!exts)
3899 miss_cookie_base = exts->miss_cookie_node ?
3900 exts->miss_cookie_node->miss_cookie_base : 0;
3901 return tc_setup_action(flow_action, exts->actions, miss_cookie_base,
3909 unsigned int tcf_exts_num_actions(struct tcf_exts *exts)
3915 tcf_exts_for_each_action(i, act, exts) {