提交 9c5c9c57 编写于 作者: R Roman Mashak 提交者: David S. Miller

net sched actions: implement get_fill_size routine in act_gact

Signed-off-by: NRoman Mashak <mrv@mojatatu.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 4e76e75d
...@@ -217,6 +217,19 @@ static int tcf_gact_search(struct net *net, struct tc_action **a, u32 index, ...@@ -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); 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 = { static struct tc_action_ops act_gact_ops = {
.kind = "gact", .kind = "gact",
.type = TCA_ACT_GACT, .type = TCA_ACT_GACT,
...@@ -227,6 +240,7 @@ static struct tc_action_ops act_gact_ops = { ...@@ -227,6 +240,7 @@ static struct tc_action_ops act_gact_ops = {
.init = tcf_gact_init, .init = tcf_gact_init,
.walk = tcf_gact_walker, .walk = tcf_gact_walker,
.lookup = tcf_gact_search, .lookup = tcf_gact_search,
.get_fill_size = tcf_gact_get_fill_size,
.size = sizeof(struct tcf_gact), .size = sizeof(struct tcf_gact),
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册