]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net/mlx5e: Set local Xoff after FW update
authorAlexei Lazar <alazar@nvidia.com>
Mon, 25 Aug 2025 14:34:34 +0000 (17:34 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Sep 2025 12:05:55 +0000 (14:05 +0200)
[ Upstream commit aca0c31af61e0d5cf1675a0cbd29460b95ae693c ]

The local Xoff value is being set before the firmware (FW) update.
In case of a failure where the FW is not updated with the new value,
there is no fallback to the previous value.
Update the local Xoff value after the FW has been successfully set.

Fixes: 0696d60853d5 ("net/mlx5e: Receive buffer configuration")
Signed-off-by: Alexei Lazar <alazar@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Link: https://patch.msgid.link/20250825143435.598584-12-mbloch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en/port_buffer.c

index 99c7cdd0404a51c446e8f5a15396d182e41142c7..44d3d6826f696cc3943de62839e0b901ed56937f 100644 (file)
@@ -341,7 +341,6 @@ int mlx5e_port_manual_buffer_config(struct mlx5e_priv *priv,
                if (err)
                        return err;
        }
-       priv->dcbx.xoff = xoff;
 
        /* Apply the settings */
        if (update_buffer) {
@@ -350,6 +349,8 @@ int mlx5e_port_manual_buffer_config(struct mlx5e_priv *priv,
                        return err;
        }
 
+       priv->dcbx.xoff = xoff;
+
        if (update_prio2buffer)
                err = mlx5e_port_set_priority2buffer(priv->mdev, prio2buffer);