OSDN Git Service

net/mlx5e: Don't attach netdev profile while handling internal error
authorDmytro Linkin <dlinkin@nvidia.com>
Wed, 13 Oct 2021 11:39:24 +0000 (14:39 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Thu, 25 May 2023 03:44:18 +0000 (20:44 -0700)
commitbdf274750fca17b289404ef03453c4070725302c
tree7a32fcdd29d3ff669ad2d6aaa01b2ef4a7678a41
parent5d862ec631f3d3cc3b4f8cdb5b9fc5879663f1d3
net/mlx5e: Don't attach netdev profile while handling internal error

As part of switchdev mode disablement, driver changes port netdevice
profile from uplink to nic. If this process is triggered by health
recovery flow (PCI reset, for ex.) profile attach would fail because all
fw commands aborted when internal error flag is set. As a result, nic
netdevice profile is not attached and driver fails to rollback to uplink
profile, which leave driver in broken state and cause crash later.

To handle broken state do netdevice profile initialization only instead
of full attachment and release mdev resources on driver suspend as
expected. Actual netdevice attachment is done during driver load.

Fixes: c4d7eb57687f ("net/mxl5e: Add change profile method")
Signed-off-by: Dmytro Linkin <dlinkin@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c