netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net/mlxfw: Drop hard coded max FW flash image size
@ 2025-01-16 12:33 Moshe Shemesh
  2025-01-16 14:40 ` Ido Schimmel
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Moshe Shemesh @ 2025-01-16 12:33 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, netdev
  Cc: Ido Schimmel, Saeed Mahameed, Tariq Toukan, Mark Bloch,
	Moshe Shemesh, Maher Sanalla

From: Maher Sanalla <msanalla@nvidia.com>

Currently, mlxfw kernel module limits FW flash image size to be
10MB at most, preventing the ability to burn recent BlueField-3
FW that exceeds the said size limit.

Thus, drop the hard coded limit. Instead, rely on FW's
max_component_size threshold that is reported in MCQI register
as the size limit for FW image.

Fixes: 410ed13cae39 ("Add the mlxfw module for Mellanox firmware flash process")
Cc: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Maher Sanalla <msanalla@nvidia.com>
Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c b/drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c
index 46245e0b2462..43c84900369a 100644
--- a/drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c
+++ b/drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c
@@ -14,7 +14,6 @@
 #define MLXFW_FSM_STATE_WAIT_TIMEOUT_MS 30000
 #define MLXFW_FSM_STATE_WAIT_ROUNDS \
 	(MLXFW_FSM_STATE_WAIT_TIMEOUT_MS / MLXFW_FSM_STATE_WAIT_CYCLE_MS)
-#define MLXFW_FSM_MAX_COMPONENT_SIZE (10 * (1 << 20))
 
 static const int mlxfw_fsm_state_errno[] = {
 	[MLXFW_FSM_STATE_ERR_ERROR] = -EIO,
@@ -229,7 +228,6 @@ static int mlxfw_flash_component(struct mlxfw_dev *mlxfw_dev,
 		return err;
 	}
 
-	comp_max_size = min_t(u32, comp_max_size, MLXFW_FSM_MAX_COMPONENT_SIZE);
 	if (comp->data_size > comp_max_size) {
 		MLXFW_ERR_MSG(mlxfw_dev, extack,
 			      "Component size is bigger than limit", -EINVAL);
-- 
2.18.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net/mlxfw: Drop hard coded max FW flash image size
  2025-01-16 12:33 [PATCH net] net/mlxfw: Drop hard coded max FW flash image size Moshe Shemesh
@ 2025-01-16 14:40 ` Ido Schimmel
  2025-01-16 15:00 ` Michal Swiatkowski
  2025-01-18  3:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Ido Schimmel @ 2025-01-16 14:40 UTC (permalink / raw)
  To: Moshe Shemesh
  Cc: David S. Miller, Jakub Kicinski, netdev, Saeed Mahameed,
	Tariq Toukan, Mark Bloch, Maher Sanalla

On Thu, Jan 16, 2025 at 02:33:16PM +0200, Moshe Shemesh wrote:
> From: Maher Sanalla <msanalla@nvidia.com>
> 
> Currently, mlxfw kernel module limits FW flash image size to be
> 10MB at most, preventing the ability to burn recent BlueField-3
> FW that exceeds the said size limit.
> 
> Thus, drop the hard coded limit. Instead, rely on FW's
> max_component_size threshold that is reported in MCQI register
> as the size limit for FW image.
> 
> Fixes: 410ed13cae39 ("Add the mlxfw module for Mellanox firmware flash process")
> Cc: Ido Schimmel <idosch@nvidia.com>
> Signed-off-by: Maher Sanalla <msanalla@nvidia.com>
> Signed-off-by: Moshe Shemesh <moshe@nvidia.com>

Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Tested-by: Ido Schimmel <idosch@nvidia.com>

Tested on Spectrum-{1,2,3,4}.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net/mlxfw: Drop hard coded max FW flash image size
  2025-01-16 12:33 [PATCH net] net/mlxfw: Drop hard coded max FW flash image size Moshe Shemesh
  2025-01-16 14:40 ` Ido Schimmel
@ 2025-01-16 15:00 ` Michal Swiatkowski
  2025-01-18  3:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Michal Swiatkowski @ 2025-01-16 15:00 UTC (permalink / raw)
  To: Moshe Shemesh
  Cc: David S. Miller, Jakub Kicinski, netdev, Ido Schimmel,
	Saeed Mahameed, Tariq Toukan, Mark Bloch, Maher Sanalla

On Thu, Jan 16, 2025 at 02:33:16PM +0200, Moshe Shemesh wrote:
> From: Maher Sanalla <msanalla@nvidia.com>
> 
> Currently, mlxfw kernel module limits FW flash image size to be
> 10MB at most, preventing the ability to burn recent BlueField-3
> FW that exceeds the said size limit.
> 
> Thus, drop the hard coded limit. Instead, rely on FW's
> max_component_size threshold that is reported in MCQI register
> as the size limit for FW image.
> 
> Fixes: 410ed13cae39 ("Add the mlxfw module for Mellanox firmware flash process")
> Cc: Ido Schimmel <idosch@nvidia.com>
> Signed-off-by: Maher Sanalla <msanalla@nvidia.com>
> Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
> ---
>  drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c b/drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c
> index 46245e0b2462..43c84900369a 100644
> --- a/drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c
> +++ b/drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c
> @@ -14,7 +14,6 @@
>  #define MLXFW_FSM_STATE_WAIT_TIMEOUT_MS 30000
>  #define MLXFW_FSM_STATE_WAIT_ROUNDS \
>  	(MLXFW_FSM_STATE_WAIT_TIMEOUT_MS / MLXFW_FSM_STATE_WAIT_CYCLE_MS)
> -#define MLXFW_FSM_MAX_COMPONENT_SIZE (10 * (1 << 20))
>  
>  static const int mlxfw_fsm_state_errno[] = {
>  	[MLXFW_FSM_STATE_ERR_ERROR] = -EIO,
> @@ -229,7 +228,6 @@ static int mlxfw_flash_component(struct mlxfw_dev *mlxfw_dev,
>  		return err;
>  	}
>  
> -	comp_max_size = min_t(u32, comp_max_size, MLXFW_FSM_MAX_COMPONENT_SIZE);
>  	if (comp->data_size > comp_max_size) {
>  		MLXFW_ERR_MSG(mlxfw_dev, extack,
>  			      "Component size is bigger than limit", -EINVAL);

Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>

> -- 
> 2.18.2

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net/mlxfw: Drop hard coded max FW flash image size
  2025-01-16 12:33 [PATCH net] net/mlxfw: Drop hard coded max FW flash image size Moshe Shemesh
  2025-01-16 14:40 ` Ido Schimmel
  2025-01-16 15:00 ` Michal Swiatkowski
@ 2025-01-18  3:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-01-18  3:50 UTC (permalink / raw)
  To: Moshe Shemesh
  Cc: davem, kuba, netdev, idosch, saeedm, tariqt, mbloch, msanalla

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 16 Jan 2025 14:33:16 +0200 you wrote:
> From: Maher Sanalla <msanalla@nvidia.com>
> 
> Currently, mlxfw kernel module limits FW flash image size to be
> 10MB at most, preventing the ability to burn recent BlueField-3
> FW that exceeds the said size limit.
> 
> Thus, drop the hard coded limit. Instead, rely on FW's
> max_component_size threshold that is reported in MCQI register
> as the size limit for FW image.
> 
> [...]

Here is the summary with links:
  - [net] net/mlxfw: Drop hard coded max FW flash image size
    https://git.kernel.org/netdev/net/c/70d81f25cc92

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-01-18  3:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-16 12:33 [PATCH net] net/mlxfw: Drop hard coded max FW flash image size Moshe Shemesh
2025-01-16 14:40 ` Ido Schimmel
2025-01-16 15:00 ` Michal Swiatkowski
2025-01-18  3:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).