Commit 793d81d6 authored by Alexander Aring's avatar Alexander Aring Committed by David S. Miller

net: sched: sch: add extack to change class

This patch adds extack support for class change callback api. This prepares
to handle extack support inside each specific class implementation.

Cc: David Ahern <dsahern@gmail.com>
Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: default avatarAlexander Aring <aring@mojatatu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2030721c
...@@ -158,7 +158,8 @@ struct Qdisc_class_ops { ...@@ -158,7 +158,8 @@ struct Qdisc_class_ops {
/* Class manipulation routines */ /* Class manipulation routines */
unsigned long (*find)(struct Qdisc *, u32 classid); unsigned long (*find)(struct Qdisc *, u32 classid);
int (*change)(struct Qdisc *, u32, u32, int (*change)(struct Qdisc *, u32, u32,
struct nlattr **, unsigned long *); struct nlattr **, unsigned long *,
struct netlink_ext_ack *);
int (*delete)(struct Qdisc *, unsigned long); int (*delete)(struct Qdisc *, unsigned long);
void (*walk)(struct Qdisc *, struct qdisc_walker * arg); void (*walk)(struct Qdisc *, struct qdisc_walker * arg);
......
...@@ -1907,7 +1907,7 @@ static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n, ...@@ -1907,7 +1907,7 @@ static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n,
new_cl = cl; new_cl = cl;
err = -EOPNOTSUPP; err = -EOPNOTSUPP;
if (cops->change) if (cops->change)
err = cops->change(q, clid, portid, tca, &new_cl); err = cops->change(q, clid, portid, tca, &new_cl, extack);
if (err == 0) { if (err == 0) {
tclass_notify(net, skb, n, q, new_cl, RTM_NEWTCLASS); tclass_notify(net, skb, n, q, new_cl, RTM_NEWTCLASS);
/* We just create a new class, need to do reverse binding. */ /* We just create a new class, need to do reverse binding. */
......
...@@ -191,7 +191,8 @@ static const struct nla_policy atm_policy[TCA_ATM_MAX + 1] = { ...@@ -191,7 +191,8 @@ static const struct nla_policy atm_policy[TCA_ATM_MAX + 1] = {
}; };
static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent, static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent,
struct nlattr **tca, unsigned long *arg) struct nlattr **tca, unsigned long *arg,
struct netlink_ext_ack *extack)
{ {
struct atm_qdisc_data *p = qdisc_priv(sch); struct atm_qdisc_data *p = qdisc_priv(sch);
struct atm_flow_data *flow = (struct atm_flow_data *)*arg; struct atm_flow_data *flow = (struct atm_flow_data *)*arg;
......
...@@ -1452,7 +1452,7 @@ static void cbq_destroy(struct Qdisc *sch) ...@@ -1452,7 +1452,7 @@ static void cbq_destroy(struct Qdisc *sch)
static int static int
cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct nlattr **tca, cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct nlattr **tca,
unsigned long *arg) unsigned long *arg, struct netlink_ext_ack *extack)
{ {
int err; int err;
struct cbq_sched_data *q = qdisc_priv(sch); struct cbq_sched_data *q = qdisc_priv(sch);
......
...@@ -64,7 +64,8 @@ static const struct nla_policy drr_policy[TCA_DRR_MAX + 1] = { ...@@ -64,7 +64,8 @@ static const struct nla_policy drr_policy[TCA_DRR_MAX + 1] = {
}; };
static int drr_change_class(struct Qdisc *sch, u32 classid, u32 parentid, static int drr_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
struct nlattr **tca, unsigned long *arg) struct nlattr **tca, unsigned long *arg,
struct netlink_ext_ack *extack)
{ {
struct drr_sched *q = qdisc_priv(sch); struct drr_sched *q = qdisc_priv(sch);
struct drr_class *cl = (struct drr_class *)*arg; struct drr_class *cl = (struct drr_class *)*arg;
......
...@@ -112,7 +112,8 @@ static const struct nla_policy dsmark_policy[TCA_DSMARK_MAX + 1] = { ...@@ -112,7 +112,8 @@ static const struct nla_policy dsmark_policy[TCA_DSMARK_MAX + 1] = {
}; };
static int dsmark_change(struct Qdisc *sch, u32 classid, u32 parent, static int dsmark_change(struct Qdisc *sch, u32 classid, u32 parent,
struct nlattr **tca, unsigned long *arg) struct nlattr **tca, unsigned long *arg,
struct netlink_ext_ack *extack)
{ {
struct dsmark_qdisc_data *p = qdisc_priv(sch); struct dsmark_qdisc_data *p = qdisc_priv(sch);
struct nlattr *opt = tca[TCA_OPTIONS]; struct nlattr *opt = tca[TCA_OPTIONS];
......
...@@ -479,7 +479,7 @@ static int fq_codel_init(struct Qdisc *sch, struct nlattr *opt, ...@@ -479,7 +479,7 @@ static int fq_codel_init(struct Qdisc *sch, struct nlattr *opt,
q->cparams.mtu = psched_mtu(qdisc_dev(sch)); q->cparams.mtu = psched_mtu(qdisc_dev(sch));
if (opt) { if (opt) {
int err = fq_codel_change(sch, opt, NULL); int err = fq_codel_change(sch, opt, extack);
if (err) if (err)
return err; return err;
} }
......
...@@ -921,7 +921,8 @@ static const struct nla_policy hfsc_policy[TCA_HFSC_MAX + 1] = { ...@@ -921,7 +921,8 @@ static const struct nla_policy hfsc_policy[TCA_HFSC_MAX + 1] = {
static int static int
hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid, hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
struct nlattr **tca, unsigned long *arg) struct nlattr **tca, unsigned long *arg,
struct netlink_ext_ack *extack)
{ {
struct hfsc_sched *q = qdisc_priv(sch); struct hfsc_sched *q = qdisc_priv(sch);
struct hfsc_class *cl = (struct hfsc_class *)*arg; struct hfsc_class *cl = (struct hfsc_class *)*arg;
......
...@@ -1327,7 +1327,7 @@ static int htb_delete(struct Qdisc *sch, unsigned long arg) ...@@ -1327,7 +1327,7 @@ static int htb_delete(struct Qdisc *sch, unsigned long arg)
static int htb_change_class(struct Qdisc *sch, u32 classid, static int htb_change_class(struct Qdisc *sch, u32 classid,
u32 parentid, struct nlattr **tca, u32 parentid, struct nlattr **tca,
unsigned long *arg) unsigned long *arg, struct netlink_ext_ack *extack)
{ {
int err = -EINVAL; int err = -EINVAL;
struct htb_sched *q = qdisc_priv(sch); struct htb_sched *q = qdisc_priv(sch);
......
...@@ -402,7 +402,8 @@ static int qfq_change_agg(struct Qdisc *sch, struct qfq_class *cl, u32 weight, ...@@ -402,7 +402,8 @@ static int qfq_change_agg(struct Qdisc *sch, struct qfq_class *cl, u32 weight,
} }
static int qfq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, static int qfq_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
struct nlattr **tca, unsigned long *arg) struct nlattr **tca, unsigned long *arg,
struct netlink_ext_ack *extack)
{ {
struct qfq_sched *q = qdisc_priv(sch); struct qfq_sched *q = qdisc_priv(sch);
struct qfq_class *cl = (struct qfq_class *)*arg; struct qfq_class *cl = (struct qfq_class *)*arg;
......
...@@ -645,7 +645,8 @@ static void sfb_unbind(struct Qdisc *sch, unsigned long arg) ...@@ -645,7 +645,8 @@ static void sfb_unbind(struct Qdisc *sch, unsigned long arg)
} }
static int sfb_change_class(struct Qdisc *sch, u32 classid, u32 parentid, static int sfb_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
struct nlattr **tca, unsigned long *arg) struct nlattr **tca, unsigned long *arg,
struct netlink_ext_ack *extack)
{ {
return -ENOSYS; return -ENOSYS;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment