Skip to content

Commit

Permalink
net: sched: act: add extack for walk callback
Browse files Browse the repository at this point in the history
This patch adds extack support for act walker callback api. This
prepares to handle extack support inside each specific act
implementation.

Cc: David Ahern <dsahern@gmail.com>
Signed-off-by: Alexander Aring <aring@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Alexander Aring authored and David S. Miller committed Feb 16, 2018
1 parent 331a929 commit 4178010
Show file tree
Hide file tree
Showing 18 changed files with 38 additions and 20 deletions.
3 changes: 2 additions & 1 deletion include/net/act_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ struct tc_action_ops {
int bind, struct netlink_ext_ack *extack);
int (*walk)(struct net *, struct sk_buff *,
struct netlink_callback *, int,
const struct tc_action_ops *);
const struct tc_action_ops *,
struct netlink_ext_ack *);
void (*stats_update)(struct tc_action *, u64, u32, u64);
struct net_device *(*get_dev)(const struct tc_action *a);
};
Expand Down
4 changes: 2 additions & 2 deletions net/sched/act_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ static int tca_action_flush(struct net *net, struct nlattr *nla,
goto out_module_put;
}

err = ops->walk(net, skb, &dcb, RTM_DELACTION, ops);
err = ops->walk(net, skb, &dcb, RTM_DELACTION, ops, extack);
if (err <= 0) {
nla_nest_cancel(skb, nest);
goto out_module_put;
Expand Down Expand Up @@ -1255,7 +1255,7 @@ static int tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb)
if (nest == NULL)
goto out_module_put;

ret = a_o->walk(net, skb, cb, RTM_GETACTION, a_o);
ret = a_o->walk(net, skb, cb, RTM_GETACTION, a_o, NULL);
if (ret < 0)
goto out_module_put;

Expand Down
3 changes: 2 additions & 1 deletion net/sched/act_bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,8 @@ static void tcf_bpf_cleanup(struct tc_action *act)

static int tcf_bpf_walker(struct net *net, struct sk_buff *skb,
struct netlink_callback *cb, int type,
const struct tc_action_ops *ops)
const struct tc_action_ops *ops,
struct netlink_ext_ack *extack)
{
struct tc_action_net *tn = net_generic(net, bpf_net_id);

Expand Down
3 changes: 2 additions & 1 deletion net/sched/act_connmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ static inline int tcf_connmark_dump(struct sk_buff *skb, struct tc_action *a,

static int tcf_connmark_walker(struct net *net, struct sk_buff *skb,
struct netlink_callback *cb, int type,
const struct tc_action_ops *ops)
const struct tc_action_ops *ops,
struct netlink_ext_ack *extack)
{
struct tc_action_net *tn = net_generic(net, connmark_net_id);

Expand Down
3 changes: 2 additions & 1 deletion net/sched/act_csum.c
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,8 @@ static void tcf_csum_cleanup(struct tc_action *a)

static int tcf_csum_walker(struct net *net, struct sk_buff *skb,
struct netlink_callback *cb, int type,
const struct tc_action_ops *ops)
const struct tc_action_ops *ops,
struct netlink_ext_ack *extack)
{
struct tc_action_net *tn = net_generic(net, csum_net_id);

Expand Down
3 changes: 2 additions & 1 deletion net/sched/act_gact.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ static int tcf_gact_dump(struct sk_buff *skb, struct tc_action *a,

static int tcf_gact_walker(struct net *net, struct sk_buff *skb,
struct netlink_callback *cb, int type,
const struct tc_action_ops *ops)
const struct tc_action_ops *ops,
struct netlink_ext_ack *extack)
{
struct tc_action_net *tn = net_generic(net, gact_net_id);

Expand Down
3 changes: 2 additions & 1 deletion net/sched/act_ife.c
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,8 @@ static int tcf_ife_act(struct sk_buff *skb, const struct tc_action *a,

static int tcf_ife_walker(struct net *net, struct sk_buff *skb,
struct netlink_callback *cb, int type,
const struct tc_action_ops *ops)
const struct tc_action_ops *ops,
struct netlink_ext_ack *extack)
{
struct tc_action_net *tn = net_generic(net, ife_net_id);

Expand Down
6 changes: 4 additions & 2 deletions net/sched/act_ipt.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,8 @@ static int tcf_ipt_dump(struct sk_buff *skb, struct tc_action *a, int bind,

static int tcf_ipt_walker(struct net *net, struct sk_buff *skb,
struct netlink_callback *cb, int type,
const struct tc_action_ops *ops)
const struct tc_action_ops *ops,
struct netlink_ext_ack *extack)
{
struct tc_action_net *tn = net_generic(net, ipt_net_id);

Expand Down Expand Up @@ -352,7 +353,8 @@ static struct pernet_operations ipt_net_ops = {

static int tcf_xt_walker(struct net *net, struct sk_buff *skb,
struct netlink_callback *cb, int type,
const struct tc_action_ops *ops)
const struct tc_action_ops *ops,
struct netlink_ext_ack *extack)
{
struct tc_action_net *tn = net_generic(net, xt_net_id);

Expand Down
3 changes: 2 additions & 1 deletion net/sched/act_mirred.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ static int tcf_mirred_dump(struct sk_buff *skb, struct tc_action *a, int bind,

static int tcf_mirred_walker(struct net *net, struct sk_buff *skb,
struct netlink_callback *cb, int type,
const struct tc_action_ops *ops)
const struct tc_action_ops *ops,
struct netlink_ext_ack *extack)
{
struct tc_action_net *tn = net_generic(net, mirred_net_id);

Expand Down
3 changes: 2 additions & 1 deletion net/sched/act_nat.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ static int tcf_nat_dump(struct sk_buff *skb, struct tc_action *a,

static int tcf_nat_walker(struct net *net, struct sk_buff *skb,
struct netlink_callback *cb, int type,
const struct tc_action_ops *ops)
const struct tc_action_ops *ops,
struct netlink_ext_ack *extack)
{
struct tc_action_net *tn = net_generic(net, nat_net_id);

Expand Down
3 changes: 2 additions & 1 deletion net/sched/act_pedit.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,8 @@ static int tcf_pedit_dump(struct sk_buff *skb, struct tc_action *a,

static int tcf_pedit_walker(struct net *net, struct sk_buff *skb,
struct netlink_callback *cb, int type,
const struct tc_action_ops *ops)
const struct tc_action_ops *ops,
struct netlink_ext_ack *extack)
{
struct tc_action_net *tn = net_generic(net, pedit_net_id);

Expand Down
3 changes: 2 additions & 1 deletion net/sched/act_police.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ static struct tc_action_ops act_police_ops;

static int tcf_act_police_walker(struct net *net, struct sk_buff *skb,
struct netlink_callback *cb, int type,
const struct tc_action_ops *ops)
const struct tc_action_ops *ops,
struct netlink_ext_ack *extack)
{
struct tc_action_net *tn = net_generic(net, police_net_id);

Expand Down
3 changes: 2 additions & 1 deletion net/sched/act_sample.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ static int tcf_sample_dump(struct sk_buff *skb, struct tc_action *a,

static int tcf_sample_walker(struct net *net, struct sk_buff *skb,
struct netlink_callback *cb, int type,
const struct tc_action_ops *ops)
const struct tc_action_ops *ops,
struct netlink_ext_ack *extack)
{
struct tc_action_net *tn = net_generic(net, sample_net_id);

Expand Down
3 changes: 2 additions & 1 deletion net/sched/act_simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ static int tcf_simp_dump(struct sk_buff *skb, struct tc_action *a,

static int tcf_simp_walker(struct net *net, struct sk_buff *skb,
struct netlink_callback *cb, int type,
const struct tc_action_ops *ops)
const struct tc_action_ops *ops,
struct netlink_ext_ack *extack)
{
struct tc_action_net *tn = net_generic(net, simp_net_id);

Expand Down
3 changes: 2 additions & 1 deletion net/sched/act_skbedit.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ static int tcf_skbedit_dump(struct sk_buff *skb, struct tc_action *a,

static int tcf_skbedit_walker(struct net *net, struct sk_buff *skb,
struct netlink_callback *cb, int type,
const struct tc_action_ops *ops)
const struct tc_action_ops *ops,
struct netlink_ext_ack *extack)
{
struct tc_action_net *tn = net_generic(net, skbedit_net_id);

Expand Down
3 changes: 2 additions & 1 deletion net/sched/act_skbmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ static int tcf_skbmod_dump(struct sk_buff *skb, struct tc_action *a,

static int tcf_skbmod_walker(struct net *net, struct sk_buff *skb,
struct netlink_callback *cb, int type,
const struct tc_action_ops *ops)
const struct tc_action_ops *ops,
struct netlink_ext_ack *extack)
{
struct tc_action_net *tn = net_generic(net, skbmod_net_id);

Expand Down
3 changes: 2 additions & 1 deletion net/sched/act_tunnel_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,8 @@ static int tunnel_key_dump(struct sk_buff *skb, struct tc_action *a,

static int tunnel_key_walker(struct net *net, struct sk_buff *skb,
struct netlink_callback *cb, int type,
const struct tc_action_ops *ops)
const struct tc_action_ops *ops,
struct netlink_ext_ack *extack)
{
struct tc_action_net *tn = net_generic(net, tunnel_key_net_id);

Expand Down
3 changes: 2 additions & 1 deletion net/sched/act_vlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@ static int tcf_vlan_dump(struct sk_buff *skb, struct tc_action *a,

static int tcf_vlan_walker(struct net *net, struct sk_buff *skb,
struct netlink_callback *cb, int type,
const struct tc_action_ops *ops)
const struct tc_action_ops *ops,
struct netlink_ext_ack *extack)
{
struct tc_action_net *tn = net_generic(net, vlan_net_id);

Expand Down

0 comments on commit 4178010

Please sign in to comment.