diff options
-rw-r--r-- | drivers/infiniband/hw/mlx4/main.c | 2 | ||||
-rw-r--r-- | drivers/infiniband/hw/mlx4/mr.c | 2 | ||||
-rw-r--r-- | include/linux/mlx4/device.h | 4 |
3 files changed, 6 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index 4e94e360e43b..62e8cd6f0371 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c | |||
@@ -135,7 +135,7 @@ static int mlx4_ib_query_device(struct ib_device *ibdev, | |||
135 | props->max_srq = dev->dev->caps.num_srqs - dev->dev->caps.reserved_srqs; | 135 | props->max_srq = dev->dev->caps.num_srqs - dev->dev->caps.reserved_srqs; |
136 | props->max_srq_wr = dev->dev->caps.max_srq_wqes - 1; | 136 | props->max_srq_wr = dev->dev->caps.max_srq_wqes - 1; |
137 | props->max_srq_sge = dev->dev->caps.max_srq_sge; | 137 | props->max_srq_sge = dev->dev->caps.max_srq_sge; |
138 | props->max_fast_reg_page_list_len = PAGE_SIZE / sizeof (u64); | 138 | props->max_fast_reg_page_list_len = MLX4_MAX_FAST_REG_PAGES; |
139 | props->local_ca_ack_delay = dev->dev->caps.local_ca_ack_delay; | 139 | props->local_ca_ack_delay = dev->dev->caps.local_ca_ack_delay; |
140 | props->atomic_cap = dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_ATOMIC ? | 140 | props->atomic_cap = dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_ATOMIC ? |
141 | IB_ATOMIC_HCA : IB_ATOMIC_NONE; | 141 | IB_ATOMIC_HCA : IB_ATOMIC_NONE; |
diff --git a/drivers/infiniband/hw/mlx4/mr.c b/drivers/infiniband/hw/mlx4/mr.c index 1d27b9a8e2d6..dca55b19a6f1 100644 --- a/drivers/infiniband/hw/mlx4/mr.c +++ b/drivers/infiniband/hw/mlx4/mr.c | |||
@@ -226,7 +226,7 @@ struct ib_fast_reg_page_list *mlx4_ib_alloc_fast_reg_page_list(struct ib_device | |||
226 | struct mlx4_ib_fast_reg_page_list *mfrpl; | 226 | struct mlx4_ib_fast_reg_page_list *mfrpl; |
227 | int size = page_list_len * sizeof (u64); | 227 | int size = page_list_len * sizeof (u64); |
228 | 228 | ||
229 | if (size > PAGE_SIZE) | 229 | if (page_list_len > MLX4_MAX_FAST_REG_PAGES) |
230 | return ERR_PTR(-EINVAL); | 230 | return ERR_PTR(-EINVAL); |
231 | 231 | ||
232 | mfrpl = kmalloc(sizeof *mfrpl, GFP_KERNEL); | 232 | mfrpl = kmalloc(sizeof *mfrpl, GFP_KERNEL); |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 7a7f9c1e679a..ada69389fb91 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -171,6 +171,10 @@ enum { | |||
171 | MLX4_NUM_FEXCH = 64 * 1024, | 171 | MLX4_NUM_FEXCH = 64 * 1024, |
172 | }; | 172 | }; |
173 | 173 | ||
174 | enum { | ||
175 | MLX4_MAX_FAST_REG_PAGES = 511, | ||
176 | }; | ||
177 | |||
174 | static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) | 178 | static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) |
175 | { | 179 | { |
176 | return (major << 32) | (minor << 16) | subminor; | 180 | return (major << 32) | (minor << 16) | subminor; |