aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx4/qp.c
diff options
context:
space:
mode:
authorYuval Shaia <yuval.shaia@oracle.com>2018-12-11 10:36:47 +0200
committerJason Gunthorpe <jgg@mellanox.com>2018-12-18 14:24:34 -0700
commit350b4c8ac1b4c07909ab7f8ad4303fff2505ab7c (patch)
treee639558f7af77c1bd6ec892b703754acb1ff94b5 /drivers/infiniband/hw/mlx4/qp.c
parentRDMA/hns: Fix an error code in hns_roce_create_srq() (diff)
downloadlinux-dev-350b4c8ac1b4c07909ab7f8ad4303fff2505ab7c.tar.xz
linux-dev-350b4c8ac1b4c07909ab7f8ad4303fff2505ab7c.zip
IB/mlx4: Utilize macro to calculate SQ spare size
The macro MLX4_IB_SQ_HEADROOM calculates the spare room needed to be left. Use it instead of hard-coding the HW prefetch size. Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com> Reviewed-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx4/qp.c')
-rw-r--r--drivers/infiniband/hw/mlx4/qp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index 74ef7a0ec0b7..651d8594dc3f 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -401,7 +401,7 @@ static int set_kernel_sq_size(struct mlx4_ib_dev *dev, struct ib_qp_cap *cap,
* We need to leave 2 KB + 1 WR of headroom in the SQ to
* allow HW to prefetch.
*/
- qp->sq_spare_wqes = (2048 >> qp->sq.wqe_shift) + 1;
+ qp->sq_spare_wqes = MLX4_IB_SQ_HEADROOM(qp->sq.wqe_shift);
qp->sq.wqe_cnt = roundup_pow_of_two(cap->max_send_wr +
qp->sq_spare_wqes);