diff options
author | Vladimir Sokolovsky <vlad@mellanox.co.il> | 2008-07-15 02:48:53 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2008-07-15 02:48:53 -0400 |
commit | 2d92865158d0e21ef4350703af64bc2a610d81d3 (patch) | |
tree | 8b11b29982ccff35bc6810e5a57c568ce1a4ada0 /drivers/net/mlx4/fw.h | |
parent | de910bd92137005b5e1ecaf2ce68053d7d7d5350 (diff) |
mlx4_core: Use MOD_STAT_CFG command to get minimal page size
There was a bug in some versions of the mlx4 driver in
mlx4_alloc_fmr(), which hardcoded the minimum acceptable page_shift to
be 12. However, new ConnectX firmware can support a minimum
page_shift of 9 (log_pg_sz of 9 returned by QUERY_DEV_LIM) -- so with
old drivers, ib_fmr_alloc() would fail for ULPs using the device
minimum when creating FMRs.
To preserve firmware compatibility with released mlx4 drivers, the
firmware will continue to return 12 as before for log_page_sz in
QUERY_DEV_CAP for these drivers. However, to enable new drivers to
take advantage of the available smaller page size, the mlx4 driver now
first sets the log_pg_sz to the device minimum by setting a
log_page_sz value to 0 via the MOD_STAT_CFG command and then reading
the real minimum via QUERY_DEV_CAP.
Signed-off-by: Jack Morgenstein <jackm@mellanox.co.il>
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/net/mlx4/fw.h')
-rw-r--r-- | drivers/net/mlx4/fw.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/mlx4/fw.h b/drivers/net/mlx4/fw.h index 306cb9b0242d..a0e046c149b7 100644 --- a/drivers/net/mlx4/fw.h +++ b/drivers/net/mlx4/fw.h | |||
@@ -38,6 +38,11 @@ | |||
38 | #include "mlx4.h" | 38 | #include "mlx4.h" |
39 | #include "icm.h" | 39 | #include "icm.h" |
40 | 40 | ||
41 | struct mlx4_mod_stat_cfg { | ||
42 | u8 log_pg_sz; | ||
43 | u8 log_pg_sz_m; | ||
44 | }; | ||
45 | |||
41 | struct mlx4_dev_cap { | 46 | struct mlx4_dev_cap { |
42 | int max_srq_sz; | 47 | int max_srq_sz; |
43 | int max_qp_sz; | 48 | int max_qp_sz; |
@@ -162,5 +167,6 @@ int mlx4_SET_ICM_SIZE(struct mlx4_dev *dev, u64 icm_size, u64 *aux_pages); | |||
162 | int mlx4_MAP_ICM_AUX(struct mlx4_dev *dev, struct mlx4_icm *icm); | 167 | int mlx4_MAP_ICM_AUX(struct mlx4_dev *dev, struct mlx4_icm *icm); |
163 | int mlx4_UNMAP_ICM_AUX(struct mlx4_dev *dev); | 168 | int mlx4_UNMAP_ICM_AUX(struct mlx4_dev *dev); |
164 | int mlx4_NOP(struct mlx4_dev *dev); | 169 | int mlx4_NOP(struct mlx4_dev *dev); |
170 | int mlx4_MOD_STAT_CFG(struct mlx4_dev *dev, struct mlx4_mod_stat_cfg *cfg); | ||
165 | 171 | ||
166 | #endif /* MLX4_FW_H */ | 172 | #endif /* MLX4_FW_H */ |