flow_offload: introduce "immediate" HW stats type and allow it in mlxsw
authorJiri Pirko <jiri@mellanox.com>
Sat, 7 Mar 2020 11:40:16 +0000 (12:40 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 9 Mar 2020 04:07:48 +0000 (21:07 -0700)
Introduce new type for immediate HW stats and allow the value in
mlxsw offload.

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
include/net/flow_offload.h

index 588d374531cc7314c413aff7ff728152b7c20d65..4bf3ac1cb20deaa835c6558a4901524509641282 100644 (file)
@@ -30,7 +30,8 @@ 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_type == FLOW_ACTION_HW_STATS_TYPE_ANY) {
+       if (act->hw_stats_type == FLOW_ACTION_HW_STATS_TYPE_ANY ||
+           act->hw_stats_type == FLOW_ACTION_HW_STATS_TYPE_IMMEDIATE) {
                /* Count action is inserted first */
                err = mlxsw_sp_acl_rulei_act_count(mlxsw_sp, rulei, extack);
                if (err)
index 8b40f612a5650124578a4a0dfc0be39bdbef4cae..6580c58b368f81bd17ce4db631f2db6e2e307a21 100644 (file)
@@ -155,7 +155,8 @@ enum flow_action_mangle_base {
        FLOW_ACT_MANGLE_HDR_TYPE_UDP,
 };
 
-#define FLOW_ACTION_HW_STATS_TYPE_ANY 0
+#define FLOW_ACTION_HW_STATS_TYPE_IMMEDIATE BIT(0)
+#define FLOW_ACTION_HW_STATS_TYPE_ANY FLOW_ACTION_HW_STATS_TYPE_IMMEDIATE
 
 typedef void (*action_destr)(void *priv);