🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by Narcisa Vasile Wed, 14 Oct 2026 06:38
Re: [PATCH net-next] net/mlx5: Add reset_prepare and reset_done callbacks
#3084
Author: Narcisa Vasile
Date: Wed, 14 Oct 2026 06:38
49 lines
10434 bytes
On Sun, Oct 11, 2026 at 12:48:09PM +0300, Tariq Toukan wrote:
> From: Akiva Goldberger <agoldberger@nvidia.com>
> 
> Currently, the mlx5_core driver registers only the error_detected,
> slot_reset and resume PCI error handlers. Add the reset_prepare and
> reset_done callbacks, which are triggered by the PCI core before and
> after a PCI reset, respectively. These callbacks let mlx5 quiesce and
> restore device resources and commands around a PCI reset, so the driver
> no longer relies on the reset happening while the device is otherwise
> idle.
> 
> Additionally, add a device flag to indicate when a PCI reset is in
> progress to serialize PCI reset flows with other reset flows, namely FW
> reset. This flag also indicates to the reset_prepare and reset_done
> callbacks when to do a full unload/reload of the driver. When the
> callbacks are triggered by the hot-reset FW reset method, they leave the
> teardown and reload to the FW reset.
> 
> Signed-off-by: Akiva Goldberger <agoldberger@nvidia.com>
> Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
> Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
> ---
>  
> +static void mlx5_pci_reset_prepare(struct pci_dev *pdev)
> +{
> +	mlx5_drain_health_wq(dev);
> +	mlx5_unload_one(dev, false);
> +	mlx5_pci_disable_device(dev);
This disables bus-mastering, after which pci_save_state snapshots it in
the disabled state. reset_done() re-enables it but the snapshot remains
stale.

If a FW error later triggers the sw recovery through mlx5_pci_slot_reset(),
the stale snapshot is re-applied with pci_restore_state().
Would this disable bus mastering again and block the driver recovery?
Should pci_set_master(pdev); and pci_restore_state(pdev); be reordered
in mlx5_pci_slot_reset()?
> +}
> +
> +static void mlx5_pci_reset_done(struct pci_dev *pdev)
> +{
> +	err = mlx5_pci_enable_device(dev);
> +	if (err) {
> +		mlx5_core_err(dev, "%s: mlx5_pci_enable_device failed, err = %d\n",
> +			      __func__, err);
nit: mlx5_core_err already prints __func__
> +		goto clear_pci_reset_flag;
> +	}
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads