]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
net: sched: act: add extack for lookup callback
authorAlexander Aring <aring@mojatatu.com>
Thu, 15 Feb 2018 15:54:57 +0000 (10:54 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Feb 2018 21:05:03 +0000 (16:05 -0500)
This patch adds extack support for act lookup 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 3717e0f2bb1b7529afeca810dcaa8bc3575fa283..0bd65db506bae2b772eaa3176d31bf4a2b65fb21 100644 (file)
@@ -87,7 +87,8 @@ struct tc_action_ops {
                       struct tcf_result *);
        int     (*dump)(struct sk_buff *, struct tc_action *, int, int);
        void    (*cleanup)(struct tc_action *);
-       int     (*lookup)(struct net *net, struct tc_action **a, u32 index);
+       int     (*lookup)(struct net *net, struct tc_action **a, u32 index,
+                         struct netlink_ext_ack *extack);
        int     (*init)(struct net *net, struct nlattr *nla,
                        struct nlattr *est, struct tc_action **act, int ovr,
                        int bind, struct netlink_ext_ack *extack);
index 576a0c311e5ee68aa90d483964c9e1a382a451af..74ed1e288e57fff719f0c3ad705376bb53831d4e 100644 (file)
@@ -901,7 +901,7 @@ static struct tc_action *tcf_action_get_1(struct net *net, struct nlattr *nla,
                goto err_out;
        }
        err = -ENOENT;
-       if (ops->lookup(net, &a, index) == 0)
+       if (ops->lookup(net, &a, index, extack) == 0)
                goto err_mod;
 
        module_put(ops->owner);
index b3ebfa9598e2d82906968ce21959ee27aaa138ce..d9654b86334797e63cbfb1cf30e416ee1572762b 100644 (file)
@@ -374,7 +374,8 @@ static int tcf_bpf_walker(struct net *net, struct sk_buff *skb,
        return tcf_generic_walker(tn, skb, cb, type, ops);
 }
 
-static int tcf_bpf_search(struct net *net, struct tc_action **a, u32 index)
+static int tcf_bpf_search(struct net *net, struct tc_action **a, u32 index,
+                         struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, bpf_net_id);
 
index 20e0215360b50bf945d10c12e93ba93e15dfd19b..0504b7600fb6bd9fccf705a86ef6eeb81e9b339a 100644 (file)
@@ -184,7 +184,8 @@ static int tcf_connmark_walker(struct net *net, struct sk_buff *skb,
        return tcf_generic_walker(tn, skb, cb, type, ops);
 }
 
-static int tcf_connmark_search(struct net *net, struct tc_action **a, u32 index)
+static int tcf_connmark_search(struct net *net, struct tc_action **a, u32 index,
+                              struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, connmark_net_id);
 
index 3b8c48bb2683b941262d71591f4a11da1e8cb9b8..bdd17b9ef0342d8f9dd9874efbaad5d7639da9c2 100644 (file)
@@ -638,7 +638,8 @@ static int tcf_csum_walker(struct net *net, struct sk_buff *skb,
        return tcf_generic_walker(tn, skb, cb, type, ops);
 }
 
-static int tcf_csum_search(struct net *net, struct tc_action **a, u32 index)
+static int tcf_csum_search(struct net *net, struct tc_action **a, u32 index,
+                          struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, csum_net_id);
 
index 912f3398f1c1a2ce8acd981e60996ce25913b060..e1e69e38f4b0090f4502b2cb7437fbd127333c05 100644 (file)
@@ -208,7 +208,8 @@ static int tcf_gact_walker(struct net *net, struct sk_buff *skb,
        return tcf_generic_walker(tn, skb, cb, type, ops);
 }
 
-static int tcf_gact_search(struct net *net, struct tc_action **a, u32 index)
+static int tcf_gact_search(struct net *net, struct tc_action **a, u32 index,
+                          struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, gact_net_id);
 
index e5127d40073712c5ea055998b08bbdf98546876e..0b70fb0cc609605a17323c1b971525718e647e5d 100644 (file)
@@ -831,7 +831,8 @@ static int tcf_ife_walker(struct net *net, struct sk_buff *skb,
        return tcf_generic_walker(tn, skb, cb, type, ops);
 }
 
-static int tcf_ife_search(struct net *net, struct tc_action **a, u32 index)
+static int tcf_ife_search(struct net *net, struct tc_action **a, u32 index,
+                         struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, ife_net_id);
 
index 6894cfa83863823f5ce33144db34f385e55de46f..f29af79a2d1f944f669faa7e2231a2fd9d2cb8a9 100644 (file)
@@ -310,7 +310,8 @@ static int tcf_ipt_walker(struct net *net, struct sk_buff *skb,
        return tcf_generic_walker(tn, skb, cb, type, ops);
 }
 
-static int tcf_ipt_search(struct net *net, struct tc_action **a, u32 index)
+static int tcf_ipt_search(struct net *net, struct tc_action **a, u32 index,
+                         struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, ipt_net_id);
 
@@ -358,7 +359,8 @@ static int tcf_xt_walker(struct net *net, struct sk_buff *skb,
        return tcf_generic_walker(tn, skb, cb, type, ops);
 }
 
-static int tcf_xt_search(struct net *net, struct tc_action **a, u32 index)
+static int tcf_xt_search(struct net *net, struct tc_action **a, u32 index,
+                        struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, xt_net_id);
 
index 7ccd4c71179f0c8853be99d1856a6a92942e43ec..9980c6affb5e29d3d8d43677fd8728443a98c249 100644 (file)
@@ -272,7 +272,8 @@ static int tcf_mirred_walker(struct net *net, struct sk_buff *skb,
        return tcf_generic_walker(tn, skb, cb, type, ops);
 }
 
-static int tcf_mirred_search(struct net *net, struct tc_action **a, u32 index)
+static int tcf_mirred_search(struct net *net, struct tc_action **a, u32 index,
+                            struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, mirred_net_id);
 
index 7e5ebd7f52a62ad3f42bd9435a8697f05bb75017..6f6d7667ef9a8b8e8728e4b7839125edb5425a7c 100644 (file)
@@ -285,7 +285,8 @@ static int tcf_nat_walker(struct net *net, struct sk_buff *skb,
        return tcf_generic_walker(tn, skb, cb, type, ops);
 }
 
-static int tcf_nat_search(struct net *net, struct tc_action **a, u32 index)
+static int tcf_nat_search(struct net *net, struct tc_action **a, u32 index,
+                         struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, nat_net_id);
 
index bb2c35ed6f100c9663d8388cd9446e76708a862e..308b2680a6d9ad7d6fa81dcf884d2c3889b6cd24 100644 (file)
@@ -426,7 +426,8 @@ static int tcf_pedit_walker(struct net *net, struct sk_buff *skb,
        return tcf_generic_walker(tn, skb, cb, type, ops);
 }
 
-static int tcf_pedit_search(struct net *net, struct tc_action **a, u32 index)
+static int tcf_pedit_search(struct net *net, struct tc_action **a, u32 index,
+                           struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, pedit_net_id);
 
index 6b6facbe251beeca73fefd586e1642b502582d32..1292f880eab001f84bf8c0611d03dbb37af11cea 100644 (file)
@@ -305,7 +305,8 @@ nla_put_failure:
        return -1;
 }
 
-static int tcf_police_search(struct net *net, struct tc_action **a, u32 index)
+static int tcf_police_search(struct net *net, struct tc_action **a, u32 index,
+                            struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, police_net_id);
 
index f4579ceba1f64e3873ed242db0f38959d0ee5031..22379b2cfd1a0dc079281a69ab0e37a0b0d5e673 100644 (file)
@@ -209,7 +209,8 @@ static int tcf_sample_walker(struct net *net, struct sk_buff *skb,
        return tcf_generic_walker(tn, skb, cb, type, ops);
 }
 
-static int tcf_sample_search(struct net *net, struct tc_action **a, u32 index)
+static int tcf_sample_search(struct net *net, struct tc_action **a, u32 index,
+                            struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, sample_net_id);
 
index b0346347c5f078ec353c74744ce697fd55b6f12f..3ebf714709774b908c996ecb44c43e8fdb5e1d29 100644 (file)
@@ -177,7 +177,8 @@ static int tcf_simp_walker(struct net *net, struct sk_buff *skb,
        return tcf_generic_walker(tn, skb, cb, type, ops);
 }
 
-static int tcf_simp_search(struct net *net, struct tc_action **a, u32 index)
+static int tcf_simp_search(struct net *net, struct tc_action **a, u32 index,
+                          struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, simp_net_id);
 
index 7651c9d2182da294b95439fc030065aaf1635742..ff1970e140168dc39b8e23719ac6c5548a309e53 100644 (file)
@@ -215,7 +215,8 @@ static int tcf_skbedit_walker(struct net *net, struct sk_buff *skb,
        return tcf_generic_walker(tn, skb, cb, type, ops);
 }
 
-static int tcf_skbedit_search(struct net *net, struct tc_action **a, u32 index)
+static int tcf_skbedit_search(struct net *net, struct tc_action **a, u32 index,
+                             struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, skbedit_net_id);
 
index 1266449aa8ea42f2aa289d470f4601a2af257cf3..110d7c1f823da29d30ec6de1ed646883298d44bb 100644 (file)
@@ -239,7 +239,8 @@ static int tcf_skbmod_walker(struct net *net, struct sk_buff *skb,
        return tcf_generic_walker(tn, skb, cb, type, ops);
 }
 
-static int tcf_skbmod_search(struct net *net, struct tc_action **a, u32 index)
+static int tcf_skbmod_search(struct net *net, struct tc_action **a, u32 index,
+                            struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, skbmod_net_id);
 
index dde01eca7ed05a24c24d1f6f4caab2a07eec4ac1..65a19928f1a945e037c1b5038d211063272ae6f7 100644 (file)
@@ -298,7 +298,8 @@ static int tunnel_key_walker(struct net *net, struct sk_buff *skb,
        return tcf_generic_walker(tn, skb, cb, type, ops);
 }
 
-static int tunnel_key_search(struct net *net, struct tc_action **a, u32 index)
+static int tunnel_key_search(struct net *net, struct tc_action **a, u32 index,
+                            struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, tunnel_key_net_id);
 
index 6c387310b1b69e1b72f9f21fc89a3f212678fdde..03dcbbc5ffd2c5480f74cf5836d4d9752b1020fa 100644 (file)
@@ -274,7 +274,8 @@ static int tcf_vlan_walker(struct net *net, struct sk_buff *skb,
        return tcf_generic_walker(tn, skb, cb, type, ops);
 }
 
-static int tcf_vlan_search(struct net *net, struct tc_action **a, u32 index)
+static int tcf_vlan_search(struct net *net, struct tc_action **a, u32 index,
+                          struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, vlan_net_id);