Skip to content

Commit ee99b2d

Browse files
committed
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>
1 parent f6581c7 commit ee99b2d

File tree

4 files changed

+21
-28
lines changed

4 files changed

+21
-28
lines changed

include/net/act_api.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,12 @@ struct tc_action_ops {
8787
struct tcf_result *);
8888
int (*dump)(struct sk_buff *, struct tc_action *, int, int);
8989
void (*cleanup)(struct tc_action *);
90-
int (*lookup)(struct net *net, struct tc_action **a, u32 index);
90+
int (*lookup)(struct net *, struct tc_action **, u32);
9191
int (*init)(struct net *net, struct nlattr *nla,
9292
struct nlattr *est, struct tc_action **act, int ovr,
9393
int bind);
9494
int (*walk)(struct net *, struct sk_buff *,
95-
struct netlink_callback *, int,
96-
const struct tc_action_ops *);
95+
struct netlink_callback *, int, const struct tc_action_ops *);
9796
void (*stats_update)(struct tc_action *, u64, u32, u64);
9897
struct net_device *(*get_dev)(const struct tc_action *a);
9998
};
@@ -163,11 +162,10 @@ int tcf_action_exec(struct sk_buff *skb, struct tc_action **actions,
163162
int nr_actions, struct tcf_result *res);
164163
int tcf_action_init(struct net *net, struct tcf_proto *tp, struct nlattr *nla,
165164
struct nlattr *est, char *name, int ovr, int bind,
166-
struct list_head *actions, struct netlink_ext_ack *extack);
165+
struct list_head *actions);
167166
struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
168167
struct nlattr *nla, struct nlattr *est,
169-
char *name, int ovr, int bind,
170-
struct netlink_ext_ack *extack);
168+
char *name, int ovr, int bind);
171169
int tcf_action_dump(struct sk_buff *skb, struct list_head *, int, int);
172170
int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int);
173171
int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int);

net/sched/act_api.c

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -605,8 +605,7 @@ static struct tc_cookie *nla_memdup_cookie(struct nlattr **tb)
605605

606606
struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
607607
struct nlattr *nla, struct nlattr *est,
608-
char *name, int ovr, int bind,
609-
struct netlink_ext_ack *extack)
608+
char *name, int ovr, int bind)
610609
{
611610
struct tc_action *a;
612611
struct tc_action_ops *a_o;
@@ -622,7 +621,7 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
622621
goto err_out;
623622
err = -EINVAL;
624623
kind = tb[TCA_ACT_KIND];
625-
if (!kind)
624+
if (kind == NULL)
626625
goto err_out;
627626
if (nla_strlcpy(act_name, kind, IFNAMSIZ) >= IFNAMSIZ)
628627
goto err_out;
@@ -727,7 +726,7 @@ static void cleanup_a(struct list_head *actions, int ovr)
727726

728727
int tcf_action_init(struct net *net, struct tcf_proto *tp, struct nlattr *nla,
729728
struct nlattr *est, char *name, int ovr, int bind,
730-
struct list_head *actions, struct netlink_ext_ack *extack)
729+
struct list_head *actions)
731730
{
732731
struct nlattr *tb[TCA_ACT_MAX_PRIO + 1];
733732
struct tc_action *act;
@@ -739,8 +738,7 @@ int tcf_action_init(struct net *net, struct tcf_proto *tp, struct nlattr *nla,
739738
return err;
740739

741740
for (i = 1; i <= TCA_ACT_MAX_PRIO && tb[i]; i++) {
742-
act = tcf_action_init_1(net, tp, tb[i], est, name, ovr, bind,
743-
extack);
741+
act = tcf_action_init_1(net, tp, tb[i], est, name, ovr, bind);
744742
if (IS_ERR(act)) {
745743
err = PTR_ERR(act);
746744
goto err;
@@ -824,7 +822,7 @@ static int tca_get_fill(struct sk_buff *skb, struct list_head *actions,
824822
t->tca__pad2 = 0;
825823

826824
nest = nla_nest_start(skb, TCA_ACT_TAB);
827-
if (!nest)
825+
if (nest == NULL)
828826
goto out_nlmsg_trim;
829827

830828
if (tcf_action_dump(skb, actions, bind, ref) < 0)
@@ -936,7 +934,7 @@ static int tca_action_flush(struct net *net, struct nlattr *nla,
936934
t->tca__pad2 = 0;
937935

938936
nest = nla_nest_start(skb, TCA_ACT_TAB);
939-
if (!nest)
937+
if (nest == NULL)
940938
goto out_module_put;
941939

942940
err = ops->walk(net, skb, &dcb, RTM_DELACTION, ops);
@@ -1009,10 +1007,10 @@ tca_action_gd(struct net *net, struct nlattr *nla, struct nlmsghdr *n,
10091007
return ret;
10101008

10111009
if (event == RTM_DELACTION && n->nlmsg_flags & NLM_F_ROOT) {
1012-
if (tb[1])
1010+
if (tb[1] != NULL)
10131011
return tca_action_flush(net, tb[1], n, portid);
1014-
1015-
return -EINVAL;
1012+
else
1013+
return -EINVAL;
10161014
}
10171015

10181016
for (i = 1; i <= TCA_ACT_MAX_PRIO && tb[i]; i++) {
@@ -1064,14 +1062,12 @@ tcf_add_notify(struct net *net, struct nlmsghdr *n, struct list_head *actions,
10641062
}
10651063

10661064
static int tcf_action_add(struct net *net, struct nlattr *nla,
1067-
struct nlmsghdr *n, u32 portid, int ovr,
1068-
struct netlink_ext_ack *extack)
1065+
struct nlmsghdr *n, u32 portid, int ovr)
10691066
{
10701067
int ret = 0;
10711068
LIST_HEAD(actions);
10721069

1073-
ret = tcf_action_init(net, NULL, nla, NULL, NULL, ovr, 0, &actions,
1074-
extack);
1070+
ret = tcf_action_init(net, NULL, nla, NULL, NULL, ovr, 0, &actions);
10751071
if (ret)
10761072
return ret;
10771073

@@ -1119,8 +1115,7 @@ static int tc_ctl_action(struct sk_buff *skb, struct nlmsghdr *n,
11191115
if (n->nlmsg_flags & NLM_F_REPLACE)
11201116
ovr = 1;
11211117
replay:
1122-
ret = tcf_action_add(net, tca[TCA_ACT_TAB], n, portid, ovr,
1123-
extack);
1118+
ret = tcf_action_add(net, tca[TCA_ACT_TAB], n, portid, ovr);
11241119
if (ret == -EAGAIN)
11251120
goto replay;
11261121
break;

net/sched/act_mirred.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla,
8080
bool exists = false;
8181
int ret;
8282

83-
if (!nla)
83+
if (nla == NULL)
8484
return -EINVAL;
8585
ret = nla_parse_nested(tb, TCA_MIRRED_MAX, nla, mirred_policy, NULL);
8686
if (ret < 0)
8787
return ret;
88-
if (!tb[TCA_MIRRED_PARMS])
88+
if (tb[TCA_MIRRED_PARMS] == NULL)
8989
return -EINVAL;
9090
parm = nla_data(tb[TCA_MIRRED_PARMS]);
9191

@@ -117,7 +117,7 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla,
117117
}
118118

119119
if (!exists) {
120-
if (!dev)
120+
if (dev == NULL)
121121
return -EINVAL;
122122
ret = tcf_idr_create(tn, parm->index, est, a,
123123
&act_mirred_ops, bind, true);

net/sched/cls_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,7 +1434,7 @@ int tcf_exts_validate(struct net *net, struct tcf_proto *tp, struct nlattr **tb,
14341434
if (exts->police && tb[exts->police]) {
14351435
act = tcf_action_init_1(net, tp, tb[exts->police],
14361436
rate_tlv, "police", ovr,
1437-
TCA_ACT_BIND, extack);
1437+
TCA_ACT_BIND);
14381438
if (IS_ERR(act))
14391439
return PTR_ERR(act);
14401440

@@ -1447,7 +1447,7 @@ int tcf_exts_validate(struct net *net, struct tcf_proto *tp, struct nlattr **tb,
14471447

14481448
err = tcf_action_init(net, tp, tb[exts->action],
14491449
rate_tlv, NULL, ovr, TCA_ACT_BIND,
1450-
&actions, extack);
1450+
&actions);
14511451
if (err)
14521452
return err;
14531453
list_for_each_entry(act, &actions, list)

0 commit comments

Comments
 (0)