net: sched: act: add extack for walk callback
authorAlexander Aring <aring@mojatatu.com>
Thu, 15 Feb 2018 15:54:58 +0000 (10:54 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Feb 2018 21:05:50 +0000 (16:05 -0500)
This patch adds extack support for act walker callback api. This
prepares to handle extack support inside each specific act
implementation.

Cc: David Ahern <dsahern@gmail.com>
Signed-off-by: Alexander Aring <aring@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
18 files changed:
include/net/act_api.h
net/sched/act_api.c
net/sched/act_bpf.c
net/sched/act_connmark.c
net/sched/act_csum.c
net/sched/act_gact.c
net/sched/act_ife.c
net/sched/act_ipt.c
net/sched/act_mirred.c
net/sched/act_nat.c
net/sched/act_pedit.c
net/sched/act_police.c
net/sched/act_sample.c
net/sched/act_simple.c
net/sched/act_skbedit.c
net/sched/act_skbmod.c
net/sched/act_tunnel_key.c
net/sched/act_vlan.c

index 0bd65db506bae2b772eaa3176d31bf4a2b65fb21..ab352925537748e54d35c5635e56b7e917ee1edc 100644 (file)
@@ -94,7 +94,8 @@ struct tc_action_ops {
                        int bind, struct netlink_ext_ack *extack);
        int     (*walk)(struct net *, struct sk_buff *,
                        struct netlink_callback *, int,
-                       const struct tc_action_ops *);
+                       const struct tc_action_ops *,
+                       struct netlink_ext_ack *);
        void    (*stats_update)(struct tc_action *, u64, u32, u64);
        struct net_device *(*get_dev)(const struct tc_action *a);
 };
index 74ed1e288e57fff719f0c3ad705376bb53831d4e..ab107997b2594adf09d377aa1ea7096ca4b0c482 100644 (file)
@@ -963,7 +963,7 @@ static int tca_action_flush(struct net *net, struct nlattr *nla,
                goto out_module_put;
        }
 
-       err = ops->walk(net, skb, &dcb, RTM_DELACTION, ops);
+       err = ops->walk(net, skb, &dcb, RTM_DELACTION, ops, extack);
        if (err <= 0) {
                nla_nest_cancel(skb, nest);
                goto out_module_put;
@@ -1255,7 +1255,7 @@ static int tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb)
        if (nest == NULL)
                goto out_module_put;
 
-       ret = a_o->walk(net, skb, cb, RTM_GETACTION, a_o);
+       ret = a_o->walk(net, skb, cb, RTM_GETACTION, a_o, NULL);
        if (ret < 0)
                goto out_module_put;
 
index d9654b86334797e63cbfb1cf30e416ee1572762b..7e01e2c710c4aa14404e083511423a7bddb00b47 100644 (file)
@@ -367,7 +367,8 @@ static void tcf_bpf_cleanup(struct tc_action *act)
 
 static int tcf_bpf_walker(struct net *net, struct sk_buff *skb,
                          struct netlink_callback *cb, int type,
-                         const struct tc_action_ops *ops)
+                         const struct tc_action_ops *ops,
+                         struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, bpf_net_id);
 
index 0504b7600fb6bd9fccf705a86ef6eeb81e9b339a..cb722da0bb15f7adac18d0131374685a34854f53 100644 (file)
@@ -177,7 +177,8 @@ nla_put_failure:
 
 static int tcf_connmark_walker(struct net *net, struct sk_buff *skb,
                               struct netlink_callback *cb, int type,
-                              const struct tc_action_ops *ops)
+                              const struct tc_action_ops *ops,
+                              struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, connmark_net_id);
 
index bdd17b9ef0342d8f9dd9874efbaad5d7639da9c2..3e8efadb750fa58850ba35a217bac414446470a4 100644 (file)
@@ -631,7 +631,8 @@ static void tcf_csum_cleanup(struct tc_action *a)
 
 static int tcf_csum_walker(struct net *net, struct sk_buff *skb,
                           struct netlink_callback *cb, int type,
-                          const struct tc_action_ops *ops)
+                          const struct tc_action_ops *ops,
+                          struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, csum_net_id);
 
index e1e69e38f4b0090f4502b2cb7437fbd127333c05..d96ebe4bb65a44b7bdc4951de68efa46503f74c2 100644 (file)
@@ -201,7 +201,8 @@ nla_put_failure:
 
 static int tcf_gact_walker(struct net *net, struct sk_buff *skb,
                           struct netlink_callback *cb, int type,
-                          const struct tc_action_ops *ops)
+                          const struct tc_action_ops *ops,
+                          struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, gact_net_id);
 
index 0b70fb0cc609605a17323c1b971525718e647e5d..b777e381e0dd781e9de7ee9f5440cd0d95f9c2fb 100644 (file)
@@ -824,7 +824,8 @@ static int tcf_ife_act(struct sk_buff *skb, const struct tc_action *a,
 
 static int tcf_ife_walker(struct net *net, struct sk_buff *skb,
                          struct netlink_callback *cb, int type,
-                         const struct tc_action_ops *ops)
+                         const struct tc_action_ops *ops,
+                         struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, ife_net_id);
 
index f29af79a2d1f944f669faa7e2231a2fd9d2cb8a9..f33a8cc5dee6a303244959ecb91ecc14ffcde7bc 100644 (file)
@@ -303,7 +303,8 @@ nla_put_failure:
 
 static int tcf_ipt_walker(struct net *net, struct sk_buff *skb,
                          struct netlink_callback *cb, int type,
-                         const struct tc_action_ops *ops)
+                         const struct tc_action_ops *ops,
+                         struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, ipt_net_id);
 
@@ -352,7 +353,8 @@ static struct pernet_operations ipt_net_ops = {
 
 static int tcf_xt_walker(struct net *net, struct sk_buff *skb,
                         struct netlink_callback *cb, int type,
-                        const struct tc_action_ops *ops)
+                        const struct tc_action_ops *ops,
+                        struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, xt_net_id);
 
index 9980c6affb5e29d3d8d43677fd8728443a98c249..3dcd295ea6a7a65874b43e228203130514fd03fe 100644 (file)
@@ -265,7 +265,8 @@ nla_put_failure:
 
 static int tcf_mirred_walker(struct net *net, struct sk_buff *skb,
                             struct netlink_callback *cb, int type,
-                            const struct tc_action_ops *ops)
+                            const struct tc_action_ops *ops,
+                            struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, mirred_net_id);
 
index 6f6d7667ef9a8b8e8728e4b7839125edb5425a7c..67243cdc05883e1271b0fa4c26cf8a025bb9099d 100644 (file)
@@ -278,7 +278,8 @@ nla_put_failure:
 
 static int tcf_nat_walker(struct net *net, struct sk_buff *skb,
                          struct netlink_callback *cb, int type,
-                         const struct tc_action_ops *ops)
+                         const struct tc_action_ops *ops,
+                         struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, nat_net_id);
 
index 308b2680a6d9ad7d6fa81dcf884d2c3889b6cd24..6d6481f6bffa6bf703b3f7cc81c118b27d7586d8 100644 (file)
@@ -419,7 +419,8 @@ nla_put_failure:
 
 static int tcf_pedit_walker(struct net *net, struct sk_buff *skb,
                            struct netlink_callback *cb, int type,
-                           const struct tc_action_ops *ops)
+                           const struct tc_action_ops *ops,
+                           struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, pedit_net_id);
 
index 1292f880eab001f84bf8c0611d03dbb37af11cea..ff803414a7362ee9f9a04dfa6f0b54c548754068 100644 (file)
@@ -58,7 +58,8 @@ static struct tc_action_ops act_police_ops;
 
 static int tcf_act_police_walker(struct net *net, struct sk_buff *skb,
                                 struct netlink_callback *cb, int type,
-                                const struct tc_action_ops *ops)
+                                const struct tc_action_ops *ops,
+                                struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, police_net_id);
 
index 22379b2cfd1a0dc079281a69ab0e37a0b0d5e673..7a2b6a33f2397a9899dea76f8490bc6100f40262 100644 (file)
@@ -202,7 +202,8 @@ nla_put_failure:
 
 static int tcf_sample_walker(struct net *net, struct sk_buff *skb,
                             struct netlink_callback *cb, int type,
-                            const struct tc_action_ops *ops)
+                            const struct tc_action_ops *ops,
+                            struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, sample_net_id);
 
index 3ebf714709774b908c996ecb44c43e8fdb5e1d29..3f5474d20702a12e9aee60c06f359f345c6a156b 100644 (file)
@@ -170,7 +170,8 @@ nla_put_failure:
 
 static int tcf_simp_walker(struct net *net, struct sk_buff *skb,
                           struct netlink_callback *cb, int type,
-                          const struct tc_action_ops *ops)
+                          const struct tc_action_ops *ops,
+                          struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, simp_net_id);
 
index ff1970e140168dc39b8e23719ac6c5548a309e53..d99b6f1f5181415042ae7d6d6b67c572e3ff9dd8 100644 (file)
@@ -208,7 +208,8 @@ nla_put_failure:
 
 static int tcf_skbedit_walker(struct net *net, struct sk_buff *skb,
                              struct netlink_callback *cb, int type,
-                             const struct tc_action_ops *ops)
+                             const struct tc_action_ops *ops,
+                             struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, skbedit_net_id);
 
index 110d7c1f823da29d30ec6de1ed646883298d44bb..369ea85d0f02b38191c94ffaab49ec37e7fb08c5 100644 (file)
@@ -232,7 +232,8 @@ nla_put_failure:
 
 static int tcf_skbmod_walker(struct net *net, struct sk_buff *skb,
                             struct netlink_callback *cb, int type,
-                            const struct tc_action_ops *ops)
+                            const struct tc_action_ops *ops,
+                            struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, skbmod_net_id);
 
index 65a19928f1a945e037c1b5038d211063272ae6f7..bced6fd00d435792f165904fd3e9f7135be1a0b5 100644 (file)
@@ -291,7 +291,8 @@ nla_put_failure:
 
 static int tunnel_key_walker(struct net *net, struct sk_buff *skb,
                             struct netlink_callback *cb, int type,
-                            const struct tc_action_ops *ops)
+                            const struct tc_action_ops *ops,
+                            struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, tunnel_key_net_id);
 
index 03dcbbc5ffd2c5480f74cf5836d4d9752b1020fa..7cf409443d02c31f373909430d673695c3cb8a85 100644 (file)
@@ -267,7 +267,8 @@ nla_put_failure:
 
 static int tcf_vlan_walker(struct net *net, struct sk_buff *skb,
                           struct netlink_callback *cb, int type,
-                          const struct tc_action_ops *ops)
+                          const struct tc_action_ops *ops,
+                          struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, vlan_net_id);