Skip to content

Commit c7d6c19

Browse files
paravmellanoxSaeed Mahameed
authored andcommitted
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: 90d010b ("net/mlx5: SF, Add auxiliary device support") Signed-off-by: Parav Pandit <[email protected]> Reviewed-by: Vu Pham <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent ca36fc4 commit c7d6c19

File tree

1 file changed

+1
-0
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/sf/dev

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ mlx5_sf_dev_state_change_handler(struct notifier_block *nb, unsigned long event_
163163
sf_index = event->function_id - base_id;
164164
sf_dev = xa_load(&table->devices, sf_index);
165165
switch (event->new_vhca_state) {
166+
case MLX5_VHCA_STATE_INVALID:
166167
case MLX5_VHCA_STATE_ALLOCATED:
167168
if (sf_dev)
168169
mlx5_sf_dev_del(table->dev, sf_dev, sf_index);

0 commit comments

Comments
 (0)