Commit ce4995bc authored by Danielle Ratson's avatar Danielle Ratson Committed by David S. Miller
Browse files

mlxsw: spectrum: Allow driver to load with old firmware versions



The driver fails to load with old firmware versions that cannot report
the maximum number of RIF MAC profiles [1].

Fix this by defaulting to a maximum of a single profile in such
situations, as multiple profiles are not supported by old firmware
versions.

[1]
mlxsw_spectrum 0000:03:00.0: cannot register bus device
mlxsw_spectrum: probe of 0000:03:00.0 failed with error -5

Fixes: 1c375ffb ("mlxsw: spectrum_router: Expose RIF MAC profiles to devlink resource")
Signed-off-by: default avatarDanielle Ratson <danieller@nvidia.com>
Reported-by: default avatarVadim Pasternak <vadimp@nvidia.com>
Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5789d04b
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -3290,8 +3290,8 @@ mlxsw_sp_resources_rif_mac_profile_register(struct mlxsw_core *mlxsw_core)
	u8 max_rif_mac_profiles;

	if (!MLXSW_CORE_RES_VALID(mlxsw_core, MAX_RIF_MAC_PROFILES))
		return -EIO;

		max_rif_mac_profiles = 1;
	else
		max_rif_mac_profiles = MLXSW_CORE_RES_GET(mlxsw_core,
							  MAX_RIF_MAC_PROFILES);
	devlink_resource_size_params_init(&size_params, max_rif_mac_profiles,