mlxsw: spectrum: Add Spectrum-2 variant of flex actions ops
authorJiri Pirko <jiri@mellanox.com>
Wed, 18 Jul 2018 08:14:33 +0000 (11:14 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Jul 2018 17:13:13 +0000 (02:13 +0900)
In Spectrum-2, no action set is stored directly in TCAM, all are located
in KVD linear. So ask core to treat the first set as dummy empty one,
to be just used for PTCEV2 purposes.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c

index 407b3315e210cd70fe18ac17fd4131f40e89f824..b09f339329b6980ba52c0597066cf7010d59b1e0 100644 (file)
@@ -646,6 +646,7 @@ extern const struct mlxsw_sp_acl_tcam_ops mlxsw_sp1_acl_tcam_ops;
 
 /* spectrum_acl_flex_actions.c */
 extern const struct mlxsw_afa_ops mlxsw_sp1_act_afa_ops;
+extern const struct mlxsw_afa_ops mlxsw_sp2_act_afa_ops;
 
 /* spectrum_acl_flex_keys.c */
 extern const struct mlxsw_afk_ops mlxsw_sp1_afk_ops;
index 6a7c3406b72494913bfd5ee8e84dc6c3ce134258..7649570f3b76663dad3d8d0b87f1cfea76924df0 100644 (file)
@@ -168,6 +168,18 @@ const struct mlxsw_afa_ops mlxsw_sp1_act_afa_ops = {
        .mirror_del             = mlxsw_sp_act_mirror_del,
 };
 
+const struct mlxsw_afa_ops mlxsw_sp2_act_afa_ops = {
+       .kvdl_set_add           = mlxsw_sp_act_kvdl_set_add,
+       .kvdl_set_del           = mlxsw_sp_act_kvdl_set_del,
+       .kvdl_fwd_entry_add     = mlxsw_sp_act_kvdl_fwd_entry_add,
+       .kvdl_fwd_entry_del     = mlxsw_sp_act_kvdl_fwd_entry_del,
+       .counter_index_get      = mlxsw_sp_act_counter_index_get,
+       .counter_index_put      = mlxsw_sp_act_counter_index_put,
+       .mirror_add             = mlxsw_sp_act_mirror_add,
+       .mirror_del             = mlxsw_sp_act_mirror_del,
+       .dummy_first_set        = true,
+};
+
 int mlxsw_sp_afa_init(struct mlxsw_sp *mlxsw_sp)
 {
        mlxsw_sp->afa = mlxsw_afa_create(MLXSW_CORE_RES_GET(mlxsw_sp->core,