Re: [patch net-next v2 03/12] flow_offload: check for basic action hw stats type
From: Jiri Pirko <jiri@resnulli.us>
Date: 2020-02-29 07:40:18
From: Jiri Pirko <jiri@resnulli.us>
Date: 2020-02-29 07:40:18
Fri, Feb 28, 2020 at 08:40:56PM CET, kuba@kernel.org wrote:
On Fri, 28 Feb 2020 18:24:56 +0100 Jiri Pirko wrote:quoted
@@ -299,6 +300,9 @@ static int bnxt_tc_parse_actions(struct bnxt *bp, return -EINVAL; } + if (!flow_action_basic_hw_stats_types_check(flow_action, extack)) + return -EOPNOTSUPP;Could we have this helper take one stat type? To let drivers pass the stat type they support?
That would be always "any" as "any" is supported by all drivers. And that is exactly what the helper checks..
At some point we should come up with a way to express the limitations at callback registration time so we don't need to add checks like this to all the drivers. On the TODO list it goes :)
I was thinking about that. Not really easy with the currect infra.
quoted
flow_action_for_each(i, act, flow_action) { switch (act->id) { case FLOW_ACTION_DROP: