diff options
author | Jack Morgenstein <jackm@dev.mellanox.co.il> | 2012-06-19 04:21:40 -0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2012-07-10 12:47:10 -0400 |
commit | 00f5ce99dc6ee46c3113393cc8fa12173f9bbcd7 (patch) | |
tree | cbcd8e2afcd492b3677bf3eedec29b34f249129c /drivers/infiniband/hw/mlx4/mlx4_ib.h | |
parent | 3045f0920367e625bbec7d66fadb444e673515af (diff) |
mlx4: Use port management change event instead of smp_snoop
The port management change event can replace smp_snoop. If the
capability bit for this event is set in dev-caps, the event is used
(by the driver setting the PORT_MNG_CHG_EVENT bit in the async event
mask in the MAP_EQ fw command). In this case, when the driver passes
incoming SMP PORT_INFO SET mads to the FW, the FW generates port
management change events to signal any changes to the driver.
If the FW generates these events, smp_snoop shouldn't be invoked in
ib_process_mad(), or duplicate events will occur (once from the
FW-generated event, and once from smp_snoop).
In the case where the FW does not generate port management change
events smp_snoop needs to be invoked to create these events. The flow
in smp_snoop has been modified to make use of the same procedures as
in the fw-generated-event event case to generate the port management
events (LID change, Client-rereg, Pkey change, and/or GID change).
Port management change event handling required changing the
mlx4_ib_event and mlx4_dispatch_event prototypes; the "param" argument
(last argument) had to be changed to unsigned long in order to
accomodate passing the EQE pointer.
We also needed to move the definition of struct mlx4_eqe from
net/mlx4.h to file device.h -- to make it available to the IB driver,
to handle port management change events.
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx4/mlx4_ib.h')
-rw-r--r-- | drivers/infiniband/hw/mlx4/mlx4_ib.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx4/mlx4_ib.h b/drivers/infiniband/hw/mlx4/mlx4_ib.h index 5f298afaa81f..23bfbf9ee0e0 100644 --- a/drivers/infiniband/hw/mlx4/mlx4_ib.h +++ b/drivers/infiniband/hw/mlx4/mlx4_ib.h | |||
@@ -224,6 +224,12 @@ struct mlx4_ib_dev { | |||
224 | int eq_added; | 224 | int eq_added; |
225 | }; | 225 | }; |
226 | 226 | ||
227 | struct ib_event_work { | ||
228 | struct work_struct work; | ||
229 | struct mlx4_ib_dev *ib_dev; | ||
230 | struct mlx4_eqe ib_eqe; | ||
231 | }; | ||
232 | |||
227 | static inline struct mlx4_ib_dev *to_mdev(struct ib_device *ibdev) | 233 | static inline struct mlx4_ib_dev *to_mdev(struct ib_device *ibdev) |
228 | { | 234 | { |
229 | return container_of(ibdev, struct mlx4_ib_dev, ib_dev); | 235 | return container_of(ibdev, struct mlx4_ib_dev, ib_dev); |
@@ -381,4 +387,7 @@ static inline int mlx4_ib_ah_grh_present(struct mlx4_ib_ah *ah) | |||
381 | int mlx4_ib_add_mc(struct mlx4_ib_dev *mdev, struct mlx4_ib_qp *mqp, | 387 | int mlx4_ib_add_mc(struct mlx4_ib_dev *mdev, struct mlx4_ib_qp *mqp, |
382 | union ib_gid *gid); | 388 | union ib_gid *gid); |
383 | 389 | ||
390 | void mlx4_ib_dispatch_event(struct mlx4_ib_dev *dev, u8 port_num, | ||
391 | enum ib_event_type type); | ||
392 | |||
384 | #endif /* MLX4_IB_H */ | 393 | #endif /* MLX4_IB_H */ |