[ofa-general] [PATCH] libibverbs: initialize qp state to RESET at qp creation time

Jack Morgenstein jackm at dev.mellanox.co.il
Sun Jun 3 06:39:38 PDT 2007


Roland, libmlx4 commit af7707cecdfd5ca8a38b4d855070ebfc310a339f
(Initialize send queue entry ownership bits) is broken without
the fix below.  Since qp state is uninitialized, mlx4_qp_init_sq_ownership()
frequently ends up not being invoked.

---

Must initialize qp state to RESET at qp creation time.

Signed-off-by: Jack Morgenstein <jackm at dev.mellanox.co.il>

diff --git a/src/verbs.c b/src/verbs.c
index febf32a..f5cf4d3 100644
--- a/src/verbs.c
+++ b/src/verbs.c
@@ -406,6 +406,7 @@ struct ibv_qp *__ibv_create_qp(struct ibv_pd *pd,
 		qp->recv_cq    	     = qp_init_attr->recv_cq;
 		qp->srq        	     = qp_init_attr->srq;
 		qp->qp_type          = qp_init_attr->qp_type;
+		qp->state	     = IBV_QPS_RESET;
 		qp->events_completed = 0;
 		pthread_mutex_init(&qp->mutex, NULL);
 		pthread_cond_init(&qp->cond, NULL);



More information about the general mailing list