[ofa-general] [PATCH] libmlx4: WQE shift calculation

Eli Cohen eli at mellanox.co.il
Mon May 14 05:17:52 PDT 2007


For RC QPs we need to add atomic header size when calculating a WQE
size.

Found by Dotan Barak at Mellanox
Signed-off-by: Eli Cohen <eli at mellanox.co.il>

---

Rolland,
the code that calculates WQ size is quite different between kernel and
user. I think that writing the code in a way that will allow to copy it
as is between kernel and user is in place. Would like me to send such a
patch?

Index: connectx_user/src/userspace/libmlx4/src/qp.c
===================================================================
--- connectx_user.orig/src/userspace/libmlx4/src/qp.c	2007-05-14 17:43:10.000000000 +0300
+++ connectx_user/src/userspace/libmlx4/src/qp.c	2007-05-14 17:44:04.000000000 +0300
@@ -439,7 +439,8 @@ int mlx4_alloc_qp_buf(struct ibv_pd *pd,
 		break;
 
 	case IBV_QPT_RC:
-		size += sizeof (struct mlx4_wqe_raddr_seg);
+		size += sizeof (struct mlx4_wqe_raddr_seg) +
+			sizeof (struct mlx4_wqe_atomic_seg);
 		/*
 		 * An atomic op will require an atomic segment, a
 		 * remote address segment and one scatter entry.




More information about the general mailing list