提交 8f2ca70c 编写于 作者: O Oz Shlomo 提交者: Paolo Abeni

net/sched: optimize action stats api calls

Currently the hw action stats update is called from tcf_exts_hw_stats_update,
when a tc filter is dumped, and from tcf_action_copy_stats, when a hw
action is dumped.
However, the tcf_action_copy_stats is also called from tcf_action_dump.
As such, the hw action stats update cb is called 3 times for every
tc flower filter dump.

Move the tc action hw stats update from tcf_action_copy_stats to
tcf_dump_walker to update the hw action stats when tc action is dumped.
Signed-off-by: NOz Shlomo <ozsh@nvidia.com>
Reviewed-by: NSimon Horman <simon.horman@corigine.com>
Reviewed-by: NMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Acked-by: NJamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
上级 a71fad0f
...@@ -539,6 +539,8 @@ static int tcf_dump_walker(struct tcf_idrinfo *idrinfo, struct sk_buff *skb, ...@@ -539,6 +539,8 @@ static int tcf_dump_walker(struct tcf_idrinfo *idrinfo, struct sk_buff *skb,
(unsigned long)p->tcfa_tm.lastuse)) (unsigned long)p->tcfa_tm.lastuse))
continue; continue;
tcf_action_update_hw_stats(p);
nest = nla_nest_start_noflag(skb, n_i); nest = nla_nest_start_noflag(skb, n_i);
if (!nest) { if (!nest) {
index--; index--;
...@@ -1539,9 +1541,6 @@ int tcf_action_copy_stats(struct sk_buff *skb, struct tc_action *p, ...@@ -1539,9 +1541,6 @@ int tcf_action_copy_stats(struct sk_buff *skb, struct tc_action *p,
if (p == NULL) if (p == NULL)
goto errout; goto errout;
/* update hw stats for this action */
tcf_action_update_hw_stats(p);
/* compat_mode being true specifies a call that is supposed /* compat_mode being true specifies a call that is supposed
* to add additional backward compatibility statistic TLVs. * to add additional backward compatibility statistic TLVs.
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册