Revert "net: sched: act: add extack for lookup callback"
This reverts commit 331a9295de
("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 <aring@mojatatu.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
fd3c040b24
commit
f061b48c17
|
@ -85,8 +85,7 @@ struct tc_action_ops {
|
||||||
struct tcf_result *); /* called under RCU BH lock*/
|
struct tcf_result *); /* called under RCU BH lock*/
|
||||||
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 *net, struct tc_action **a, u32 index);
|
||||||
struct netlink_ext_ack *extack);
|
|
||||||
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, bool rtnl_held,
|
int bind, bool rtnl_held,
|
||||||
|
|
|
@ -1067,12 +1067,14 @@ static struct tc_action *tcf_action_get_1(struct net *net, struct nlattr *nla,
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
ops = tc_lookup_action(tb[TCA_ACT_KIND]);
|
ops = tc_lookup_action(tb[TCA_ACT_KIND]);
|
||||||
if (!ops) { /* could happen in batch of actions */
|
if (!ops) { /* could happen in batch of actions */
|
||||||
NL_SET_ERR_MSG(extack, "Specified TC action not found");
|
NL_SET_ERR_MSG(extack, "Specified TC action kind not found");
|
||||||
goto err_out;
|
goto err_out;
|
||||||
}
|
}
|
||||||
err = -ENOENT;
|
err = -ENOENT;
|
||||||
if (ops->lookup(net, &a, index, extack) == 0)
|
if (ops->lookup(net, &a, index) == 0) {
|
||||||
|
NL_SET_ERR_MSG(extack, "TC action with specified index not found");
|
||||||
goto err_mod;
|
goto err_mod;
|
||||||
|
}
|
||||||
|
|
||||||
module_put(ops->owner);
|
module_put(ops->owner);
|
||||||
return a;
|
return a;
|
||||||
|
|
|
@ -387,8 +387,7 @@ static int tcf_bpf_walker(struct net *net, struct sk_buff *skb,
|
||||||
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tcf_bpf_search(struct net *net, struct tc_action **a, u32 index,
|
static int tcf_bpf_search(struct net *net, struct tc_action **a, u32 index)
|
||||||
struct netlink_ext_ack *extack)
|
|
||||||
{
|
{
|
||||||
struct tc_action_net *tn = net_generic(net, bpf_net_id);
|
struct tc_action_net *tn = net_generic(net, bpf_net_id);
|
||||||
|
|
||||||
|
|
|
@ -190,8 +190,7 @@ static int tcf_connmark_walker(struct net *net, struct sk_buff *skb,
|
||||||
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tcf_connmark_search(struct net *net, struct tc_action **a, u32 index,
|
static int tcf_connmark_search(struct net *net, struct tc_action **a, u32 index)
|
||||||
struct netlink_ext_ack *extack)
|
|
||||||
{
|
{
|
||||||
struct tc_action_net *tn = net_generic(net, connmark_net_id);
|
struct tc_action_net *tn = net_generic(net, connmark_net_id);
|
||||||
|
|
||||||
|
|
|
@ -646,8 +646,7 @@ static int tcf_csum_walker(struct net *net, struct sk_buff *skb,
|
||||||
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tcf_csum_search(struct net *net, struct tc_action **a, u32 index,
|
static int tcf_csum_search(struct net *net, struct tc_action **a, u32 index)
|
||||||
struct netlink_ext_ack *extack)
|
|
||||||
{
|
{
|
||||||
struct tc_action_net *tn = net_generic(net, csum_net_id);
|
struct tc_action_net *tn = net_generic(net, csum_net_id);
|
||||||
|
|
||||||
|
|
|
@ -222,8 +222,7 @@ static int tcf_gact_walker(struct net *net, struct sk_buff *skb,
|
||||||
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tcf_gact_search(struct net *net, struct tc_action **a, u32 index,
|
static int tcf_gact_search(struct net *net, struct tc_action **a, u32 index)
|
||||||
struct netlink_ext_ack *extack)
|
|
||||||
{
|
{
|
||||||
struct tc_action_net *tn = net_generic(net, gact_net_id);
|
struct tc_action_net *tn = net_generic(net, gact_net_id);
|
||||||
|
|
||||||
|
|
|
@ -841,8 +841,7 @@ static int tcf_ife_walker(struct net *net, struct sk_buff *skb,
|
||||||
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tcf_ife_search(struct net *net, struct tc_action **a, u32 index,
|
static int tcf_ife_search(struct net *net, struct tc_action **a, u32 index)
|
||||||
struct netlink_ext_ack *extack)
|
|
||||||
{
|
{
|
||||||
struct tc_action_net *tn = net_generic(net, ife_net_id);
|
struct tc_action_net *tn = net_generic(net, ife_net_id);
|
||||||
|
|
||||||
|
|
|
@ -329,8 +329,7 @@ static int tcf_ipt_walker(struct net *net, struct sk_buff *skb,
|
||||||
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tcf_ipt_search(struct net *net, struct tc_action **a, u32 index,
|
static int tcf_ipt_search(struct net *net, struct tc_action **a, u32 index)
|
||||||
struct netlink_ext_ack *extack)
|
|
||||||
{
|
{
|
||||||
struct tc_action_net *tn = net_generic(net, ipt_net_id);
|
struct tc_action_net *tn = net_generic(net, ipt_net_id);
|
||||||
|
|
||||||
|
@ -379,8 +378,7 @@ static int tcf_xt_walker(struct net *net, struct sk_buff *skb,
|
||||||
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tcf_xt_search(struct net *net, struct tc_action **a, u32 index,
|
static int tcf_xt_search(struct net *net, struct tc_action **a, u32 index)
|
||||||
struct netlink_ext_ack *extack)
|
|
||||||
{
|
{
|
||||||
struct tc_action_net *tn = net_generic(net, xt_net_id);
|
struct tc_action_net *tn = net_generic(net, xt_net_id);
|
||||||
|
|
||||||
|
|
|
@ -338,8 +338,7 @@ static int tcf_mirred_walker(struct net *net, struct sk_buff *skb,
|
||||||
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tcf_mirred_search(struct net *net, struct tc_action **a, u32 index,
|
static int tcf_mirred_search(struct net *net, struct tc_action **a, u32 index)
|
||||||
struct netlink_ext_ack *extack)
|
|
||||||
{
|
{
|
||||||
struct tc_action_net *tn = net_generic(net, mirred_net_id);
|
struct tc_action_net *tn = net_generic(net, mirred_net_id);
|
||||||
|
|
||||||
|
|
|
@ -292,8 +292,7 @@ static int tcf_nat_walker(struct net *net, struct sk_buff *skb,
|
||||||
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tcf_nat_search(struct net *net, struct tc_action **a, u32 index,
|
static int tcf_nat_search(struct net *net, struct tc_action **a, u32 index)
|
||||||
struct netlink_ext_ack *extack)
|
|
||||||
{
|
{
|
||||||
struct tc_action_net *tn = net_generic(net, nat_net_id);
|
struct tc_action_net *tn = net_generic(net, nat_net_id);
|
||||||
|
|
||||||
|
|
|
@ -452,8 +452,7 @@ static int tcf_pedit_walker(struct net *net, struct sk_buff *skb,
|
||||||
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tcf_pedit_search(struct net *net, struct tc_action **a, u32 index,
|
static int tcf_pedit_search(struct net *net, struct tc_action **a, u32 index)
|
||||||
struct netlink_ext_ack *extack)
|
|
||||||
{
|
{
|
||||||
struct tc_action_net *tn = net_generic(net, pedit_net_id);
|
struct tc_action_net *tn = net_generic(net, pedit_net_id);
|
||||||
|
|
||||||
|
|
|
@ -312,8 +312,7 @@ nla_put_failure:
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tcf_police_search(struct net *net, struct tc_action **a, u32 index,
|
static int tcf_police_search(struct net *net, struct tc_action **a, u32 index)
|
||||||
struct netlink_ext_ack *extack)
|
|
||||||
{
|
{
|
||||||
struct tc_action_net *tn = net_generic(net, police_net_id);
|
struct tc_action_net *tn = net_generic(net, police_net_id);
|
||||||
|
|
||||||
|
|
|
@ -224,8 +224,7 @@ static int tcf_sample_walker(struct net *net, struct sk_buff *skb,
|
||||||
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tcf_sample_search(struct net *net, struct tc_action **a, u32 index,
|
static int tcf_sample_search(struct net *net, struct tc_action **a, u32 index)
|
||||||
struct netlink_ext_ack *extack)
|
|
||||||
{
|
{
|
||||||
struct tc_action_net *tn = net_generic(net, sample_net_id);
|
struct tc_action_net *tn = net_generic(net, sample_net_id);
|
||||||
|
|
||||||
|
|
|
@ -188,8 +188,7 @@ static int tcf_simp_walker(struct net *net, struct sk_buff *skb,
|
||||||
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tcf_simp_search(struct net *net, struct tc_action **a, u32 index,
|
static int tcf_simp_search(struct net *net, struct tc_action **a, u32 index)
|
||||||
struct netlink_ext_ack *extack)
|
|
||||||
{
|
{
|
||||||
struct tc_action_net *tn = net_generic(net, simp_net_id);
|
struct tc_action_net *tn = net_generic(net, simp_net_id);
|
||||||
|
|
||||||
|
|
|
@ -291,8 +291,7 @@ static int tcf_skbedit_walker(struct net *net, struct sk_buff *skb,
|
||||||
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tcf_skbedit_search(struct net *net, struct tc_action **a, u32 index,
|
static int tcf_skbedit_search(struct net *net, struct tc_action **a, u32 index)
|
||||||
struct netlink_ext_ack *extack)
|
|
||||||
{
|
{
|
||||||
struct tc_action_net *tn = net_generic(net, skbedit_net_id);
|
struct tc_action_net *tn = net_generic(net, skbedit_net_id);
|
||||||
|
|
||||||
|
|
|
@ -251,8 +251,7 @@ static int tcf_skbmod_walker(struct net *net, struct sk_buff *skb,
|
||||||
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tcf_skbmod_search(struct net *net, struct tc_action **a, u32 index,
|
static int tcf_skbmod_search(struct net *net, struct tc_action **a, u32 index)
|
||||||
struct netlink_ext_ack *extack)
|
|
||||||
{
|
{
|
||||||
struct tc_action_net *tn = net_generic(net, skbmod_net_id);
|
struct tc_action_net *tn = net_generic(net, skbmod_net_id);
|
||||||
|
|
||||||
|
|
|
@ -540,8 +540,7 @@ static int tunnel_key_walker(struct net *net, struct sk_buff *skb,
|
||||||
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tunnel_key_search(struct net *net, struct tc_action **a, u32 index,
|
static int tunnel_key_search(struct net *net, struct tc_action **a, u32 index)
|
||||||
struct netlink_ext_ack *extack)
|
|
||||||
{
|
{
|
||||||
struct tc_action_net *tn = net_generic(net, tunnel_key_net_id);
|
struct tc_action_net *tn = net_generic(net, tunnel_key_net_id);
|
||||||
|
|
||||||
|
|
|
@ -288,8 +288,7 @@ static int tcf_vlan_walker(struct net *net, struct sk_buff *skb,
|
||||||
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
return tcf_generic_walker(tn, skb, cb, type, ops, extack);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tcf_vlan_search(struct net *net, struct tc_action **a, u32 index,
|
static int tcf_vlan_search(struct net *net, struct tc_action **a, u32 index)
|
||||||
struct netlink_ext_ack *extack)
|
|
||||||
{
|
{
|
||||||
struct tc_action_net *tn = net_generic(net, vlan_net_id);
|
struct tc_action_net *tn = net_generic(net, vlan_net_id);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue