public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] mlx4: correct error reporting in mlx4_master_process_vhcr()
@ 2026-04-09  9:27 Alok Tiwari
  2026-04-13 20:13 ` Tariq Toukan
  2026-04-13 21:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Alok Tiwari @ 2026-04-09  9:27 UTC (permalink / raw)
  To: tariqt, andrew+netdev, kuba, davem, edumazet, pabeni, horms,
	netdev
  Cc: alok.a.tiwarilinux, alok.a.tiwari

mlx4_master_process_vhcr() logs vhcr->errno on failures, but this field
is never populated by the PF path. As a result, all failures are reported
with errno 0 and err print in status case which is misleading.

Use the actual return value (err) instead, translate it to FW status
before logging, and report both values.

Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
---
 drivers/net/ethernet/mellanox/mlx4/cmd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/cmd.c b/drivers/net/ethernet/mellanox/mlx4/cmd.c
index de0193d82ec1..bdaf152e6712 100644
--- a/drivers/net/ethernet/mellanox/mlx4/cmd.c
+++ b/drivers/net/ethernet/mellanox/mlx4/cmd.c
@@ -1782,6 +1782,7 @@ static int mlx4_master_process_vhcr(struct mlx4_dev *dev, int slave,
 	}
 
 	if (err) {
+		vhcr_cmd->status = mlx4_errno_to_status(err);
 		if (!(dev->persist->state & MLX4_DEVICE_STATE_INTERNAL_ERROR)) {
 			if (vhcr->op == MLX4_CMD_ALLOC_RES &&
 			    (vhcr->in_modifier & 0xff) == RES_COUNTER &&
@@ -1791,9 +1792,8 @@ static int mlx4_master_process_vhcr(struct mlx4_dev *dev, int slave,
 					 slave, err);
 			else
 				mlx4_warn(dev, "vhcr command:0x%x slave:%d failed with error:%d, status %d\n",
-					  vhcr->op, slave, vhcr->errno, err);
+					  vhcr->op, slave, err, vhcr_cmd->status);
 		}
-		vhcr_cmd->status = mlx4_errno_to_status(err);
 		goto out_status;
 	}
 
-- 
2.50.1


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

* Re: [PATCH net-next] mlx4: correct error reporting in mlx4_master_process_vhcr()
  2026-04-09  9:27 [PATCH net-next] mlx4: correct error reporting in mlx4_master_process_vhcr() Alok Tiwari
@ 2026-04-13 20:13 ` Tariq Toukan
  2026-04-13 21:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Tariq Toukan @ 2026-04-13 20:13 UTC (permalink / raw)
  To: Alok Tiwari, tariqt, andrew+netdev, kuba, davem, edumazet, pabeni,
	horms, netdev
  Cc: alok.a.tiwarilinux



On 09/04/2026 12:27, Alok Tiwari wrote:
> mlx4_master_process_vhcr() logs vhcr->errno on failures, but this field
> is never populated by the PF path. As a result, all failures are reported
> with errno 0 and err print in status case which is misleading.
> 
> Use the actual return value (err) instead, translate it to FW status
> before logging, and report both values.
> 
> Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
> ---
>   drivers/net/ethernet/mellanox/mlx4/cmd.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx4/cmd.c b/drivers/net/ethernet/mellanox/mlx4/cmd.c
> index de0193d82ec1..bdaf152e6712 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/cmd.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/cmd.c
> @@ -1782,6 +1782,7 @@ static int mlx4_master_process_vhcr(struct mlx4_dev *dev, int slave,
>   	}
>   
>   	if (err) {
> +		vhcr_cmd->status = mlx4_errno_to_status(err);
>   		if (!(dev->persist->state & MLX4_DEVICE_STATE_INTERNAL_ERROR)) {
>   			if (vhcr->op == MLX4_CMD_ALLOC_RES &&
>   			    (vhcr->in_modifier & 0xff) == RES_COUNTER &&
> @@ -1791,9 +1792,8 @@ static int mlx4_master_process_vhcr(struct mlx4_dev *dev, int slave,
>   					 slave, err);
>   			else
>   				mlx4_warn(dev, "vhcr command:0x%x slave:%d failed with error:%d, status %d\n",
> -					  vhcr->op, slave, vhcr->errno, err);
> +					  vhcr->op, slave, err, vhcr_cmd->status);
>   		}
> -		vhcr_cmd->status = mlx4_errno_to_status(err);
>   		goto out_status;
>   	}
>   

Reviewed-by: Tariq Toukan <tariqt@nvidia.com>

Thanks.

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

* Re: [PATCH net-next] mlx4: correct error reporting in mlx4_master_process_vhcr()
  2026-04-09  9:27 [PATCH net-next] mlx4: correct error reporting in mlx4_master_process_vhcr() Alok Tiwari
  2026-04-13 20:13 ` Tariq Toukan
@ 2026-04-13 21:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-04-13 21:30 UTC (permalink / raw)
  To: Alok Tiwari
  Cc: tariqt, andrew+netdev, kuba, davem, edumazet, pabeni, horms,
	netdev, alok.a.tiwarilinux

Hello:

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

On Thu,  9 Apr 2026 02:27:47 -0700 you wrote:
> mlx4_master_process_vhcr() logs vhcr->errno on failures, but this field
> is never populated by the PF path. As a result, all failures are reported
> with errno 0 and err print in status case which is misleading.
> 
> Use the actual return value (err) instead, translate it to FW status
> before logging, and report both values.
> 
> [...]

Here is the summary with links:
  - [net-next] mlx4: correct error reporting in mlx4_master_process_vhcr()
    https://git.kernel.org/netdev/net-next/c/bc174d054986

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] 3+ messages in thread

end of thread, other threads:[~2026-04-13 21:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-09  9:27 [PATCH net-next] mlx4: correct error reporting in mlx4_master_process_vhcr() Alok Tiwari
2026-04-13 20:13 ` Tariq Toukan
2026-04-13 21:30 ` 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