Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 291974
b: refs/heads/master
c: a5bbe89
h: refs/heads/master
v: v3
  • Loading branch information
Eli Cohen authored and Roland Dreier committed Feb 26, 2012
1 parent 1fd5687 commit f0dbab6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4ba6b8eaa9d67d03fb653cb8a13afca3236d4d70
refs/heads/master: a5bbe892da9441835cb6fece26d9bbd95fc820be
2 changes: 1 addition & 1 deletion trunk/drivers/infiniband/hw/mlx4/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ static int mlx4_ib_query_device(struct ib_device *ibdev,
props->max_mcast_qp_attach = dev->dev->caps.num_qp_per_mgm;
props->max_total_mcast_qp_attach = props->max_mcast_qp_attach *
props->max_mcast_grp;
props->max_map_per_fmr = (1 << (32 - ilog2(dev->dev->caps.num_mpts))) - 1;
props->max_map_per_fmr = dev->dev->caps.max_fmr_maps;

out:
kfree(in_mad);
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/ethernet/mellanox/mlx4/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,8 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
goto err_stop_fw;
}

dev->caps.max_fmr_maps = (1 << (32 - ilog2(dev->caps.num_mpts))) - 1;

init_hca.log_uar_sz = ilog2(dev->caps.num_uars);
init_hca.uar_page_sz = PAGE_SHIFT - 12;

Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/net/ethernet/mellanox/mlx4/mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,9 @@ int mlx4_fmr_alloc(struct mlx4_dev *dev, u32 pd, u32 access, int max_pages,
u64 mtt_offset;
int err = -ENOMEM;

if (max_maps > dev->caps.max_fmr_maps)
return -EINVAL;

if (page_shift < (ffs(dev->caps.page_size_cap) - 1) || page_shift >= 32)
return -EINVAL;

Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/mlx4/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ struct mlx4_caps {
int num_comp_vectors;
int comp_pool;
int num_mpts;
int max_fmr_maps;
int num_mtts;
int fmr_reserved_mtts;
int reserved_mtts;
Expand Down

0 comments on commit f0dbab6

Please sign in to comment.