mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
IB/mlx4: Limit size of fast registration WRs
Fix the limit on the size of max fast registration WRs that can be posted to match hardware capabilities. Signed-off-by: Eli Cohen <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
This commit is contained in:
parent
0498628f97
commit
5a0fd09428
3 changed files with 6 additions and 2 deletions
|
|
@ -135,7 +135,7 @@ static int mlx4_ib_query_device(struct ib_device *ibdev,
|
|||
props->max_srq = dev->dev->caps.num_srqs - dev->dev->caps.reserved_srqs;
|
||||
props->max_srq_wr = dev->dev->caps.max_srq_wqes - 1;
|
||||
props->max_srq_sge = dev->dev->caps.max_srq_sge;
|
||||
props->max_fast_reg_page_list_len = PAGE_SIZE / sizeof (u64);
|
||||
props->max_fast_reg_page_list_len = MLX4_MAX_FAST_REG_PAGES;
|
||||
props->local_ca_ack_delay = dev->dev->caps.local_ca_ack_delay;
|
||||
props->atomic_cap = dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_ATOMIC ?
|
||||
IB_ATOMIC_HCA : IB_ATOMIC_NONE;
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ struct ib_fast_reg_page_list *mlx4_ib_alloc_fast_reg_page_list(struct ib_device
|
|||
struct mlx4_ib_fast_reg_page_list *mfrpl;
|
||||
int size = page_list_len * sizeof (u64);
|
||||
|
||||
if (size > PAGE_SIZE)
|
||||
if (page_list_len > MLX4_MAX_FAST_REG_PAGES)
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
mfrpl = kmalloc(sizeof *mfrpl, GFP_KERNEL);
|
||||
|
|
|
|||
Loading…
Reference in a new issue