Re: [PATCH net-next 5/6] net: sched: sch: add extack for block callback

2017-12-06 Thread Jamal Hadi Salim

On 17-12-06 11:08 AM, Alexander Aring wrote:

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

Cc: David Ahern
Signed-off-by: Alexander Aring


Acked-by: Jamal Hadi Salim 

cheers,
jamal


[PATCH net-next 5/6] net: sched: sch: add extack for block callback

2017-12-06 Thread Alexander Aring
This patch adds extack support for block callback to prepare per-qdisc
specific changes for extack.

Cc: David Ahern 
Signed-off-by: Alexander Aring 
---
 include/net/sch_generic.h | 3 ++-
 net/sched/cls_api.c   | 4 ++--
 net/sched/sch_api.c   | 2 +-
 net/sched/sch_cbq.c   | 3 ++-
 net/sched/sch_drr.c   | 3 ++-
 net/sched/sch_dsmark.c| 3 ++-
 net/sched/sch_fq_codel.c  | 3 ++-
 net/sched/sch_hfsc.c  | 3 ++-
 net/sched/sch_htb.c   | 3 ++-
 net/sched/sch_ingress.c   | 6 --
 net/sched/sch_multiq.c| 3 ++-
 net/sched/sch_prio.c  | 3 ++-
 net/sched/sch_qfq.c   | 3 ++-
 net/sched/sch_sfb.c   | 3 ++-
 net/sched/sch_sfq.c   | 3 ++-
 15 files changed, 31 insertions(+), 17 deletions(-)

diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index d5a545a9d13e..b9940ea8b25e 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -163,7 +163,8 @@ struct Qdisc_class_ops {
 
/* Filter manipulation */
struct tcf_block *  (*tcf_block)(struct Qdisc *sch,
-unsigned long arg);
+unsigned long arg,
+struct netlink_ext_ack *extack);
unsigned long   (*bind_tcf)(struct Qdisc *, unsigned long,
u32 classid);
void(*unbind_tcf)(struct Qdisc *, unsigned long);
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index d51051dd8f7d..3f9e9e7cf3f9 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -793,7 +793,7 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct 
nlmsghdr *n,
}
 
/* And the last stroke */
-   block = cops->tcf_block(q, cl);
+   block = cops->tcf_block(q, cl, extack);
if (!block) {
err = -EINVAL;
goto errout;
@@ -1040,7 +1040,7 @@ static int tc_dump_tfilter(struct sk_buff *skb, struct 
netlink_callback *cb)
if (cl == 0)
goto out;
}
-   block = cops->tcf_block(q, cl);
+   block = cops->tcf_block(q, cl, NULL);
if (!block)
goto out;
 
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 87c974d2d576..d1ef0df4d628 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -1775,7 +1775,7 @@ static void tc_bind_tclass(struct Qdisc *q, u32 portid, 
u32 clid,
cl = cops->find(q, portid);
if (!cl)
return;
-   block = cops->tcf_block(q, cl);
+   block = cops->tcf_block(q, cl, NULL);
if (!block)
return;
list_for_each_entry(chain, &block->chain_list, list) {
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
index 55cb7c035b19..aba17cc34050 100644
--- a/net/sched/sch_cbq.c
+++ b/net/sched/sch_cbq.c
@@ -1679,7 +1679,8 @@ static int cbq_delete(struct Qdisc *sch, unsigned long 
arg)
return 0;
 }
 
-static struct tcf_block *cbq_tcf_block(struct Qdisc *sch, unsigned long arg)
+static struct tcf_block *cbq_tcf_block(struct Qdisc *sch, unsigned long arg,
+  struct netlink_ext_ack *extack)
 {
struct cbq_sched_data *q = qdisc_priv(sch);
struct cbq_class *cl = (struct cbq_class *)arg;
diff --git a/net/sched/sch_drr.c b/net/sched/sch_drr.c
index 73b914bc47a4..44a2870f6f10 100644
--- a/net/sched/sch_drr.c
+++ b/net/sched/sch_drr.c
@@ -173,7 +173,8 @@ static unsigned long drr_search_class(struct Qdisc *sch, 
u32 classid)
return (unsigned long)drr_find_class(sch, classid);
 }
 
-static struct tcf_block *drr_tcf_block(struct Qdisc *sch, unsigned long cl)
+static struct tcf_block *drr_tcf_block(struct Qdisc *sch, unsigned long cl,
+  struct netlink_ext_ack *extack)
 {
struct drr_sched *q = qdisc_priv(sch);
 
diff --git a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c
index 89e433bbd590..5dc5d5216fbb 100644
--- a/net/sched/sch_dsmark.c
+++ b/net/sched/sch_dsmark.c
@@ -185,7 +185,8 @@ static void dsmark_walk(struct Qdisc *sch, struct 
qdisc_walker *walker)
}
 }
 
-static struct tcf_block *dsmark_tcf_block(struct Qdisc *sch, unsigned long cl)
+static struct tcf_block *dsmark_tcf_block(struct Qdisc *sch, unsigned long cl,
+ struct netlink_ext_ack *extack)
 {
struct dsmark_qdisc_data *p = qdisc_priv(sch);
 
diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c
index d798c93f7c96..8c5cea978d16 100644
--- a/net/sched/sch_fq_codel.c
+++ b/net/sched/sch_fq_codel.c
@@ -597,7 +597,8 @@ static void fq_codel_unbind(struct Qdisc *q, unsigned long 
cl)
 {
 }
 
-static struct tcf_block *fq_codel_tcf_block(struct Qdisc *sch, unsigned long 
cl)
+static struct tcf_block *fq_codel_tcf_block(struct Qdisc *sch, unsigned long 
cl,
+   struct netlink_ext_ack *extack)
 {
struct fq_codel_sched_dat