net: sched: cls: add extack support for change callback
authorAlexander Aring <aring@mojatatu.com>
Thu, 18 Jan 2018 16:20:51 +0000 (11:20 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 19 Jan 2018 20:52:51 +0000 (15:52 -0500)
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>
13 files changed:
include/net/sch_generic.h
net/sched/cls_api.c
net/sched/cls_basic.c
net/sched/cls_bpf.c
net/sched/cls_cgroup.c
net/sched/cls_flow.c
net/sched/cls_flower.c
net/sched/cls_fw.c
net/sched/cls_matchall.c
net/sched/cls_route.c
net/sched/cls_rsvp.h
net/sched/cls_tcindex.c
net/sched/cls_u32.c

index c90f5fe6bed90693c094ef8d0f84b04b7220ac43..ee398bcd46e7b9ceb8f6d596360639bc5691e4cd 100644 (file)
@@ -239,7 +239,8 @@ struct tcf_proto_ops {
        int                     (*change)(struct net *net, struct sk_buff *,
                                        struct tcf_proto*, unsigned long,
                                        u32 handle, struct nlattr **,
-                                       void **, bool);
+                                       void **, bool,
+                                       struct netlink_ext_ack *);
        int                     (*delete)(struct tcf_proto *tp, void *arg,
                                          bool *last);
        void                    (*walk)(struct tcf_proto*, struct tcf_walker *arg);
index 3e3841adbd5c57ad650937af6ec58145e9a4689a..06797c2e810255365329866b0eb171eb4d579f0e 100644 (file)
@@ -1231,7 +1231,8 @@ replay:
        }
 
        err = tp->ops->change(net, skb, tp, cl, t->tcm_handle, tca, &fh,
-                             n->nlmsg_flags & NLM_F_CREATE ? TCA_ACT_NOREPLACE : TCA_ACT_REPLACE);
+                             n->nlmsg_flags & NLM_F_CREATE ? TCA_ACT_NOREPLACE : TCA_ACT_REPLACE,
+                             extack);
        if (err == 0) {
                if (tp_created)
                        tcf_chain_tp_insert(chain, &chain_info, tp);
index 5f169ded347e8714aca536f93e1480d228df72c8..2cc38cd719383ba461d2a6c86aad70fab8a902d8 100644 (file)
@@ -175,7 +175,8 @@ static int basic_set_parms(struct net *net, struct tcf_proto *tp,
 
 static int basic_change(struct net *net, struct sk_buff *in_skb,
                        struct tcf_proto *tp, unsigned long base, u32 handle,
-                       struct nlattr **tca, void **arg, bool ovr)
+                       struct nlattr **tca, void **arg, bool ovr,
+                       struct netlink_ext_ack *extack)
 {
        int err;
        struct basic_head *head = rtnl_dereference(tp->root);
index cf72aefcf98dad55061d15f4cdd93d68782fcc78..e51eb503a23a25f93a2d2eae343cb7738a052d54 100644 (file)
@@ -452,7 +452,7 @@ static int cls_bpf_set_parms(struct net *net, struct tcf_proto *tp,
 static int cls_bpf_change(struct net *net, struct sk_buff *in_skb,
                          struct tcf_proto *tp, unsigned long base,
                          u32 handle, struct nlattr **tca,
-                         void **arg, bool ovr)
+                         void **arg, bool ovr, struct netlink_ext_ack *extack)
 {
        struct cls_bpf_head *head = rtnl_dereference(tp->root);
        struct cls_bpf_prog *oldprog = *arg;
index 309d5899265f8f7dea731a2a8569867fa5077e09..b74af0b5582089851d7301a9404dd0c31ed10b05 100644 (file)
@@ -91,7 +91,8 @@ static void cls_cgroup_destroy_rcu(struct rcu_head *root)
 static int cls_cgroup_change(struct net *net, struct sk_buff *in_skb,
                             struct tcf_proto *tp, unsigned long base,
                             u32 handle, struct nlattr **tca,
-                            void **arg, bool ovr)
+                            void **arg, bool ovr,
+                            struct netlink_ext_ack *extack)
 {
        struct nlattr *tb[TCA_CGROUP_MAX + 1];
        struct cls_cgroup_head *head = rtnl_dereference(tp->root);
index 28cd6fb52c16bd5e8816ff14e007d2b726748ce7..faa0b6793a171c90b8a16ab5dd792db228ced5a0 100644 (file)
@@ -401,7 +401,7 @@ static void flow_destroy_filter(struct rcu_head *head)
 static int flow_change(struct net *net, struct sk_buff *in_skb,
                       struct tcf_proto *tp, unsigned long base,
                       u32 handle, struct nlattr **tca,
-                      void **arg, bool ovr)
+                      void **arg, bool ovr, struct netlink_ext_ack *extack)
 {
        struct flow_head *head = rtnl_dereference(tp->root);
        struct flow_filter *fold, *fnew;
index f61df19b102646cb78074b2dd25e16986af77d83..7d92bbeeba545e523ecdc0caa851f2fdaf4f5a25 100644 (file)
@@ -853,7 +853,7 @@ static int fl_set_parms(struct net *net, struct tcf_proto *tp,
 static int fl_change(struct net *net, struct sk_buff *in_skb,
                     struct tcf_proto *tp, unsigned long base,
                     u32 handle, struct nlattr **tca,
-                    void **arg, bool ovr)
+                    void **arg, bool ovr, struct netlink_ext_ack *extack)
 {
        struct cls_fl_head *head = rtnl_dereference(tp->root);
        struct cls_fl_filter *fold = *arg;
index 20f0de1a960a7b993596355acc35bf15a7dd02bd..72784491ce20a99a3636b726b044e3d3b16a3fce 100644 (file)
@@ -257,7 +257,7 @@ static int fw_set_parms(struct net *net, struct tcf_proto *tp,
 static int fw_change(struct net *net, struct sk_buff *in_skb,
                     struct tcf_proto *tp, unsigned long base,
                     u32 handle, struct nlattr **tca, void **arg,
-                    bool ovr)
+                    bool ovr, struct netlink_ext_ack *extack)
 {
        struct fw_head *head = rtnl_dereference(tp->root);
        struct fw_filter *f = *arg;
index aeae89eeed0d048ec18847f0afa0655026cf3b48..689bd199aa142b9f2dce37574444b016bcac5280 100644 (file)
@@ -160,7 +160,7 @@ static int mall_set_parms(struct net *net, struct tcf_proto *tp,
 static int mall_change(struct net *net, struct sk_buff *in_skb,
                       struct tcf_proto *tp, unsigned long base,
                       u32 handle, struct nlattr **tca,
-                      void **arg, bool ovr)
+                      void **arg, bool ovr, struct netlink_ext_ack *extack)
 {
        struct cls_mall_head *head = rtnl_dereference(tp->root);
        struct nlattr *tb[TCA_MATCHALL_MAX + 1];
index a1f2b1b7c0145054a7175810914576ee5a0658b9..f436d4d894a920ddc4077ab44f1b04619b594ff5 100644 (file)
@@ -471,7 +471,8 @@ static int route4_set_parms(struct net *net, struct tcf_proto *tp,
 
 static int route4_change(struct net *net, struct sk_buff *in_skb,
                         struct tcf_proto *tp, unsigned long base, u32 handle,
-                        struct nlattr **tca, void **arg, bool ovr)
+                        struct nlattr **tca, void **arg, bool ovr,
+                        struct netlink_ext_ack *extack)
 {
        struct route4_head *head = rtnl_dereference(tp->root);
        struct route4_filter __rcu **fp;
index cf325625c99da83df0503a7a324d1b962540a34a..d1f67529c01d63ee2dedc751d2063067380724fb 100644 (file)
@@ -486,7 +486,7 @@ static int rsvp_change(struct net *net, struct sk_buff *in_skb,
                       struct tcf_proto *tp, unsigned long base,
                       u32 handle,
                       struct nlattr **tca,
-                      void **arg, bool ovr)
+                      void **arg, bool ovr, struct netlink_ext_ack *extack)
 {
        struct rsvp_head *data = rtnl_dereference(tp->root);
        struct rsvp_filter *f, *nfp;
index 67467ae24c9765085d5935f7c1e0fa2ae7aedc12..0ec84cf2d6b77384443f2fc0f56ad27cce9fa091 100644 (file)
@@ -520,7 +520,8 @@ errout:
 static int
 tcindex_change(struct net *net, struct sk_buff *in_skb,
               struct tcf_proto *tp, unsigned long base, u32 handle,
-              struct nlattr **tca, void **arg, bool ovr)
+              struct nlattr **tca, void **arg, bool ovr,
+              struct netlink_ext_ack *extack)
 {
        struct nlattr *opt = tca[TCA_OPTIONS];
        struct nlattr *tb[TCA_TCINDEX_MAX + 1];
index 84129b3c14e53df24d2341ff4cdc7c481bf8348e..d9cadebc7eaa77e3506042355d8d71e6e44564ff 100644 (file)
@@ -893,7 +893,8 @@ static struct tc_u_knode *u32_init_knode(struct tcf_proto *tp,
 
 static int u32_change(struct net *net, struct sk_buff *in_skb,
                      struct tcf_proto *tp, unsigned long base, u32 handle,
-                     struct nlattr **tca, void **arg, bool ovr)
+                     struct nlattr **tca, void **arg, bool ovr,
+                     struct netlink_ext_ack *extack)
 {
        struct tc_u_common *tp_c = tp->data;
        struct tc_u_hnode *ht;