Skip to content

Commit 589dad6

Browse files
Alexander Aringdavem330
authored andcommitted
net: sched: act: add extack to init callback
This patch adds extack support for act init callback api. This prepares to handle extack support inside each specific act implementation. Based on work by David Ahern <[email protected]> Cc: David Ahern <[email protected]> Signed-off-by: Alexander Aring <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 84ae017 commit 589dad6

File tree

18 files changed

+24
-20
lines changed

18 files changed

+24
-20
lines changed

include/net/act_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ struct tc_action_ops {
9090
int (*lookup)(struct net *net, struct tc_action **a, u32 index);
9191
int (*init)(struct net *net, struct nlattr *nla,
9292
struct nlattr *est, struct tc_action **act, int ovr,
93-
int bind);
93+
int bind, struct netlink_ext_ack *extack);
9494
int (*walk)(struct net *, struct sk_buff *,
9595
struct netlink_callback *, int,
9696
const struct tc_action_ops *);

net/sched/act_api.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,9 +680,10 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
680680

681681
/* backward compatibility for policer */
682682
if (name == NULL)
683-
err = a_o->init(net, tb[TCA_ACT_OPTIONS], est, &a, ovr, bind);
683+
err = a_o->init(net, tb[TCA_ACT_OPTIONS], est, &a, ovr, bind,
684+
extack);
684685
else
685-
err = a_o->init(net, nla, est, &a, ovr, bind);
686+
err = a_o->init(net, nla, est, &a, ovr, bind, extack);
686687
if (err < 0)
687688
goto err_mod;
688689

net/sched/act_bpf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ static void tcf_bpf_prog_fill_cfg(const struct tcf_bpf *prog,
272272

273273
static int tcf_bpf_init(struct net *net, struct nlattr *nla,
274274
struct nlattr *est, struct tc_action **act,
275-
int replace, int bind)
275+
int replace, int bind, struct netlink_ext_ack *extack)
276276
{
277277
struct tc_action_net *tn = net_generic(net, bpf_net_id);
278278
struct nlattr *tb[TCA_ACT_BPF_MAX + 1];

net/sched/act_connmark.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ static const struct nla_policy connmark_policy[TCA_CONNMARK_MAX + 1] = {
9696

9797
static int tcf_connmark_init(struct net *net, struct nlattr *nla,
9898
struct nlattr *est, struct tc_action **a,
99-
int ovr, int bind)
99+
int ovr, int bind,
100+
struct netlink_ext_ack *extack)
100101
{
101102
struct tc_action_net *tn = net_generic(net, connmark_net_id);
102103
struct nlattr *tb[TCA_CONNMARK_MAX + 1];

net/sched/act_csum.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static struct tc_action_ops act_csum_ops;
4646

4747
static int tcf_csum_init(struct net *net, struct nlattr *nla,
4848
struct nlattr *est, struct tc_action **a, int ovr,
49-
int bind)
49+
int bind, struct netlink_ext_ack *extack)
5050
{
5151
struct tc_action_net *tn = net_generic(net, csum_net_id);
5252
struct tcf_csum_params *params_old, *params_new;

net/sched/act_gact.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static const struct nla_policy gact_policy[TCA_GACT_MAX + 1] = {
5656

5757
static int tcf_gact_init(struct net *net, struct nlattr *nla,
5858
struct nlattr *est, struct tc_action **a,
59-
int ovr, int bind)
59+
int ovr, int bind, struct netlink_ext_ack *extack)
6060
{
6161
struct tc_action_net *tn = net_generic(net, gact_net_id);
6262
struct nlattr *tb[TCA_GACT_MAX + 1];

net/sched/act_ife.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ static int populate_metalist(struct tcf_ife_info *ife, struct nlattr **tb,
447447

448448
static int tcf_ife_init(struct net *net, struct nlattr *nla,
449449
struct nlattr *est, struct tc_action **a,
450-
int ovr, int bind)
450+
int ovr, int bind, struct netlink_ext_ack *extack)
451451
{
452452
struct tc_action_net *tn = net_generic(net, ife_net_id);
453453
struct nlattr *tb[TCA_IFE_MAX + 1];

net/sched/act_ipt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,15 +193,15 @@ static int __tcf_ipt_init(struct net *net, unsigned int id, struct nlattr *nla,
193193

194194
static int tcf_ipt_init(struct net *net, struct nlattr *nla,
195195
struct nlattr *est, struct tc_action **a, int ovr,
196-
int bind)
196+
int bind, struct netlink_ext_ack *extack)
197197
{
198198
return __tcf_ipt_init(net, ipt_net_id, nla, est, a, &act_ipt_ops, ovr,
199199
bind);
200200
}
201201

202202
static int tcf_xt_init(struct net *net, struct nlattr *nla,
203203
struct nlattr *est, struct tc_action **a, int ovr,
204-
int bind)
204+
int bind, struct netlink_ext_ack *extack)
205205
{
206206
return __tcf_ipt_init(net, xt_net_id, nla, est, a, &act_xt_ops, ovr,
207207
bind);

net/sched/act_mirred.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static struct tc_action_ops act_mirred_ops;
6969

7070
static int tcf_mirred_init(struct net *net, struct nlattr *nla,
7171
struct nlattr *est, struct tc_action **a, int ovr,
72-
int bind)
72+
int bind, struct netlink_ext_ack *extack)
7373
{
7474
struct tc_action_net *tn = net_generic(net, mirred_net_id);
7575
struct nlattr *tb[TCA_MIRRED_MAX + 1];

net/sched/act_nat.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ static const struct nla_policy nat_policy[TCA_NAT_MAX + 1] = {
3737
};
3838

3939
static int tcf_nat_init(struct net *net, struct nlattr *nla, struct nlattr *est,
40-
struct tc_action **a, int ovr, int bind)
40+
struct tc_action **a, int ovr, int bind,
41+
struct netlink_ext_ack *extack)
4142
{
4243
struct tc_action_net *tn = net_generic(net, nat_net_id);
4344
struct nlattr *tb[TCA_NAT_MAX + 1];

0 commit comments

Comments
 (0)