aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Aring <aring@mojatatu.com>2018-01-18 11:20:51 -0500
committerDavid S. Miller <davem@davemloft.net>2018-01-19 15:52:51 -0500
commit7306db38a67cf6b8e1ca354b1d0c0117b7b880d5 (patch)
tree61955b0d0434a5edc5fc233648093929d111f257
parentc35a4acc298528ac7ac8d21284af7cad981aa79d (diff)
net: sched: cls: add extack support for change callback
This patch adds extack support for classifier change callback api. This prepares to handle extack support inside each specific classifier implementation. Cc: David Ahern <dsahern@gmail.com> Signed-off-by: Alexander Aring <aring@mojatatu.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/sch_generic.h3
-rw-r--r--net/sched/cls_api.c3
-rw-r--r--net/sched/cls_basic.c3
-rw-r--r--net/sched/cls_bpf.c2
-rw-r--r--net/sched/cls_cgroup.c3
-rw-r--r--net/sched/cls_flow.c2
-rw-r--r--net/sched/cls_flower.c2
-rw-r--r--net/sched/cls_fw.c2
-rw-r--r--net/sched/cls_matchall.c2
-rw-r--r--net/sched/cls_route.c3
-rw-r--r--net/sched/cls_rsvp.h2
-rw-r--r--net/sched/cls_tcindex.c3
-rw-r--r--net/sched/cls_u32.c3
13 files changed, 20 insertions, 13 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index c90f5fe6bed9..ee398bcd46e7 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -239,7 +239,8 @@ struct tcf_proto_ops {
239 int (*change)(struct net *net, struct sk_buff *, 239 int (*change)(struct net *net, struct sk_buff *,
240 struct tcf_proto*, unsigned long, 240 struct tcf_proto*, unsigned long,
241 u32 handle, struct nlattr **, 241 u32 handle, struct nlattr **,
242 void **, bool); 242 void **, bool,
243 struct netlink_ext_ack *);
243 int (*delete)(struct tcf_proto *tp, void *arg, 244 int (*delete)(struct tcf_proto *tp, void *arg,
244 bool *last); 245 bool *last);
245 void (*walk)(struct tcf_proto*, struct tcf_walker *arg); 246 void (*walk)(struct tcf_proto*, struct tcf_walker *arg);
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 3e3841adbd5c..06797c2e8102 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -1231,7 +1231,8 @@ replay:
1231 } 1231 }
1232 1232
1233 err = tp->ops->change(net, skb, tp, cl, t->tcm_handle, tca, &fh, 1233 err = tp->ops->change(net, skb, tp, cl, t->tcm_handle, tca, &fh,
1234 n->nlmsg_flags & NLM_F_CREATE ? TCA_ACT_NOREPLACE : TCA_ACT_REPLACE); 1234 n->nlmsg_flags & NLM_F_CREATE ? TCA_ACT_NOREPLACE : TCA_ACT_REPLACE,
1235 extack);
1235 if (err == 0) { 1236 if (err == 0) {
1236 if (tp_created) 1237 if (tp_created)
1237 tcf_chain_tp_insert(chain, &chain_info, tp); 1238 tcf_chain_tp_insert(chain, &chain_info, tp);
diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c
index 5f169ded347e..2cc38cd71938 100644
--- a/net/sched/cls_basic.c
+++ b/net/sched/cls_basic.c
@@ -175,7 +175,8 @@ static int basic_set_parms(struct net *net, struct tcf_proto *tp,
175 175
176static int basic_change(struct net *net, struct sk_buff *in_skb, 176static int basic_change(struct net *net, struct sk_buff *in_skb,
177 struct tcf_proto *tp, unsigned long base, u32 handle, 177 struct tcf_proto *tp, unsigned long base, u32 handle,
178 struct nlattr **tca, void **arg, bool ovr) 178 struct nlattr **tca, void **arg, bool ovr,
179 struct netlink_ext_ack *extack)
179{ 180{
180 int err; 181 int err;
181 struct basic_head *head = rtnl_dereference(tp->root); 182 struct basic_head *head = rtnl_dereference(tp->root);
diff --git a/net/sched/cls_bpf.c b/net/sched/cls_bpf.c
index cf72aefcf98d..e51eb503a23a 100644
--- a/net/sched/cls_bpf.c
+++ b/net/sched/cls_bpf.c
@@ -452,7 +452,7 @@ static int cls_bpf_set_parms(struct net *net, struct tcf_proto *tp,
452static int cls_bpf_change(struct net *net, struct sk_buff *in_skb, 452static int cls_bpf_change(struct net *net, struct sk_buff *in_skb,
453 struct tcf_proto *tp, unsigned long base, 453 struct tcf_proto *tp, unsigned long base,
454 u32 handle, struct nlattr **tca, 454 u32 handle, struct nlattr **tca,
455 void **arg, bool ovr) 455 void **arg, bool ovr, struct netlink_ext_ack *extack)
456{ 456{
457 struct cls_bpf_head *head = rtnl_dereference(tp->root); 457 struct cls_bpf_head *head = rtnl_dereference(tp->root);
458 struct cls_bpf_prog *oldprog = *arg; 458 struct cls_bpf_prog *oldprog = *arg;
diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c
index 309d5899265f..b74af0b55820 100644
--- a/net/sched/cls_cgroup.c
+++ b/net/sched/cls_cgroup.c
@@ -91,7 +91,8 @@ static void cls_cgroup_destroy_rcu(struct rcu_head *root)
91static int cls_cgroup_change(struct net *net, struct sk_buff *in_skb, 91static int cls_cgroup_change(struct net *net, struct sk_buff *in_skb,
92 struct tcf_proto *tp, unsigned long base, 92 struct tcf_proto *tp, unsigned long base,
93 u32 handle, struct nlattr **tca, 93 u32 handle, struct nlattr **tca,
94 void **arg, bool ovr) 94 void **arg, bool ovr,
95 struct netlink_ext_ack *extack)
95{ 96{
96 struct nlattr *tb[TCA_CGROUP_MAX + 1]; 97 struct nlattr *tb[TCA_CGROUP_MAX + 1];
97 struct cls_cgroup_head *head = rtnl_dereference(tp->root); 98 struct cls_cgroup_head *head = rtnl_dereference(tp->root);
diff --git a/net/sched/cls_flow.c b/net/sched/cls_flow.c
index 28cd6fb52c16..faa0b6793a17 100644
--- a/net/sched/cls_flow.c
+++ b/net/sched/cls_flow.c
@@ -401,7 +401,7 @@ static void flow_destroy_filter(struct rcu_head *head)
401static int flow_change(struct net *net, struct sk_buff *in_skb, 401static int flow_change(struct net *net, struct sk_buff *in_skb,
402 struct tcf_proto *tp, unsigned long base, 402 struct tcf_proto *tp, unsigned long base,
403 u32 handle, struct nlattr **tca, 403 u32 handle, struct nlattr **tca,
404 void **arg, bool ovr) 404 void **arg, bool ovr, struct netlink_ext_ack *extack)
405{ 405{
406 struct flow_head *head = rtnl_dereference(tp->root); 406 struct flow_head *head = rtnl_dereference(tp->root);
407 struct flow_filter *fold, *fnew; 407 struct flow_filter *fold, *fnew;
diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c
index f61df19b1026..7d92bbeeba54 100644
--- a/net/sched/cls_flower.c
+++ b/net/sched/cls_flower.c
@@ -853,7 +853,7 @@ static int fl_set_parms(struct net *net, struct tcf_proto *tp,
853static int fl_change(struct net *net, struct sk_buff *in_skb, 853static int fl_change(struct net *net, struct sk_buff *in_skb,
854 struct tcf_proto *tp, unsigned long base, 854 struct tcf_proto *tp, unsigned long base,
855 u32 handle, struct nlattr **tca, 855 u32 handle, struct nlattr **tca,
856 void **arg, bool ovr) 856 void **arg, bool ovr, struct netlink_ext_ack *extack)
857{ 857{
858 struct cls_fl_head *head = rtnl_dereference(tp->root); 858 struct cls_fl_head *head = rtnl_dereference(tp->root);
859 struct cls_fl_filter *fold = *arg; 859 struct cls_fl_filter *fold = *arg;
diff --git a/net/sched/cls_fw.c b/net/sched/cls_fw.c
index 20f0de1a960a..72784491ce20 100644
--- a/net/sched/cls_fw.c
+++ b/net/sched/cls_fw.c
@@ -257,7 +257,7 @@ static int fw_set_parms(struct net *net, struct tcf_proto *tp,
257static int fw_change(struct net *net, struct sk_buff *in_skb, 257static int fw_change(struct net *net, struct sk_buff *in_skb,
258 struct tcf_proto *tp, unsigned long base, 258 struct tcf_proto *tp, unsigned long base,
259 u32 handle, struct nlattr **tca, void **arg, 259 u32 handle, struct nlattr **tca, void **arg,
260 bool ovr) 260 bool ovr, struct netlink_ext_ack *extack)
261{ 261{
262 struct fw_head *head = rtnl_dereference(tp->root); 262 struct fw_head *head = rtnl_dereference(tp->root);
263 struct fw_filter *f = *arg; 263 struct fw_filter *f = *arg;
diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c
index aeae89eeed0d..689bd199aa14 100644
--- a/net/sched/cls_matchall.c
+++ b/net/sched/cls_matchall.c
@@ -160,7 +160,7 @@ static int mall_set_parms(struct net *net, struct tcf_proto *tp,
160static int mall_change(struct net *net, struct sk_buff *in_skb, 160static int mall_change(struct net *net, struct sk_buff *in_skb,
161 struct tcf_proto *tp, unsigned long base, 161 struct tcf_proto *tp, unsigned long base,
162 u32 handle, struct nlattr **tca, 162 u32 handle, struct nlattr **tca,
163 void **arg, bool ovr) 163 void **arg, bool ovr, struct netlink_ext_ack *extack)
164{ 164{
165 struct cls_mall_head *head = rtnl_dereference(tp->root); 165 struct cls_mall_head *head = rtnl_dereference(tp->root);
166 struct nlattr *tb[TCA_MATCHALL_MAX + 1]; 166 struct nlattr *tb[TCA_MATCHALL_MAX + 1];
diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c
index a1f2b1b7c014..f436d4d894a9 100644
--- a/net/sched/cls_route.c
+++ b/net/sched/cls_route.c
@@ -471,7 +471,8 @@ static int route4_set_parms(struct net *net, struct tcf_proto *tp,
471 471
472static int route4_change(struct net *net, struct sk_buff *in_skb, 472static int route4_change(struct net *net, struct sk_buff *in_skb,
473 struct tcf_proto *tp, unsigned long base, u32 handle, 473 struct tcf_proto *tp, unsigned long base, u32 handle,
474 struct nlattr **tca, void **arg, bool ovr) 474 struct nlattr **tca, void **arg, bool ovr,
475 struct netlink_ext_ack *extack)
475{ 476{
476 struct route4_head *head = rtnl_dereference(tp->root); 477 struct route4_head *head = rtnl_dereference(tp->root);
477 struct route4_filter __rcu **fp; 478 struct route4_filter __rcu **fp;
diff --git a/net/sched/cls_rsvp.h b/net/sched/cls_rsvp.h
index cf325625c99d..d1f67529c01d 100644
--- a/net/sched/cls_rsvp.h
+++ b/net/sched/cls_rsvp.h
@@ -486,7 +486,7 @@ static int rsvp_change(struct net *net, struct sk_buff *in_skb,
486 struct tcf_proto *tp, unsigned long base, 486 struct tcf_proto *tp, unsigned long base,
487 u32 handle, 487 u32 handle,
488 struct nlattr **tca, 488 struct nlattr **tca,
489 void **arg, bool ovr) 489 void **arg, bool ovr, struct netlink_ext_ack *extack)
490{ 490{
491 struct rsvp_head *data = rtnl_dereference(tp->root); 491 struct rsvp_head *data = rtnl_dereference(tp->root);
492 struct rsvp_filter *f, *nfp; 492 struct rsvp_filter *f, *nfp;
diff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c
index 67467ae24c97..0ec84cf2d6b7 100644
--- a/net/sched/cls_tcindex.c
+++ b/net/sched/cls_tcindex.c
@@ -520,7 +520,8 @@ errout:
520static int 520static int
521tcindex_change(struct net *net, struct sk_buff *in_skb, 521tcindex_change(struct net *net, struct sk_buff *in_skb,
522 struct tcf_proto *tp, unsigned long base, u32 handle, 522 struct tcf_proto *tp, unsigned long base, u32 handle,
523 struct nlattr **tca, void **arg, bool ovr) 523 struct nlattr **tca, void **arg, bool ovr,
524 struct netlink_ext_ack *extack)
524{ 525{
525 struct nlattr *opt = tca[TCA_OPTIONS]; 526 struct nlattr *opt = tca[TCA_OPTIONS];
526 struct nlattr *tb[TCA_TCINDEX_MAX + 1]; 527 struct nlattr *tb[TCA_TCINDEX_MAX + 1];
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index 84129b3c14e5..d9cadebc7eaa 100644
--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -893,7 +893,8 @@ static struct tc_u_knode *u32_init_knode(struct tcf_proto *tp,
893 893
894static int u32_change(struct net *net, struct sk_buff *in_skb, 894static int u32_change(struct net *net, struct sk_buff *in_skb,
895 struct tcf_proto *tp, unsigned long base, u32 handle, 895 struct tcf_proto *tp, unsigned long base, u32 handle,
896 struct nlattr **tca, void **arg, bool ovr) 896 struct nlattr **tca, void **arg, bool ovr,
897 struct netlink_ext_ack *extack)
897{ 898{
898 struct tc_u_common *tp_c = tp->data; 899 struct tc_u_common *tp_c = tp->data;
899 struct tc_u_hnode *ht; 900 struct tc_u_hnode *ht;