aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mlx4
diff options
context:
space:
mode:
authorYishai Hadas <yishaih@mellanox.com>2015-01-25 09:59:40 -0500
committerDavid S. Miller <davem@davemloft.net>2015-01-25 17:43:14 -0500
commitc69453e294c9f16da977b68e658a8028b854c209 (patch)
tree31d0d1363f6fdcad81c6de6eec722d657ae486a3 /include/linux/mlx4
parentf5aef5aa35063f2b45c3605871cd525d0cb7fb7a (diff)
net/mlx4_core: Manage interface state for Reset flow cases
We need to manage interface state to sync between reset flow and some other relative cases such as remove_one. This has to be done to prevent certain races. For example in case software stack is down as a result of unload call, the remove_one should skip the unload phase. Implement the remove_one case, handling AER and other cases comes next. The interface can be up/down, upon remove_one, the state will include an extra bit indicating that the device is cleaned-up, forcing other tasks to finish before the final cleanup. Signed-off-by: Yishai Hadas <yishaih@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/mlx4')
-rw-r--r--include/linux/mlx4/device.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 7d5d317cb7a6..33f9ca71925c 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -416,6 +416,11 @@ enum {
416 MLX4_DEVICE_STATE_INTERNAL_ERROR = 1 << 1, 416 MLX4_DEVICE_STATE_INTERNAL_ERROR = 1 << 1,
417}; 417};
418 418
419enum {
420 MLX4_INTERFACE_STATE_UP = 1 << 0,
421 MLX4_INTERFACE_STATE_DELETION = 1 << 1,
422};
423
419#define MSTR_SM_CHANGE_MASK (MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK | \ 424#define MSTR_SM_CHANGE_MASK (MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK | \
420 MLX4_EQ_PORT_INFO_MSTR_SM_LID_CHANGE_MASK) 425 MLX4_EQ_PORT_INFO_MSTR_SM_LID_CHANGE_MASK)
421 426
@@ -760,6 +765,8 @@ struct mlx4_dev_persistent {
760 struct workqueue_struct *catas_wq; 765 struct workqueue_struct *catas_wq;
761 struct mutex device_state_mutex; /* protect HW state */ 766 struct mutex device_state_mutex; /* protect HW state */
762 u8 state; 767 u8 state;
768 struct mutex interface_state_mutex; /* protect SW state */
769 u8 interface_state;
763}; 770};
764 771
765struct mlx4_dev { 772struct mlx4_dev {