Skip to content

Commit f061b48

Browse files
congwangdavem330
authored andcommitted
Revert "net: sched: act: add extack for lookup callback"
This reverts commit 331a929 ("net: sched: act: add extack for lookup callback"). This extack is never used after 6 months... In fact, it can be just set in the caller, right after ->lookup(). Cc: Alexander Aring <[email protected]> Signed-off-by: Cong Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent fd3c040 commit f061b48

File tree

18 files changed

+22
-38
lines changed

18 files changed

+22
-38
lines changed

include/net/act_api.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ struct tc_action_ops {
8585
struct tcf_result *); /* called under RCU BH lock*/
8686
int (*dump)(struct sk_buff *, struct tc_action *, int, int);
8787
void (*cleanup)(struct tc_action *);
88-
int (*lookup)(struct net *net, struct tc_action **a, u32 index,
89-
struct netlink_ext_ack *extack);
88+
int (*lookup)(struct net *net, struct tc_action **a, u32 index);
9089
int (*init)(struct net *net, struct nlattr *nla,
9190
struct nlattr *est, struct tc_action **act, int ovr,
9291
int bind, bool rtnl_held,

net/sched/act_api.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,12 +1067,14 @@ static struct tc_action *tcf_action_get_1(struct net *net, struct nlattr *nla,
10671067
err = -EINVAL;
10681068
ops = tc_lookup_action(tb[TCA_ACT_KIND]);
10691069
if (!ops) { /* could happen in batch of actions */
1070-
NL_SET_ERR_MSG(extack, "Specified TC action not found");
1070+
NL_SET_ERR_MSG(extack, "Specified TC action kind not found");
10711071
goto err_out;
10721072
}
10731073
err = -ENOENT;
1074-
if (ops->lookup(net, &a, index, extack) == 0)
1074+
if (ops->lookup(net, &a, index) == 0) {
1075+
NL_SET_ERR_MSG(extack, "TC action with specified index not found");
10751076
goto err_mod;
1077+
}
10761078

10771079
module_put(ops->owner);
10781080
return a;

net/sched/act_bpf.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,7 @@ static int tcf_bpf_walker(struct net *net, struct sk_buff *skb,
387387
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
388388
}
389389

390-
static int tcf_bpf_search(struct net *net, struct tc_action **a, u32 index,
391-
struct netlink_ext_ack *extack)
390+
static int tcf_bpf_search(struct net *net, struct tc_action **a, u32 index)
392391
{
393392
struct tc_action_net *tn = net_generic(net, bpf_net_id);
394393

net/sched/act_connmark.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,7 @@ static int tcf_connmark_walker(struct net *net, struct sk_buff *skb,
190190
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
191191
}
192192

193-
static int tcf_connmark_search(struct net *net, struct tc_action **a, u32 index,
194-
struct netlink_ext_ack *extack)
193+
static int tcf_connmark_search(struct net *net, struct tc_action **a, u32 index)
195194
{
196195
struct tc_action_net *tn = net_generic(net, connmark_net_id);
197196

net/sched/act_csum.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,8 +646,7 @@ static int tcf_csum_walker(struct net *net, struct sk_buff *skb,
646646
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
647647
}
648648

649-
static int tcf_csum_search(struct net *net, struct tc_action **a, u32 index,
650-
struct netlink_ext_ack *extack)
649+
static int tcf_csum_search(struct net *net, struct tc_action **a, u32 index)
651650
{
652651
struct tc_action_net *tn = net_generic(net, csum_net_id);
653652

net/sched/act_gact.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,7 @@ static int tcf_gact_walker(struct net *net, struct sk_buff *skb,
222222
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
223223
}
224224

225-
static int tcf_gact_search(struct net *net, struct tc_action **a, u32 index,
226-
struct netlink_ext_ack *extack)
225+
static int tcf_gact_search(struct net *net, struct tc_action **a, u32 index)
227226
{
228227
struct tc_action_net *tn = net_generic(net, gact_net_id);
229228

net/sched/act_ife.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -841,8 +841,7 @@ static int tcf_ife_walker(struct net *net, struct sk_buff *skb,
841841
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
842842
}
843843

844-
static int tcf_ife_search(struct net *net, struct tc_action **a, u32 index,
845-
struct netlink_ext_ack *extack)
844+
static int tcf_ife_search(struct net *net, struct tc_action **a, u32 index)
846845
{
847846
struct tc_action_net *tn = net_generic(net, ife_net_id);
848847

net/sched/act_ipt.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,7 @@ static int tcf_ipt_walker(struct net *net, struct sk_buff *skb,
329329
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
330330
}
331331

332-
static int tcf_ipt_search(struct net *net, struct tc_action **a, u32 index,
333-
struct netlink_ext_ack *extack)
332+
static int tcf_ipt_search(struct net *net, struct tc_action **a, u32 index)
334333
{
335334
struct tc_action_net *tn = net_generic(net, ipt_net_id);
336335

@@ -379,8 +378,7 @@ static int tcf_xt_walker(struct net *net, struct sk_buff *skb,
379378
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
380379
}
381380

382-
static int tcf_xt_search(struct net *net, struct tc_action **a, u32 index,
383-
struct netlink_ext_ack *extack)
381+
static int tcf_xt_search(struct net *net, struct tc_action **a, u32 index)
384382
{
385383
struct tc_action_net *tn = net_generic(net, xt_net_id);
386384

net/sched/act_mirred.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,7 @@ static int tcf_mirred_walker(struct net *net, struct sk_buff *skb,
338338
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
339339
}
340340

341-
static int tcf_mirred_search(struct net *net, struct tc_action **a, u32 index,
342-
struct netlink_ext_ack *extack)
341+
static int tcf_mirred_search(struct net *net, struct tc_action **a, u32 index)
343342
{
344343
struct tc_action_net *tn = net_generic(net, mirred_net_id);
345344

net/sched/act_nat.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,7 @@ static int tcf_nat_walker(struct net *net, struct sk_buff *skb,
292292
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
293293
}
294294

295-
static int tcf_nat_search(struct net *net, struct tc_action **a, u32 index,
296-
struct netlink_ext_ack *extack)
295+
static int tcf_nat_search(struct net *net, struct tc_action **a, u32 index)
297296
{
298297
struct tc_action_net *tn = net_generic(net, nat_net_id);
299298

0 commit comments

Comments
 (0)