[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220816092338.12613-4-ozsh@nvidia.com>
Date: Tue, 16 Aug 2022 12:23:38 +0300
From: Oz Shlomo <ozsh@...dia.com>
To: <netdev@...r.kernel.org>
CC: Jiri Pirko <jiri@...dia.com>, Jamal Hadi Salim <jhs@...atatu.com>,
"Simon Horman" <simon.horman@...igine.com>,
Baowen Zheng <baowen.zheng@...igine.com>,
Vlad Buslov <vladbu@...dia.com>,
Ido Schimmel <idosch@...dia.com>, Roi Dayan <roid@...dia.com>,
Oz Shlomo <ozsh@...dia.com>
Subject: [ RFC net-next 3/3] net/sched: act_api: update hw stats for tc action list
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@...dia.com>
---
net/sched/act_api.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 817065aa2833..5d7b6e438085 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -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);
--
1.8.3.1
Powered by blists - more mailing lists