flow_offload: introduce "delayed" HW stats type and allow it in mlx5
authorJiri Pirko <jiri@mellanox.com>
Sat, 7 Mar 2020 11:40:17 +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 delayed HW stats and allow the value in
mlx5 offload.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
include/net/flow_offload.h

index cfe393cb4026e9b2568dda72df3a49b164632d73..cdc63dd598673c0f827d25dad4dca402e9b14c4b 100644 (file)
@@ -2878,7 +2878,8 @@ static int parse_tc_nic_actions(struct mlx5e_priv *priv,
        if (!flow_action_has_entries(flow_action))
                return -EINVAL;
 
-       if (!flow_action_basic_hw_stats_types_check(flow_action, extack))
+       if (!flow_action_hw_stats_types_check(flow_action, extack,
+                                             FLOW_ACTION_HW_STATS_TYPE_DELAYED))
                return -EOPNOTSUPP;
 
        attr->flow_tag = MLX5_FS_DEFAULT_FLOW_TAG;
@@ -3333,7 +3334,8 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv,
        if (!flow_action_has_entries(flow_action))
                return -EINVAL;
 
-       if (!flow_action_basic_hw_stats_types_check(flow_action, extack))
+       if (!flow_action_hw_stats_types_check(flow_action, extack,
+                                             FLOW_ACTION_HW_STATS_TYPE_DELAYED))
                return -EOPNOTSUPP;
 
        flow_action_for_each(i, act, flow_action) {
index 6580c58b368f81bd17ce4db631f2db6e2e307a21..1b6500f0fbca9d51b575cc72d400b17049186dc7 100644 (file)
@@ -156,7 +156,9 @@ enum flow_action_mangle_base {
 };
 
 #define FLOW_ACTION_HW_STATS_TYPE_IMMEDIATE BIT(0)
-#define FLOW_ACTION_HW_STATS_TYPE_ANY FLOW_ACTION_HW_STATS_TYPE_IMMEDIATE
+#define FLOW_ACTION_HW_STATS_TYPE_DELAYED BIT(1)
+#define FLOW_ACTION_HW_STATS_TYPE_ANY (FLOW_ACTION_HW_STATS_TYPE_IMMEDIATE | \
+                                      FLOW_ACTION_HW_STATS_TYPE_DELAYED)
 
 typedef void (*action_destr)(void *priv);