Skip to content

Commit 9aad19a

Browse files
pmachatakuba-moo
authored andcommitted
mlxsw: pci: Permit enabling CFF mode
There are FW versions out there that do not support CFF flood mode, and on Spectrum-1 in particular, there is no plan to support it at all. mlxsw will therefore have to support both controlled flood mode as well as CFF. There are also FW versions out there that claim to support CFF flood mode, but then reject or ignore configurations enabling the same. The driver thus has to have a say in whether an attempt to configure CFF flood mode should even be made, and what to use as a fallback. Hence express the feature in terms of "does the driver prefer CFF flood mode?", and "what flood mode the PCI module managed to configure the FW with". This gives to the driver a chance to determine whether CFF flood mode configuration should be attempted. The latter bit was added in previous patches. In this patch, add the bit that allows the driver to determine whether CFF enablement should be attempted, and the enablement code itself. Signed-off-by: Petr Machata <petrm@nvidia.com> Reviewed-by: Amit Cohen <amcohen@nvidia.com> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Link: https://lore.kernel.org/r/41640a0ee58e0a9538f820f7b601a0e35f6449e4.1700503644.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 0959159 commit 9aad19a

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,12 @@ struct mlxsw_config_profile {
324324
u16 max_regions;
325325
u8 max_flood_tables;
326326
u8 max_vid_flood_tables;
327+
328+
/* Flood mode to use if used_flood_mode. If flood_mode_prefer_cff,
329+
* the backup flood mode (if any) when CFF unsupported.
330+
*/
327331
u8 flood_mode;
332+
328333
u8 max_fid_offset_flood_tables;
329334
u16 fid_offset_flood_table_size;
330335
u8 max_fid_flood_tables;
@@ -340,6 +345,7 @@ struct mlxsw_config_profile {
340345
u8 kvd_hash_double_parts;
341346
u8 cqe_time_stamp_type;
342347
bool lag_mode_prefer_sw;
348+
bool flood_mode_prefer_cff;
343349
struct mlxsw_swid_config swid_config[MLXSW_CONFIG_PROFILE_SWID_COUNT];
344350
};
345351

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1248,7 +1248,14 @@ static int mlxsw_pci_config_profile(struct mlxsw_pci *mlxsw_pci, char *mbox,
12481248
mlxsw_cmd_mbox_config_profile_fid_flood_table_size_set(
12491249
mbox, profile->fid_flood_table_size);
12501250
}
1251-
if (profile->used_flood_mode) {
1251+
if (profile->flood_mode_prefer_cff && mlxsw_pci->cff_support) {
1252+
enum mlxsw_cmd_mbox_config_profile_flood_mode flood_mode =
1253+
MLXSW_CMD_MBOX_CONFIG_PROFILE_FLOOD_MODE_CFF;
1254+
1255+
mlxsw_cmd_mbox_config_profile_set_flood_mode_set(mbox, 1);
1256+
mlxsw_cmd_mbox_config_profile_flood_mode_set(mbox, flood_mode);
1257+
mlxsw_pci->flood_mode = flood_mode;
1258+
} else if (profile->used_flood_mode) {
12521259
mlxsw_cmd_mbox_config_profile_set_flood_mode_set(
12531260
mbox, 1);
12541261
mlxsw_cmd_mbox_config_profile_flood_mode_set(

0 commit comments

Comments
 (0)