Commit 653d6fd6 authored by Alexander Aring's avatar Alexander Aring Committed by David S. Miller

net: sched: sch: add extack for graft callback

This patch adds extack support for graft callback to prepare per-qdisc
specific changes for extack.

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 cbaacc4e
...@@ -151,7 +151,8 @@ struct Qdisc_class_ops { ...@@ -151,7 +151,8 @@ struct Qdisc_class_ops {
/* Child qdisc manipulation */ /* Child qdisc manipulation */
struct netdev_queue * (*select_queue)(struct Qdisc *, struct tcmsg *); struct netdev_queue * (*select_queue)(struct Qdisc *, struct tcmsg *);
int (*graft)(struct Qdisc *, unsigned long cl, int (*graft)(struct Qdisc *, unsigned long cl,
struct Qdisc *, struct Qdisc **); struct Qdisc *, struct Qdisc **,
struct netlink_ext_ack *extack);
struct Qdisc * (*leaf)(struct Qdisc *, unsigned long cl); struct Qdisc * (*leaf)(struct Qdisc *, unsigned long cl);
void (*qlen_notify)(struct Qdisc *, unsigned long); void (*qlen_notify)(struct Qdisc *, unsigned long);
......
...@@ -977,7 +977,8 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent, ...@@ -977,7 +977,8 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent,
unsigned long cl = cops->find(parent, classid); unsigned long cl = cops->find(parent, classid);
if (cl) { if (cl) {
err = cops->graft(parent, cl, new, &old); err = cops->graft(parent, cl, new, &old,
extack);
} else { } else {
NL_SET_ERR_MSG(extack, "Specified class not found"); NL_SET_ERR_MSG(extack, "Specified class not found");
err = -ENOENT; err = -ENOENT;
......
...@@ -82,7 +82,8 @@ static inline struct atm_flow_data *lookup_flow(struct Qdisc *sch, u32 classid) ...@@ -82,7 +82,8 @@ static inline struct atm_flow_data *lookup_flow(struct Qdisc *sch, u32 classid)
} }
static int atm_tc_graft(struct Qdisc *sch, unsigned long arg, static int atm_tc_graft(struct Qdisc *sch, unsigned long arg,
struct Qdisc *new, struct Qdisc **old) struct Qdisc *new, struct Qdisc **old,
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;
......
...@@ -1371,7 +1371,7 @@ cbq_dump_class_stats(struct Qdisc *sch, unsigned long arg, ...@@ -1371,7 +1371,7 @@ cbq_dump_class_stats(struct Qdisc *sch, unsigned long arg,
} }
static int cbq_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new, static int cbq_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
struct Qdisc **old) struct Qdisc **old, struct netlink_ext_ack *extack)
{ {
struct cbq_class *cl = (struct cbq_class *)arg; struct cbq_class *cl = (struct cbq_class *)arg;
......
...@@ -203,7 +203,8 @@ static void drr_unbind_tcf(struct Qdisc *sch, unsigned long arg) ...@@ -203,7 +203,8 @@ static void drr_unbind_tcf(struct Qdisc *sch, unsigned long arg)
} }
static int drr_graft_class(struct Qdisc *sch, unsigned long arg, static int drr_graft_class(struct Qdisc *sch, unsigned long arg,
struct Qdisc *new, struct Qdisc **old) struct Qdisc *new, struct Qdisc **old,
struct netlink_ext_ack *extack)
{ {
struct drr_class *cl = (struct drr_class *)arg; struct drr_class *cl = (struct drr_class *)arg;
......
...@@ -61,7 +61,8 @@ static inline int dsmark_valid_index(struct dsmark_qdisc_data *p, u16 index) ...@@ -61,7 +61,8 @@ static inline int dsmark_valid_index(struct dsmark_qdisc_data *p, u16 index)
/* ------------------------- Class/flow operations ------------------------- */ /* ------------------------- Class/flow operations ------------------------- */
static int dsmark_graft(struct Qdisc *sch, unsigned long arg, static int dsmark_graft(struct Qdisc *sch, unsigned long arg,
struct Qdisc *new, struct Qdisc **old) struct Qdisc *new, struct Qdisc **old,
struct netlink_ext_ack *extack)
{ {
struct dsmark_qdisc_data *p = qdisc_priv(sch); struct dsmark_qdisc_data *p = qdisc_priv(sch);
......
...@@ -1177,7 +1177,7 @@ hfsc_classify(struct sk_buff *skb, struct Qdisc *sch, int *qerr) ...@@ -1177,7 +1177,7 @@ hfsc_classify(struct sk_buff *skb, struct Qdisc *sch, int *qerr)
static int static int
hfsc_graft_class(struct Qdisc *sch, unsigned long arg, struct Qdisc *new, hfsc_graft_class(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
struct Qdisc **old) struct Qdisc **old, struct netlink_ext_ack *extack)
{ {
struct hfsc_class *cl = (struct hfsc_class *)arg; struct hfsc_class *cl = (struct hfsc_class *)arg;
......
...@@ -1172,7 +1172,7 @@ htb_dump_class_stats(struct Qdisc *sch, unsigned long arg, struct gnet_dump *d) ...@@ -1172,7 +1172,7 @@ htb_dump_class_stats(struct Qdisc *sch, unsigned long arg, struct gnet_dump *d)
} }
static int htb_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new, static int htb_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
struct Qdisc **old) struct Qdisc **old, struct netlink_ext_ack *extack)
{ {
struct htb_class *cl = (struct htb_class *)arg; struct htb_class *cl = (struct htb_class *)arg;
......
...@@ -155,7 +155,7 @@ static struct netdev_queue *mq_select_queue(struct Qdisc *sch, ...@@ -155,7 +155,7 @@ static struct netdev_queue *mq_select_queue(struct Qdisc *sch,
} }
static int mq_graft(struct Qdisc *sch, unsigned long cl, struct Qdisc *new, static int mq_graft(struct Qdisc *sch, unsigned long cl, struct Qdisc *new,
struct Qdisc **old) struct Qdisc **old, struct netlink_ext_ack *extack)
{ {
struct netdev_queue *dev_queue = mq_queue_get(sch, cl); struct netdev_queue *dev_queue = mq_queue_get(sch, cl);
struct net_device *dev = qdisc_dev(sch); struct net_device *dev = qdisc_dev(sch);
......
...@@ -320,7 +320,7 @@ static struct netdev_queue *mqprio_queue_get(struct Qdisc *sch, ...@@ -320,7 +320,7 @@ static struct netdev_queue *mqprio_queue_get(struct Qdisc *sch,
} }
static int mqprio_graft(struct Qdisc *sch, unsigned long cl, struct Qdisc *new, static int mqprio_graft(struct Qdisc *sch, unsigned long cl, struct Qdisc *new,
struct Qdisc **old) struct Qdisc **old, struct netlink_ext_ack *extack)
{ {
struct net_device *dev = qdisc_dev(sch); struct net_device *dev = qdisc_dev(sch);
struct netdev_queue *dev_queue = mqprio_queue_get(sch, cl); struct netdev_queue *dev_queue = mqprio_queue_get(sch, cl);
......
...@@ -283,7 +283,7 @@ static int multiq_dump(struct Qdisc *sch, struct sk_buff *skb) ...@@ -283,7 +283,7 @@ static int multiq_dump(struct Qdisc *sch, struct sk_buff *skb)
} }
static int multiq_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new, static int multiq_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
struct Qdisc **old) struct Qdisc **old, struct netlink_ext_ack *extack)
{ {
struct multiq_sched_data *q = qdisc_priv(sch); struct multiq_sched_data *q = qdisc_priv(sch);
unsigned long band = arg - 1; unsigned long band = arg - 1;
......
...@@ -1159,7 +1159,7 @@ static int netem_dump_class(struct Qdisc *sch, unsigned long cl, ...@@ -1159,7 +1159,7 @@ static int netem_dump_class(struct Qdisc *sch, unsigned long cl,
} }
static int netem_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new, static int netem_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
struct Qdisc **old) struct Qdisc **old, struct netlink_ext_ack *extack)
{ {
struct netem_sched_data *q = qdisc_priv(sch); struct netem_sched_data *q = qdisc_priv(sch);
......
...@@ -242,7 +242,7 @@ static int prio_dump(struct Qdisc *sch, struct sk_buff *skb) ...@@ -242,7 +242,7 @@ static int prio_dump(struct Qdisc *sch, struct sk_buff *skb)
} }
static int prio_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new, static int prio_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
struct Qdisc **old) struct Qdisc **old, struct netlink_ext_ack *extack)
{ {
struct prio_sched_data *q = qdisc_priv(sch); struct prio_sched_data *q = qdisc_priv(sch);
unsigned long band = arg - 1; unsigned long band = arg - 1;
......
...@@ -595,7 +595,8 @@ static void qfq_unbind_tcf(struct Qdisc *sch, unsigned long arg) ...@@ -595,7 +595,8 @@ static void qfq_unbind_tcf(struct Qdisc *sch, unsigned long arg)
} }
static int qfq_graft_class(struct Qdisc *sch, unsigned long arg, static int qfq_graft_class(struct Qdisc *sch, unsigned long arg,
struct Qdisc *new, struct Qdisc **old) struct Qdisc *new, struct Qdisc **old,
struct netlink_ext_ack *extack)
{ {
struct qfq_class *cl = (struct qfq_class *)arg; struct qfq_class *cl = (struct qfq_class *)arg;
......
...@@ -382,7 +382,7 @@ static int red_dump_class(struct Qdisc *sch, unsigned long cl, ...@@ -382,7 +382,7 @@ static int red_dump_class(struct Qdisc *sch, unsigned long cl,
} }
static int red_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new, static int red_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
struct Qdisc **old) struct Qdisc **old, struct netlink_ext_ack *extack)
{ {
struct red_sched_data *q = qdisc_priv(sch); struct red_sched_data *q = qdisc_priv(sch);
......
...@@ -617,7 +617,7 @@ static int sfb_dump_class(struct Qdisc *sch, unsigned long cl, ...@@ -617,7 +617,7 @@ static int sfb_dump_class(struct Qdisc *sch, unsigned long cl,
} }
static int sfb_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new, static int sfb_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
struct Qdisc **old) struct Qdisc **old, struct netlink_ext_ack *extack)
{ {
struct sfb_sched_data *q = qdisc_priv(sch); struct sfb_sched_data *q = qdisc_priv(sch);
......
...@@ -496,7 +496,7 @@ static int tbf_dump_class(struct Qdisc *sch, unsigned long cl, ...@@ -496,7 +496,7 @@ static int tbf_dump_class(struct Qdisc *sch, unsigned long cl,
} }
static int tbf_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new, static int tbf_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
struct Qdisc **old) struct Qdisc **old, struct netlink_ext_ack *extack)
{ {
struct tbf_sched_data *q = qdisc_priv(sch); struct tbf_sched_data *q = qdisc_priv(sch);
......
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