Skip to contentSkip to conversation

IB/mlx5: Fix blue flame buffer size calculation

PATCH Applied Leon Romanovsky 2 participants 2 messages Feb 9, 2017 – Feb 14, 2017 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IB/mlx5: Fix blue flame buffer size calculation

From: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/[email protected]>

A blue flame register is comprised of two buffers of equal size.

---
Chanelog v0->v1:
* Add brackets to ensure proper calculation order.

---
 drivers/infiniband/hw/mlx5/qp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/infiniband/hw/mlx5/qp.c +4 -1
index e22d9572ae8f..04e9dbd97a3c 100644
@@ -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);

--
2.11.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20170209173147.20528-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

Applied
#2 lore raw
Quoted 5 lines · Leon Romanovsky

From: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/[email protected]>

A blue flame register is comprised of two buffers of equal size.

Fixes 5fe9dec0d0454 ("IB/mlx5: Use blue flame register allocator in
Quoted 8 lines

mlx5_ib")

---
 Chanelog v0->v1:
 * Add brackets to ensure proper calculation order.

Thanks, applied.

Signature · 4 lines
Doug Ledford <[email protected]>
    GPG KeyID: B826A3330E572FDD
   
Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD