net/mlx5: E-Switch, Allow goto earlier chain if FW supports it
authorRoi Dayan <roid@mellanox.com>
Thu, 6 Feb 2020 14:06:58 +0000 (16:06 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 28 Feb 2020 00:40:08 +0000 (16:40 -0800)
Mellanox FW can support this if ignore_flow_level capability exists.

Signed-off-by: Roi Dayan <roid@mellanox.com>
Reviewed-by: Oz Shlomo <ozsh@mellanox.com>
Reviewed-by: Paul Blakey <paulb@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_chains.c
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_chains.h

index 290cdf32bc5e73c10d77b46e253de29a5258c871..3be654ce83e5534f57e6ac50625e2c3bd1300f60 100644 (file)
@@ -3533,7 +3533,8 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv,
                                NL_SET_ERR_MSG_MOD(extack, "Goto action is not supported");
                                return -EOPNOTSUPP;
                        }
-                       if (dest_chain <= attr->chain) {
+                       if (!mlx5_esw_chains_backwards_supported(esw) &&
+                           dest_chain <= attr->chain) {
                                NL_SET_ERR_MSG(extack, "Goto earlier chain isn't supported");
                                return -EOPNOTSUPP;
                        }
index 883c9e6ff0b2323dc179b5d2bff8d286d1c210a9..60121f2ee6c54ea5d2dba6bf5b4e5bbba2510e0d 100644 (file)
@@ -97,6 +97,11 @@ bool mlx5_esw_chains_prios_supported(struct mlx5_eswitch *esw)
        return esw->fdb_table.flags & ESW_FDB_CHAINS_AND_PRIOS_SUPPORTED;
 }
 
+bool mlx5_esw_chains_backwards_supported(struct mlx5_eswitch *esw)
+{
+       return fdb_ignore_flow_level_supported(esw);
+}
+
 u32 mlx5_esw_chains_get_chain_range(struct mlx5_eswitch *esw)
 {
        if (!mlx5_esw_chains_prios_supported(esw))
index 2e13097fe3487e310329724bdb6116ba2032f6aa..4ae2baf2a7a17b6fa95a0328ce77d44963435064 100644 (file)
@@ -6,6 +6,8 @@
 
 bool
 mlx5_esw_chains_prios_supported(struct mlx5_eswitch *esw);
+bool
+mlx5_esw_chains_backwards_supported(struct mlx5_eswitch *esw);
 u32
 mlx5_esw_chains_get_prio_range(struct mlx5_eswitch *esw);
 u32