]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: SF, Fix show state inactive when its inactivated
authorParav Pandit <parav@nvidia.com>
Fri, 7 May 2021 07:08:47 +0000 (10:08 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 19 May 2021 06:01:29 +0000 (23:01 -0700)
commit82041634d96e87b41c600a673f10150d9f21f742
treebc44b92c22d050ebf9853c052edac26b0b000232
parentfca086617af864efd20289774901221b2df06b39
net/mlx5: SF, Fix show state inactive when its inactivated

When a SF is inactivated and when it is in a TEARDOWN_REQUEST
state, driver still returns its state as active. This is incorrect.
Fix it by treating TEARDOWN_REQEUST as inactive state. When a SF
is still attached to the driver, on user request to reactivate EINVAL
error is returned. Inform user about it with better code EBUSY and
informative error message.

Fixes: 6a3273217469 ("net/mlx5: SF, Port function state change support")
Signed-off-by: Parav Pandit <parav@nvidia.com>
Reviewed-by: Vu Pham <vuhuong@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/sf/devlink.c