Skip to content

Commit 137cef6

Browse files
mosheshemesh2Saeed Mahameed
authored andcommitted
net/mlx5: SF, Stop waiting for FW as teardown was called
When PF/VF teardown is called the driver sets the flag MLX5_BREAK_FW_WAIT to stop waiting for FW loading and initializing. Same should be applied to SF driver teardown to cut waiting time. On mlx5_sf_dev_remove() set the flag before draining health WQ as recovery flow may also wait for FW reloading while it is not relevant anymore. Signed-off-by: Moshe Shemesh <[email protected]> Reviewed-by: Aya Levin <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 17aa2d7 commit 137cef6

File tree

1 file changed

+13
-8
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/sf/dev

1 file changed

+13
-8
lines changed

drivers/net/ethernet/mellanox/mlx5/core/sf/dev/driver.c

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,24 +95,29 @@ static int mlx5_sf_dev_probe(struct auxiliary_device *adev, const struct auxilia
9595
static void mlx5_sf_dev_remove(struct auxiliary_device *adev)
9696
{
9797
struct mlx5_sf_dev *sf_dev = container_of(adev, struct mlx5_sf_dev, adev);
98-
struct devlink *devlink = priv_to_devlink(sf_dev->mdev);
98+
struct mlx5_core_dev *mdev = sf_dev->mdev;
99+
struct devlink *devlink;
99100

100-
mlx5_drain_health_wq(sf_dev->mdev);
101+
devlink = priv_to_devlink(mdev);
102+
set_bit(MLX5_BREAK_FW_WAIT, &mdev->intf_state);
103+
mlx5_drain_health_wq(mdev);
101104
devlink_unregister(devlink);
102-
if (mlx5_dev_is_lightweight(sf_dev->mdev))
103-
mlx5_uninit_one_light(sf_dev->mdev);
105+
if (mlx5_dev_is_lightweight(mdev))
106+
mlx5_uninit_one_light(mdev);
104107
else
105-
mlx5_uninit_one(sf_dev->mdev);
106-
iounmap(sf_dev->mdev->iseg);
107-
mlx5_mdev_uninit(sf_dev->mdev);
108+
mlx5_uninit_one(mdev);
109+
iounmap(mdev->iseg);
110+
mlx5_mdev_uninit(mdev);
108111
mlx5_devlink_free(devlink);
109112
}
110113

111114
static void mlx5_sf_dev_shutdown(struct auxiliary_device *adev)
112115
{
113116
struct mlx5_sf_dev *sf_dev = container_of(adev, struct mlx5_sf_dev, adev);
117+
struct mlx5_core_dev *mdev = sf_dev->mdev;
114118

115-
mlx5_unload_one(sf_dev->mdev, false);
119+
set_bit(MLX5_BREAK_FW_WAIT, &mdev->intf_state);
120+
mlx5_unload_one(mdev, false);
116121
}
117122

118123
static const struct auxiliary_device_id mlx5_sf_dev_id_table[] = {

0 commit comments

Comments
 (0)