summaryrefslogtreecommitdiff
path: root/net/sched/act_gact.c
diff options
context:
space:
mode:
authorRoman Mashak <mrv@mojatatu.com>2018-03-08 16:59:20 -0500
committerDavid S. Miller <davem@davemloft.net>2018-03-09 11:25:12 -0500
commit9c5c9c573700a0a4a4afa431da3e7d21f2992627 (patch)
tree16d9d4201c14a4b1ecab57f22eaa653272b3852b /net/sched/act_gact.c
parent4e76e75d6aba83f35d55b50f66a6768af1657563 (diff)
net sched actions: implement get_fill_size routine in act_gact
Signed-off-by: Roman Mashak <mrv@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/act_gact.c')
-rw-r--r--net/sched/act_gact.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/net/sched/act_gact.c b/net/sched/act_gact.c
index 74563254e676..88fbb8403565 100644
--- a/net/sched/act_gact.c
+++ b/net/sched/act_gact.c
@@ -217,6 +217,19 @@ static int tcf_gact_search(struct net *net, struct tc_action **a, u32 index,
return tcf_idr_search(tn, a, index);
}
+static size_t tcf_gact_get_fill_size(const struct tc_action *act)
+{
+ size_t sz = nla_total_size(sizeof(struct tc_gact)); /* TCA_GACT_PARMS */
+
+#ifdef CONFIG_GACT_PROB
+ if (to_gact(act)->tcfg_ptype)
+ /* TCA_GACT_PROB */
+ sz += nla_total_size(sizeof(struct tc_gact_p));
+#endif
+
+ return sz;
+}
+
static struct tc_action_ops act_gact_ops = {
.kind = "gact",
.type = TCA_ACT_GACT,
@@ -227,6 +240,7 @@ static struct tc_action_ops act_gact_ops = {
.init = tcf_gact_init,
.walk = tcf_gact_walker,
.lookup = tcf_gact_search,
+ .get_fill_size = tcf_gact_get_fill_size,
.size = sizeof(struct tcf_gact),
};