summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorParav Pandit <parav@nvidia.com>2021-06-10 18:39:53 +0300
committerSaeed Mahameed <saeedm@nvidia.com>2021-06-17 01:36:42 +0300
commitc7d6c19b3bde66d7aebbe93e0f9e6d9ff57fc3fa (patch)
tree735e3d01afeb359033528aefab775105ffb02ed0 /drivers/net
parentca36fc4d77b35b8d142cf1ed0eae5ec2e071dc3c (diff)
downloadlinux-c7d6c19b3bde66d7aebbe93e0f9e6d9ff57fc3fa.tar.xz
net/mlx5: SF_DEV, remove SF device on invalid state
When auxiliary bus autoprobe is disabled and SF is in ACTIVE state, on SF port deletion it transitions from ACTIVE->ALLOCATED->INVALID. When VHCA event handler queries the state, it is already transition to INVALID state. In this scenario, event handler missed to delete the SF device. Fix it by deleting the SF when SF state is INVALID. Fixes: 90d010b8634b ("net/mlx5: SF, Add auxiliary device support") Signed-off-by: Parav Pandit <parav@nvidia.com> Reviewed-by: Vu Pham <vuhuong@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/sf/dev/dev.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/dev.c b/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/dev.c
index 6a0c6f965ad1..fa0288afc0dd 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/dev.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/dev.c
@@ -163,6 +163,7 @@ mlx5_sf_dev_state_change_handler(struct notifier_block *nb, unsigned long event_
sf_index = event->function_id - base_id;
sf_dev = xa_load(&table->devices, sf_index);
switch (event->new_vhca_state) {
+ case MLX5_VHCA_STATE_INVALID:
case MLX5_VHCA_STATE_ALLOCATED:
if (sf_dev)
mlx5_sf_dev_del(table->dev, sf_dev, sf_index);