diff options
author | Jack Morgenstein <jackm@dev.mellanox.co.il> | 2012-08-03 04:40:48 -0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2012-09-30 23:33:37 -0400 |
commit | 993c401e207946fa56f69c51e39f015e7108497b (patch) | |
tree | 17ef6798c9723d6cbaa3c48b6d24cda765d7057d /include/linux/mlx4 | |
parent | 3cf69cc8dbebf15b99deb342ea422105ae9c2774 (diff) |
mlx4_core: Add IB port-state machine and port mgmt event propagation
For an IB port, a slave should not show port active until that slave
has a valid alias-guid (provided by the subnet manager). Therefore
the port-up event should be passed to a slave only after both the port
is up, and the slave's alias-guid has been set.
Also, provide the infrastructure for propagating port-management
events (client-reregister, etc) to slaves.
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'include/linux/mlx4')
-rw-r--r-- | include/linux/mlx4/device.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 9803fd5d3dba..380e01671d1e 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -192,6 +192,25 @@ enum { | |||
192 | MLX4_FATAL_WARNING_SUBTYPE_WARMING = 0, | 192 | MLX4_FATAL_WARNING_SUBTYPE_WARMING = 0, |
193 | }; | 193 | }; |
194 | 194 | ||
195 | enum slave_port_state { | ||
196 | SLAVE_PORT_DOWN = 0, | ||
197 | SLAVE_PENDING_UP, | ||
198 | SLAVE_PORT_UP, | ||
199 | }; | ||
200 | |||
201 | enum slave_port_gen_event { | ||
202 | SLAVE_PORT_GEN_EVENT_DOWN = 0, | ||
203 | SLAVE_PORT_GEN_EVENT_UP, | ||
204 | SLAVE_PORT_GEN_EVENT_NONE, | ||
205 | }; | ||
206 | |||
207 | enum slave_port_state_event { | ||
208 | MLX4_PORT_STATE_DEV_EVENT_PORT_DOWN, | ||
209 | MLX4_PORT_STATE_DEV_EVENT_PORT_UP, | ||
210 | MLX4_PORT_STATE_IB_PORT_STATE_EVENT_GID_VALID, | ||
211 | MLX4_PORT_STATE_IB_EVENT_GID_INVALID, | ||
212 | }; | ||
213 | |||
195 | enum { | 214 | enum { |
196 | MLX4_PERM_LOCAL_READ = 1 << 10, | 215 | MLX4_PERM_LOCAL_READ = 1 << 10, |
197 | MLX4_PERM_LOCAL_WRITE = 1 << 11, | 216 | MLX4_PERM_LOCAL_WRITE = 1 << 11, |
@@ -945,4 +964,13 @@ void mlx4_sync_pkey_table(struct mlx4_dev *dev, int slave, int port, | |||
945 | 964 | ||
946 | int mlx4_get_parav_qkey(struct mlx4_dev *dev, u32 qpn, u32 *qkey); | 965 | int mlx4_get_parav_qkey(struct mlx4_dev *dev, u32 qpn, u32 *qkey); |
947 | 966 | ||
967 | int mlx4_is_slave_active(struct mlx4_dev *dev, int slave); | ||
968 | int mlx4_gen_pkey_eqe(struct mlx4_dev *dev, int slave, u8 port); | ||
969 | int mlx4_gen_guid_change_eqe(struct mlx4_dev *dev, int slave, u8 port); | ||
970 | int mlx4_gen_slaves_port_mgt_ev(struct mlx4_dev *dev, u8 port, int attr); | ||
971 | int mlx4_gen_port_state_change_eqe(struct mlx4_dev *dev, int slave, u8 port, u8 port_subtype_change); | ||
972 | enum slave_port_state mlx4_get_slave_port_state(struct mlx4_dev *dev, int slave, u8 port); | ||
973 | int set_and_calc_slave_port_state(struct mlx4_dev *dev, int slave, u8 port, int event, enum slave_port_gen_event *gen_event); | ||
974 | |||
975 | |||
948 | #endif /* MLX4_DEVICE_H */ | 976 | #endif /* MLX4_DEVICE_H */ |