diff options
author | Eli Cohen <eli@dev.mellanox.co.il> | 2012-02-09 11:10:06 -0500 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2012-02-26 04:43:37 -0500 |
commit | a5bbe892da9441835cb6fece26d9bbd95fc820be (patch) | |
tree | 2642ee58996918ae4a09be9d82d97a6516eb215b /drivers/net/ethernet/mellanox/mlx4/main.c | |
parent | 4ba6b8eaa9d67d03fb653cb8a13afca3236d4d70 (diff) |
mlx4: Enforce device max FMR maps in FMR alloc
ConnectX devices have a limit on the number of mappings that can be
done on an FMR before having to call sync_tpt. The current
mlx4_ib driver reports the limit correctly in max_map_per_fmr in
.query_device(), but mlx4_core doesn't check it when actually
allocating FMRs.
Add a max_fmr_maps field to struct mlx4_caps and enforce this maximum
value on FMR allocations.
Signed-off-by: Eli Cohen <eli@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/main.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/main.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 678558b502fc..3e593ae56e00 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c | |||
@@ -1131,6 +1131,8 @@ static int mlx4_init_hca(struct mlx4_dev *dev) | |||
1131 | goto err_stop_fw; | 1131 | goto err_stop_fw; |
1132 | } | 1132 | } |
1133 | 1133 | ||
1134 | dev->caps.max_fmr_maps = (1 << (32 - ilog2(dev->caps.num_mpts))) - 1; | ||
1135 | |||
1134 | init_hca.log_uar_sz = ilog2(dev->caps.num_uars); | 1136 | init_hca.log_uar_sz = ilog2(dev->caps.num_uars); |
1135 | init_hca.uar_page_sz = PAGE_SHIFT - 12; | 1137 | init_hca.uar_page_sz = PAGE_SHIFT - 12; |
1136 | 1138 | ||