[ewg] [PATCH] ib_send_bw -b can hang due to too few CQ entries

Ralph Campbell ralph.campbell at qlogic.com
Thu Aug 6 12:48:10 PDT 2009


When ib_send_bw is run in bi-directional mode (-b), it doesn't
create enough completion queue entries for both the send *and*
the receive completions. Thus, CQ entries are lost due to the
queue being full and the test can hang.

Signed-off-by: Ralph Campbell <ralph.campbell at qlogic.com>

diff --git a/send_bw.c b/send_bw.c
index f842fb9..d5c4e63 100755
--- a/send_bw.c
+++ b/send_bw.c
@@ -489,7 +489,8 @@ static struct pingpong_context *pp_init_ctx(struct ibv_device *ib_dev,
 		}
 	}
 
-	ctx->cq = ibv_create_cq(ctx->context, ctx->rx_depth, NULL, ctx->channel, 0);
+	ctx->cq = ibv_create_cq(ctx->context, ctx->tx_depth + ctx->rx_depth,
+				NULL, ctx->channel, 0);
 	if (!ctx->cq) {
 		fprintf(stderr, "Couldn't create CQ\n");
 		return NULL;





More information about the ewg mailing list