Commit 9fb9f251 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

net: sched: push tp down to action init

Tp pointer will be needed by the next patch in order to get the chain.
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5bc17018
...@@ -180,12 +180,12 @@ int tcf_unregister_action(struct tc_action_ops *a, ...@@ -180,12 +180,12 @@ int tcf_unregister_action(struct tc_action_ops *a,
int tcf_action_destroy(struct list_head *actions, int bind); int tcf_action_destroy(struct list_head *actions, int bind);
int tcf_action_exec(struct sk_buff *skb, struct tc_action **actions, int tcf_action_exec(struct sk_buff *skb, struct tc_action **actions,
int nr_actions, struct tcf_result *res); int nr_actions, struct tcf_result *res);
int tcf_action_init(struct net *net, struct nlattr *nla, int tcf_action_init(struct net *net, struct tcf_proto *tp, struct nlattr *nla,
struct nlattr *est, char *n, int ovr, struct nlattr *est, char *name, int ovr, int bind,
int bind, struct list_head *); struct list_head *actions);
struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla, struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
struct nlattr *est, char *n, int ovr, struct nlattr *nla, struct nlattr *est,
int bind); char *name, int ovr, int bind);
int tcf_action_dump(struct sk_buff *skb, struct list_head *, int, int); int tcf_action_dump(struct sk_buff *skb, struct list_head *, int, int);
int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int); int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int);
int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int); int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int);
......
...@@ -570,9 +570,9 @@ static struct tc_cookie *nla_memdup_cookie(struct nlattr **tb) ...@@ -570,9 +570,9 @@ static struct tc_cookie *nla_memdup_cookie(struct nlattr **tb)
return c; return c;
} }
struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla, struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
struct nlattr *est, char *name, int ovr, struct nlattr *nla, struct nlattr *est,
int bind) char *name, int ovr, int bind)
{ {
struct tc_action *a; struct tc_action *a;
struct tc_action_ops *a_o; struct tc_action_ops *a_o;
...@@ -680,8 +680,9 @@ static void cleanup_a(struct list_head *actions, int ovr) ...@@ -680,8 +680,9 @@ static void cleanup_a(struct list_head *actions, int ovr)
a->tcfa_refcnt--; a->tcfa_refcnt--;
} }
int tcf_action_init(struct net *net, struct nlattr *nla, struct nlattr *est, int tcf_action_init(struct net *net, struct tcf_proto *tp, struct nlattr *nla,
char *name, int ovr, int bind, struct list_head *actions) struct nlattr *est, char *name, int ovr, int bind,
struct list_head *actions)
{ {
struct nlattr *tb[TCA_ACT_MAX_PRIO + 1]; struct nlattr *tb[TCA_ACT_MAX_PRIO + 1];
struct tc_action *act; struct tc_action *act;
...@@ -693,7 +694,7 @@ int tcf_action_init(struct net *net, struct nlattr *nla, struct nlattr *est, ...@@ -693,7 +694,7 @@ int tcf_action_init(struct net *net, struct nlattr *nla, struct nlattr *est,
return err; return err;
for (i = 1; i <= TCA_ACT_MAX_PRIO && tb[i]; i++) { for (i = 1; i <= TCA_ACT_MAX_PRIO && tb[i]; i++) {
act = tcf_action_init_1(net, tb[i], est, name, ovr, bind); act = tcf_action_init_1(net, tp, tb[i], est, name, ovr, bind);
if (IS_ERR(act)) { if (IS_ERR(act)) {
err = PTR_ERR(act); err = PTR_ERR(act);
goto err; goto err;
...@@ -1020,7 +1021,7 @@ static int tcf_action_add(struct net *net, struct nlattr *nla, ...@@ -1020,7 +1021,7 @@ static int tcf_action_add(struct net *net, struct nlattr *nla,
int ret = 0; int ret = 0;
LIST_HEAD(actions); LIST_HEAD(actions);
ret = tcf_action_init(net, nla, NULL, NULL, ovr, 0, &actions); ret = tcf_action_init(net, NULL, nla, NULL, NULL, ovr, 0, &actions);
if (ret) if (ret)
return ret; return ret;
......
...@@ -832,8 +832,9 @@ int tcf_exts_validate(struct net *net, struct tcf_proto *tp, struct nlattr **tb, ...@@ -832,8 +832,9 @@ int tcf_exts_validate(struct net *net, struct tcf_proto *tp, struct nlattr **tb,
struct tc_action *act; struct tc_action *act;
if (exts->police && tb[exts->police]) { if (exts->police && tb[exts->police]) {
act = tcf_action_init_1(net, tb[exts->police], rate_tlv, act = tcf_action_init_1(net, tp, tb[exts->police],
"police", ovr, TCA_ACT_BIND); rate_tlv, "police", ovr,
TCA_ACT_BIND);
if (IS_ERR(act)) if (IS_ERR(act))
return PTR_ERR(act); return PTR_ERR(act);
...@@ -844,8 +845,8 @@ int tcf_exts_validate(struct net *net, struct tcf_proto *tp, struct nlattr **tb, ...@@ -844,8 +845,8 @@ int tcf_exts_validate(struct net *net, struct tcf_proto *tp, struct nlattr **tb,
LIST_HEAD(actions); LIST_HEAD(actions);
int err, i = 0; int err, i = 0;
err = tcf_action_init(net, tb[exts->action], rate_tlv, err = tcf_action_init(net, tp, tb[exts->action],
NULL, ovr, TCA_ACT_BIND, rate_tlv, NULL, ovr, TCA_ACT_BIND,
&actions); &actions);
if (err) if (err)
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment