net: flow_offload: simplify hw stats check handling
[linux-2.6-microblaze.git] / drivers / net / ethernet / mellanox / mlxsw / spectrum_flower.c
index b286fe1..51e1b39 100644 (file)
@@ -30,14 +30,14 @@ static int mlxsw_sp_flower_parse_actions(struct mlxsw_sp *mlxsw_sp,
                return -EOPNOTSUPP;
 
        act = flow_action_first_entry_get(flow_action);
-       if (act->hw_stats == FLOW_ACTION_HW_STATS_ANY ||
-           act->hw_stats == FLOW_ACTION_HW_STATS_IMMEDIATE) {
+       if (act->hw_stats & FLOW_ACTION_HW_STATS_DISABLED) {
+               /* Nothing to do */
+       } else if (act->hw_stats & FLOW_ACTION_HW_STATS_IMMEDIATE) {
                /* Count action is inserted first */
                err = mlxsw_sp_acl_rulei_act_count(mlxsw_sp, rulei, extack);
                if (err)
                        return err;
-       } else if (act->hw_stats != FLOW_ACTION_HW_STATS_DISABLED &&
-                  act->hw_stats != FLOW_ACTION_HW_STATS_DONT_CARE) {
+       } else {
                NL_SET_ERR_MSG_MOD(extack, "Unsupported action HW stats type");
                return -EOPNOTSUPP;
        }