diff options
author | Roman Mashak <mrv@mojatatu.com> | 2019-08-02 21:16:46 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-08-06 23:05:39 +0200 |
commit | b35475c5491a14c8ce7a5046ef7bcda8a860581a (patch) | |
tree | 65514b916e8211821c410283d235677a4770daa5 /net/sched | |
parent | Merge branch 'stmmac-fixes' (diff) | |
download | linux-b35475c5491a14c8ce7a5046ef7bcda8a860581a.tar.xz linux-b35475c5491a14c8ce7a5046ef7bcda8a860581a.zip |
net sched: update vlan action for batched events operations
Add get_fill_size() routine used to calculate the action size
when building a batch of events.
Fixes: c7e2b9689 ("sched: introduce vlan action")
Signed-off-by: Roman Mashak <mrv@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r-- | net/sched/act_vlan.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/sched/act_vlan.c b/net/sched/act_vlan.c index 984b05ab0c87..a3c9eea1ee8a 100644 --- a/net/sched/act_vlan.c +++ b/net/sched/act_vlan.c @@ -308,6 +308,14 @@ static int tcf_vlan_search(struct net *net, struct tc_action **a, u32 index) return tcf_idr_search(tn, a, index); } +static size_t tcf_vlan_get_fill_size(const struct tc_action *act) +{ + return nla_total_size(sizeof(struct tc_vlan)) + + nla_total_size(sizeof(u16)) /* TCA_VLAN_PUSH_VLAN_ID */ + + nla_total_size(sizeof(u16)) /* TCA_VLAN_PUSH_VLAN_PROTOCOL */ + + nla_total_size(sizeof(u8)); /* TCA_VLAN_PUSH_VLAN_PRIORITY */ +} + static struct tc_action_ops act_vlan_ops = { .kind = "vlan", .id = TCA_ID_VLAN, @@ -317,6 +325,7 @@ static struct tc_action_ops act_vlan_ops = { .init = tcf_vlan_init, .cleanup = tcf_vlan_cleanup, .walk = tcf_vlan_walker, + .get_fill_size = tcf_vlan_get_fill_size, .lookup = tcf_vlan_search, .size = sizeof(struct tcf_vlan), }; |