Skip to content

Commit dffd566

Browse files
Jiri Pirkokuba-moo
authored andcommitted
mlxsw: spectrum: Set KVH XLT cache mode for Spectrum2/3
Set a profile option to instruct FW to use 1/2 of KVH for XLT cache, not the whole one. Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: Ido Schimmel <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 2dfad87 commit dffd566

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

drivers/net/ethernet/mellanox/mlxsw/cmd.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,12 @@ MLXSW_ITEM32(cmd_mbox, config_profile, set_kvd_hash_double_size, 0x0C, 26, 1);
674674
*/
675675
MLXSW_ITEM32(cmd_mbox, config_profile, set_cqe_version, 0x08, 0, 1);
676676

677+
/* cmd_mbox_config_set_kvh_xlt_cache_mode
678+
* Capability bit. Setting a bit to 1 configures the profile
679+
* according to the mailbox contents.
680+
*/
681+
MLXSW_ITEM32(cmd_mbox, config_profile, set_kvh_xlt_cache_mode, 0x08, 3, 1);
682+
677683
/* cmd_mbox_config_profile_max_vepa_channels
678684
* Maximum number of VEPA channels per port (0 through 16)
679685
* 0 - multi-channel VEPA is disabled
@@ -800,6 +806,13 @@ MLXSW_ITEM32(cmd_mbox, config_profile, adaptive_routing_group_cap, 0x4C, 0, 16);
800806
*/
801807
MLXSW_ITEM32(cmd_mbox, config_profile, arn, 0x50, 31, 1);
802808

809+
/* cmd_mbox_config_profile_kvh_xlt_cache_mode
810+
* KVH XLT cache mode:
811+
* 0 - XLT can use all KVH as best-effort
812+
* 1 - XLT cache uses 1/2 KVH
813+
*/
814+
MLXSW_ITEM32(cmd_mbox, config_profile, kvh_xlt_cache_mode, 0x50, 8, 4);
815+
803816
/* cmd_mbox_config_kvd_linear_size
804817
* KVD Linear Size
805818
* Valid for Spectrum only

drivers/net/ethernet/mellanox/mlxsw/core.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ struct mlxsw_config_profile {
256256
used_max_pkey:1,
257257
used_ar_sec:1,
258258
used_adaptive_routing_group_cap:1,
259-
used_kvd_sizes:1;
259+
used_kvd_sizes:1,
260+
used_kvh_xlt_cache_mode:1;
260261
u8 max_vepa_channels;
261262
u16 max_mid;
262263
u16 max_pgt;
@@ -278,6 +279,7 @@ struct mlxsw_config_profile {
278279
u32 kvd_linear_size;
279280
u8 kvd_hash_single_parts;
280281
u8 kvd_hash_double_parts;
282+
u8 kvh_xlt_cache_mode;
281283
struct mlxsw_swid_config swid_config[MLXSW_CONFIG_PROFILE_SWID_COUNT];
282284
};
283285

drivers/net/ethernet/mellanox/mlxsw/pci.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,6 +1196,12 @@ static int mlxsw_pci_config_profile(struct mlxsw_pci *mlxsw_pci, char *mbox,
11961196
mlxsw_cmd_mbox_config_profile_kvd_hash_double_size_set(mbox,
11971197
MLXSW_RES_GET(res, KVD_DOUBLE_SIZE));
11981198
}
1199+
if (profile->used_kvh_xlt_cache_mode) {
1200+
mlxsw_cmd_mbox_config_profile_set_kvh_xlt_cache_mode_set(
1201+
mbox, 1);
1202+
mlxsw_cmd_mbox_config_profile_kvh_xlt_cache_mode_set(
1203+
mbox, profile->kvh_xlt_cache_mode);
1204+
}
11991205

12001206
for (i = 0; i < MLXSW_CONFIG_PROFILE_SWID_COUNT; i++)
12011207
mlxsw_pci_config_profile_swid_config(mlxsw_pci, mbox, i,

drivers/net/ethernet/mellanox/mlxsw/spectrum.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2936,6 +2936,8 @@ static const struct mlxsw_config_profile mlxsw_sp2_config_profile = {
29362936
.max_ib_mc = 0,
29372937
.used_max_pkey = 1,
29382938
.max_pkey = 0,
2939+
.used_kvh_xlt_cache_mode = 1,
2940+
.kvh_xlt_cache_mode = 1,
29392941
.swid_config = {
29402942
{
29412943
.used_type = 1,

0 commit comments

Comments
 (0)