mlxsw: spectrum_flower: Do not allow mixing HW stats types for actions
authorJiri Pirko <jiri@mellanox.com>
Sat, 7 Mar 2020 11:40:14 +0000 (12:40 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 9 Mar 2020 04:07:48 +0000 (21:07 -0700)
As there is one set of counters for the whole action chain, forbid to
mix the HW stats types.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c

index 0011a71114e31b2b8e43dadec4e21857c1813083..7435629c9e65943600e16afb49b760eff69a7a5e 100644 (file)
@@ -26,6 +26,8 @@ static int mlxsw_sp_flower_parse_actions(struct mlxsw_sp *mlxsw_sp,
 
        if (!flow_action_has_entries(flow_action))
                return 0;
+       if (!flow_action_mixed_hw_stats_types_check(flow_action, extack))
+               return -EOPNOTSUPP;
 
        /* Count action is inserted first */
        err = mlxsw_sp_acl_rulei_act_count(mlxsw_sp, rulei, extack);