diff options
-rw-r--r-- | drivers/infiniband/hw/mlx4/alias_GUID.c | 7 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/eq.c | 24 |
2 files changed, 26 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/mlx4/alias_GUID.c b/drivers/infiniband/hw/mlx4/alias_GUID.c index 0f00204d2ece..21cb41a60fe8 100644 --- a/drivers/infiniband/hw/mlx4/alias_GUID.c +++ b/drivers/infiniband/hw/mlx4/alias_GUID.c | |||
@@ -189,7 +189,7 @@ void mlx4_ib_notify_slaves_on_guid_change(struct mlx4_ib_dev *dev, | |||
189 | { | 189 | { |
190 | int i; | 190 | int i; |
191 | u64 guid_indexes; | 191 | u64 guid_indexes; |
192 | int slave_id; | 192 | int slave_id, slave_port; |
193 | enum slave_port_state new_state; | 193 | enum slave_port_state new_state; |
194 | enum slave_port_state prev_state; | 194 | enum slave_port_state prev_state; |
195 | __be64 tmp_cur_ag, form_cache_ag; | 195 | __be64 tmp_cur_ag, form_cache_ag; |
@@ -217,6 +217,11 @@ void mlx4_ib_notify_slaves_on_guid_change(struct mlx4_ib_dev *dev, | |||
217 | slave_id = (block_num * NUM_ALIAS_GUID_IN_REC) + i ; | 217 | slave_id = (block_num * NUM_ALIAS_GUID_IN_REC) + i ; |
218 | if (slave_id >= dev->dev->persist->num_vfs + 1) | 218 | if (slave_id >= dev->dev->persist->num_vfs + 1) |
219 | return; | 219 | return; |
220 | |||
221 | slave_port = mlx4_phys_to_slave_port(dev->dev, slave_id, port_num); | ||
222 | if (slave_port < 0) /* this port isn't available for the VF */ | ||
223 | continue; | ||
224 | |||
220 | tmp_cur_ag = *(__be64 *)&p_data[i * GUID_REC_SIZE]; | 225 | tmp_cur_ag = *(__be64 *)&p_data[i * GUID_REC_SIZE]; |
221 | form_cache_ag = get_cached_alias_guid(dev, port_num, | 226 | form_cache_ag = get_cached_alias_guid(dev, port_num, |
222 | (NUM_ALIAS_GUID_IN_REC * block_num) + i); | 227 | (NUM_ALIAS_GUID_IN_REC * block_num) + i); |
diff --git a/drivers/net/ethernet/mellanox/mlx4/eq.c b/drivers/net/ethernet/mellanox/mlx4/eq.c index 2619c9fbf42d..80bcd648c5e0 100644 --- a/drivers/net/ethernet/mellanox/mlx4/eq.c +++ b/drivers/net/ethernet/mellanox/mlx4/eq.c | |||
@@ -145,7 +145,7 @@ void mlx4_gen_slave_eqe(struct work_struct *work) | |||
145 | struct mlx4_slave_event_eq *slave_eq = &mfunc->master.slave_eq; | 145 | struct mlx4_slave_event_eq *slave_eq = &mfunc->master.slave_eq; |
146 | struct mlx4_eqe *eqe; | 146 | struct mlx4_eqe *eqe; |
147 | u8 slave; | 147 | u8 slave; |
148 | int i; | 148 | int i, phys_port, slave_port; |
149 | 149 | ||
150 | for (eqe = next_slave_event_eqe(slave_eq); eqe; | 150 | for (eqe = next_slave_event_eqe(slave_eq); eqe; |
151 | eqe = next_slave_event_eqe(slave_eq)) { | 151 | eqe = next_slave_event_eqe(slave_eq)) { |
@@ -154,9 +154,20 @@ void mlx4_gen_slave_eqe(struct work_struct *work) | |||
154 | /* All active slaves need to receive the event */ | 154 | /* All active slaves need to receive the event */ |
155 | if (slave == ALL_SLAVES) { | 155 | if (slave == ALL_SLAVES) { |
156 | for (i = 0; i <= dev->persist->num_vfs; i++) { | 156 | for (i = 0; i <= dev->persist->num_vfs; i++) { |
157 | phys_port = 0; | ||
158 | if (eqe->type == MLX4_EVENT_TYPE_PORT_MNG_CHG_EVENT && | ||
159 | eqe->subtype == MLX4_DEV_PMC_SUBTYPE_PORT_INFO) { | ||
160 | phys_port = eqe->event.port_mgmt_change.port; | ||
161 | slave_port = mlx4_phys_to_slave_port(dev, i, phys_port); | ||
162 | if (slave_port < 0) /* VF doesn't have this port */ | ||
163 | continue; | ||
164 | eqe->event.port_mgmt_change.port = slave_port; | ||
165 | } | ||
157 | if (mlx4_GEN_EQE(dev, i, eqe)) | 166 | if (mlx4_GEN_EQE(dev, i, eqe)) |
158 | mlx4_warn(dev, "Failed to generate event for slave %d\n", | 167 | mlx4_warn(dev, "Failed to generate event for slave %d\n", |
159 | i); | 168 | i); |
169 | if (phys_port) | ||
170 | eqe->event.port_mgmt_change.port = phys_port; | ||
160 | } | 171 | } |
161 | } else { | 172 | } else { |
162 | if (mlx4_GEN_EQE(dev, slave, eqe)) | 173 | if (mlx4_GEN_EQE(dev, slave, eqe)) |
@@ -224,7 +235,7 @@ int mlx4_gen_pkey_eqe(struct mlx4_dev *dev, int slave, u8 port) | |||
224 | 235 | ||
225 | eqe.type = MLX4_EVENT_TYPE_PORT_MNG_CHG_EVENT; | 236 | eqe.type = MLX4_EVENT_TYPE_PORT_MNG_CHG_EVENT; |
226 | eqe.subtype = MLX4_DEV_PMC_SUBTYPE_PKEY_TABLE; | 237 | eqe.subtype = MLX4_DEV_PMC_SUBTYPE_PKEY_TABLE; |
227 | eqe.event.port_mgmt_change.port = port; | 238 | eqe.event.port_mgmt_change.port = mlx4_phys_to_slave_port(dev, slave, port); |
228 | 239 | ||
229 | return mlx4_GEN_EQE(dev, slave, &eqe); | 240 | return mlx4_GEN_EQE(dev, slave, &eqe); |
230 | } | 241 | } |
@@ -241,7 +252,7 @@ int mlx4_gen_guid_change_eqe(struct mlx4_dev *dev, int slave, u8 port) | |||
241 | 252 | ||
242 | eqe.type = MLX4_EVENT_TYPE_PORT_MNG_CHG_EVENT; | 253 | eqe.type = MLX4_EVENT_TYPE_PORT_MNG_CHG_EVENT; |
243 | eqe.subtype = MLX4_DEV_PMC_SUBTYPE_GUID_INFO; | 254 | eqe.subtype = MLX4_DEV_PMC_SUBTYPE_GUID_INFO; |
244 | eqe.event.port_mgmt_change.port = port; | 255 | eqe.event.port_mgmt_change.port = mlx4_phys_to_slave_port(dev, slave, port); |
245 | 256 | ||
246 | return mlx4_GEN_EQE(dev, slave, &eqe); | 257 | return mlx4_GEN_EQE(dev, slave, &eqe); |
247 | } | 258 | } |
@@ -251,6 +262,7 @@ int mlx4_gen_port_state_change_eqe(struct mlx4_dev *dev, int slave, u8 port, | |||
251 | u8 port_subtype_change) | 262 | u8 port_subtype_change) |
252 | { | 263 | { |
253 | struct mlx4_eqe eqe; | 264 | struct mlx4_eqe eqe; |
265 | u8 slave_port = mlx4_phys_to_slave_port(dev, slave, port); | ||
254 | 266 | ||
255 | /*don't send if we don't have the that slave */ | 267 | /*don't send if we don't have the that slave */ |
256 | if (dev->persist->num_vfs < slave) | 268 | if (dev->persist->num_vfs < slave) |
@@ -259,7 +271,7 @@ int mlx4_gen_port_state_change_eqe(struct mlx4_dev *dev, int slave, u8 port, | |||
259 | 271 | ||
260 | eqe.type = MLX4_EVENT_TYPE_PORT_CHANGE; | 272 | eqe.type = MLX4_EVENT_TYPE_PORT_CHANGE; |
261 | eqe.subtype = port_subtype_change; | 273 | eqe.subtype = port_subtype_change; |
262 | eqe.event.port_change.port = cpu_to_be32(port << 28); | 274 | eqe.event.port_change.port = cpu_to_be32(slave_port << 28); |
263 | 275 | ||
264 | mlx4_dbg(dev, "%s: sending: %d to slave: %d on port: %d\n", __func__, | 276 | mlx4_dbg(dev, "%s: sending: %d to slave: %d on port: %d\n", __func__, |
265 | port_subtype_change, slave, port); | 277 | port_subtype_change, slave, port); |
@@ -589,6 +601,10 @@ static int mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq) | |||
589 | if (SLAVE_PORT_GEN_EVENT_DOWN == gen_event) { | 601 | if (SLAVE_PORT_GEN_EVENT_DOWN == gen_event) { |
590 | if (i == mlx4_master_func_num(dev)) | 602 | if (i == mlx4_master_func_num(dev)) |
591 | continue; | 603 | continue; |
604 | eqe->event.port_change.port = | ||
605 | cpu_to_be32( | ||
606 | (be32_to_cpu(eqe->event.port_change.port) & 0xFFFFFFF) | ||
607 | | (mlx4_phys_to_slave_port(dev, i, port) << 28)); | ||
592 | mlx4_slave_event(dev, i, eqe); | 608 | mlx4_slave_event(dev, i, eqe); |
593 | } | 609 | } |
594 | } | 610 | } |