diff options
author | Eli Cohen <eli@mellanox.com> | 2017-02-09 18:31:47 +0100 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-02-14 17:44:42 +0100 |
commit | d8030b0de03ec6bdf3665e1d915fa0f02e5ec89d (patch) | |
tree | d79aee12599e074b848a9dbf1b6bb4d375d41ebc /drivers/infiniband | |
parent | IB/mlx4: Remove unused variable from function declaration (diff) | |
download | linux-d8030b0de03ec6bdf3665e1d915fa0f02e5ec89d.tar.xz linux-d8030b0de03ec6bdf3665e1d915fa0f02e5ec89d.zip |
IB/mlx5: Fix blue flame buffer size calculation
A blue flame register is comprised of two buffers of equal size.
Fixes: 5fe9dec0d0454 ("IB/mlx5: Use blue flame register allocator in mlx5_ib")
Signed-off-by: Eli Cohen <eli@mellanox.com>
Reviewed-by: Noa Osherovich <noaos@mellanox.com>
Reviewed-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/mlx5/qp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c index fbfff1269816..69a1604a887c 100644 --- a/drivers/infiniband/hw/mlx5/qp.c +++ b/drivers/infiniband/hw/mlx5/qp.c @@ -905,7 +905,10 @@ static int create_kernel_qp(struct mlx5_ib_dev *dev, else qp->bf.bfreg = &dev->bfreg; - qp->bf.buf_size = 1 << MLX5_CAP_GEN(dev->mdev, log_bf_reg_size); + /* We need to divide by two since each register is comprised of + * two buffers of identical size, namely odd and even + */ + qp->bf.buf_size = (1 << MLX5_CAP_GEN(dev->mdev, log_bf_reg_size)) / 2; uar_index = qp->bf.bfreg->index; err = calc_sq_size(dev, init_attr, qp); |