@@ -301,14 +301,11 @@ static int tcf_action_offload_add(struct tc_action *action,
return tcf_action_offload_add_ex(action, extack, NULL, NULL);
}
-int tcf_action_update_hw_stats(struct tc_action *action)
+static int tcf_action_set_hw_stats(struct tc_action *action)
{
struct flow_offload_action fl_act = {};
int err;
- if (!tc_act_in_hw(action))
- return -EOPNOTSUPP;
-
err = offload_action_init(&fl_act, action, FLOW_ACT_STATS, NULL);
if (err)
return err;
@@ -330,6 +327,14 @@ int tcf_action_update_hw_stats(struct tc_action *action)
return 0;
}
+
+int tcf_action_update_hw_stats(struct tc_action *action)
+{
+ if (!tc_act_in_hw(action))
+ return -EOPNOTSUPP;
+
+ return tcf_action_set_hw_stats(action);
+}
EXPORT_SYMBOL(tcf_action_update_hw_stats);
static int tcf_action_offload_del_ex(struct tc_action *action,
@@ -543,6 +548,8 @@ static int tcf_dump_walker(struct tcf_idrinfo *idrinfo, struct sk_buff *skb,
index--;
goto nla_put_failure;
}
+ tcf_action_set_hw_stats(p);
+
err = (act_flags & TCA_ACT_FLAG_TERSE_DUMP) ?
tcf_action_dump_terse(skb, p, true) :
tcf_action_dump_1(skb, p, 0, 0);
Currently action hw stats are updated during the tc filter dump sequence. HW actions are also updated during the tc action dump sequence. However, tc action dump does not update the hw stats for actions created during filter instantiation. Use the existing hw action api to update hw stats during tc action dump. Signed-off-by: Oz Shlomo <ozsh@nvidia.com> --- net/sched/act_api.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)