net: Revert sched action extack support series.
It was mis-applied and the changes had rejects. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -87,13 +87,12 @@ struct tc_action_ops {
|
|||||||
struct tcf_result *);
|
struct tcf_result *);
|
||||||
int (*dump)(struct sk_buff *, struct tc_action *, int, int);
|
int (*dump)(struct sk_buff *, struct tc_action *, int, int);
|
||||||
void (*cleanup)(struct tc_action *);
|
void (*cleanup)(struct tc_action *);
|
||||||
int (*lookup)(struct net *net, struct tc_action **a, u32 index);
|
int (*lookup)(struct net *, struct tc_action **, u32);
|
||||||
int (*init)(struct net *net, struct nlattr *nla,
|
int (*init)(struct net *net, struct nlattr *nla,
|
||||||
struct nlattr *est, struct tc_action **act, int ovr,
|
struct nlattr *est, struct tc_action **act, int ovr,
|
||||||
int bind);
|
int bind);
|
||||||
int (*walk)(struct net *, struct sk_buff *,
|
int (*walk)(struct net *, struct sk_buff *,
|
||||||
struct netlink_callback *, int,
|
struct netlink_callback *, int, const struct tc_action_ops *);
|
||||||
const struct tc_action_ops *);
|
|
||||||
void (*stats_update)(struct tc_action *, u64, u32, u64);
|
void (*stats_update)(struct tc_action *, u64, u32, u64);
|
||||||
struct net_device *(*get_dev)(const struct tc_action *a);
|
struct net_device *(*get_dev)(const struct tc_action *a);
|
||||||
};
|
};
|
||||||
@@ -163,11 +162,10 @@ 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 tcf_proto *tp, struct nlattr *nla,
|
int tcf_action_init(struct net *net, struct tcf_proto *tp, struct nlattr *nla,
|
||||||
struct nlattr *est, char *name, int ovr, int bind,
|
struct nlattr *est, char *name, int ovr, int bind,
|
||||||
struct list_head *actions, struct netlink_ext_ack *extack);
|
struct list_head *actions);
|
||||||
struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
|
struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
|
||||||
struct nlattr *nla, struct nlattr *est,
|
struct nlattr *nla, struct nlattr *est,
|
||||||
char *name, int ovr, int bind,
|
char *name, int ovr, int bind);
|
||||||
struct netlink_ext_ack *extack);
|
|
||||||
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);
|
||||||
|
@@ -605,8 +605,7 @@ static struct tc_cookie *nla_memdup_cookie(struct nlattr **tb)
|
|||||||
|
|
||||||
struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
|
struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
|
||||||
struct nlattr *nla, struct nlattr *est,
|
struct nlattr *nla, struct nlattr *est,
|
||||||
char *name, int ovr, int bind,
|
char *name, int ovr, int bind)
|
||||||
struct netlink_ext_ack *extack)
|
|
||||||
{
|
{
|
||||||
struct tc_action *a;
|
struct tc_action *a;
|
||||||
struct tc_action_ops *a_o;
|
struct tc_action_ops *a_o;
|
||||||
@@ -622,7 +621,7 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
|
|||||||
goto err_out;
|
goto err_out;
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
kind = tb[TCA_ACT_KIND];
|
kind = tb[TCA_ACT_KIND];
|
||||||
if (!kind)
|
if (kind == NULL)
|
||||||
goto err_out;
|
goto err_out;
|
||||||
if (nla_strlcpy(act_name, kind, IFNAMSIZ) >= IFNAMSIZ)
|
if (nla_strlcpy(act_name, kind, IFNAMSIZ) >= IFNAMSIZ)
|
||||||
goto err_out;
|
goto err_out;
|
||||||
@@ -727,7 +726,7 @@ static void cleanup_a(struct list_head *actions, int ovr)
|
|||||||
|
|
||||||
int tcf_action_init(struct net *net, struct tcf_proto *tp, struct nlattr *nla,
|
int tcf_action_init(struct net *net, struct tcf_proto *tp, struct nlattr *nla,
|
||||||
struct nlattr *est, char *name, int ovr, int bind,
|
struct nlattr *est, char *name, int ovr, int bind,
|
||||||
struct list_head *actions, struct netlink_ext_ack *extack)
|
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;
|
||||||
@@ -739,8 +738,7 @@ int tcf_action_init(struct net *net, struct tcf_proto *tp, struct nlattr *nla,
|
|||||||
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, tp, tb[i], est, name, ovr, bind,
|
act = tcf_action_init_1(net, tp, tb[i], est, name, ovr, bind);
|
||||||
extack);
|
|
||||||
if (IS_ERR(act)) {
|
if (IS_ERR(act)) {
|
||||||
err = PTR_ERR(act);
|
err = PTR_ERR(act);
|
||||||
goto err;
|
goto err;
|
||||||
@@ -824,7 +822,7 @@ static int tca_get_fill(struct sk_buff *skb, struct list_head *actions,
|
|||||||
t->tca__pad2 = 0;
|
t->tca__pad2 = 0;
|
||||||
|
|
||||||
nest = nla_nest_start(skb, TCA_ACT_TAB);
|
nest = nla_nest_start(skb, TCA_ACT_TAB);
|
||||||
if (!nest)
|
if (nest == NULL)
|
||||||
goto out_nlmsg_trim;
|
goto out_nlmsg_trim;
|
||||||
|
|
||||||
if (tcf_action_dump(skb, actions, bind, ref) < 0)
|
if (tcf_action_dump(skb, actions, bind, ref) < 0)
|
||||||
@@ -936,7 +934,7 @@ static int tca_action_flush(struct net *net, struct nlattr *nla,
|
|||||||
t->tca__pad2 = 0;
|
t->tca__pad2 = 0;
|
||||||
|
|
||||||
nest = nla_nest_start(skb, TCA_ACT_TAB);
|
nest = nla_nest_start(skb, TCA_ACT_TAB);
|
||||||
if (!nest)
|
if (nest == NULL)
|
||||||
goto out_module_put;
|
goto out_module_put;
|
||||||
|
|
||||||
err = ops->walk(net, skb, &dcb, RTM_DELACTION, ops);
|
err = ops->walk(net, skb, &dcb, RTM_DELACTION, ops);
|
||||||
@@ -1009,9 +1007,9 @@ tca_action_gd(struct net *net, struct nlattr *nla, struct nlmsghdr *n,
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (event == RTM_DELACTION && n->nlmsg_flags & NLM_F_ROOT) {
|
if (event == RTM_DELACTION && n->nlmsg_flags & NLM_F_ROOT) {
|
||||||
if (tb[1])
|
if (tb[1] != NULL)
|
||||||
return tca_action_flush(net, tb[1], n, portid);
|
return tca_action_flush(net, tb[1], n, portid);
|
||||||
|
else
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1064,14 +1062,12 @@ tcf_add_notify(struct net *net, struct nlmsghdr *n, struct list_head *actions,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int tcf_action_add(struct net *net, struct nlattr *nla,
|
static int tcf_action_add(struct net *net, struct nlattr *nla,
|
||||||
struct nlmsghdr *n, u32 portid, int ovr,
|
struct nlmsghdr *n, u32 portid, int ovr)
|
||||||
struct netlink_ext_ack *extack)
|
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
LIST_HEAD(actions);
|
LIST_HEAD(actions);
|
||||||
|
|
||||||
ret = tcf_action_init(net, NULL, nla, NULL, NULL, ovr, 0, &actions,
|
ret = tcf_action_init(net, NULL, nla, NULL, NULL, ovr, 0, &actions);
|
||||||
extack);
|
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@@ -1119,8 +1115,7 @@ static int tc_ctl_action(struct sk_buff *skb, struct nlmsghdr *n,
|
|||||||
if (n->nlmsg_flags & NLM_F_REPLACE)
|
if (n->nlmsg_flags & NLM_F_REPLACE)
|
||||||
ovr = 1;
|
ovr = 1;
|
||||||
replay:
|
replay:
|
||||||
ret = tcf_action_add(net, tca[TCA_ACT_TAB], n, portid, ovr,
|
ret = tcf_action_add(net, tca[TCA_ACT_TAB], n, portid, ovr);
|
||||||
extack);
|
|
||||||
if (ret == -EAGAIN)
|
if (ret == -EAGAIN)
|
||||||
goto replay;
|
goto replay;
|
||||||
break;
|
break;
|
||||||
|
@@ -80,12 +80,12 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla,
|
|||||||
bool exists = false;
|
bool exists = false;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!nla)
|
if (nla == NULL)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
ret = nla_parse_nested(tb, TCA_MIRRED_MAX, nla, mirred_policy, NULL);
|
ret = nla_parse_nested(tb, TCA_MIRRED_MAX, nla, mirred_policy, NULL);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
if (!tb[TCA_MIRRED_PARMS])
|
if (tb[TCA_MIRRED_PARMS] == NULL)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
parm = nla_data(tb[TCA_MIRRED_PARMS]);
|
parm = nla_data(tb[TCA_MIRRED_PARMS]);
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!exists) {
|
if (!exists) {
|
||||||
if (!dev)
|
if (dev == NULL)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
ret = tcf_idr_create(tn, parm->index, est, a,
|
ret = tcf_idr_create(tn, parm->index, est, a,
|
||||||
&act_mirred_ops, bind, true);
|
&act_mirred_ops, bind, true);
|
||||||
|
@@ -1434,7 +1434,7 @@ int tcf_exts_validate(struct net *net, struct tcf_proto *tp, struct nlattr **tb,
|
|||||||
if (exts->police && tb[exts->police]) {
|
if (exts->police && tb[exts->police]) {
|
||||||
act = tcf_action_init_1(net, tp, tb[exts->police],
|
act = tcf_action_init_1(net, tp, tb[exts->police],
|
||||||
rate_tlv, "police", ovr,
|
rate_tlv, "police", ovr,
|
||||||
TCA_ACT_BIND, extack);
|
TCA_ACT_BIND);
|
||||||
if (IS_ERR(act))
|
if (IS_ERR(act))
|
||||||
return PTR_ERR(act);
|
return PTR_ERR(act);
|
||||||
|
|
||||||
@@ -1447,7 +1447,7 @@ int tcf_exts_validate(struct net *net, struct tcf_proto *tp, struct nlattr **tb,
|
|||||||
|
|
||||||
err = tcf_action_init(net, tp, tb[exts->action],
|
err = tcf_action_init(net, tp, tb[exts->action],
|
||||||
rate_tlv, NULL, ovr, TCA_ACT_BIND,
|
rate_tlv, NULL, ovr, TCA_ACT_BIND,
|
||||||
&actions, extack);
|
&actions);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
list_for_each_entry(act, &actions, list)
|
list_for_each_entry(act, &actions, list)
|
||||||
|
Reference in New Issue
Block a user