From: Sean Hefty Date: Thu, 27 Sep 2012 17:38:04 +0000 (-0700) Subject: Refresh of xrc_sample X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=c290d85bfc6b3da8d4eab1b802ad9935746d9a79;p=~shefty%2Flibibverbs.git Refresh of xrc_sample --- diff --git a/examples/xsrq_pingpong.c b/examples/xsrq_pingpong.c index a1763d3..f6520fb 100644 --- a/examples/xsrq_pingpong.c +++ b/examples/xsrq_pingpong.c @@ -143,7 +143,7 @@ static int create_qps(void) init.comp_mask = IBV_QP_INIT_ATTR_XRCD; init.xrcd = ctx.xrcd; - ctx.recv_qp[i] = ibv_create_qp_ex(ctx.pd, &init); + ctx.recv_qp[i] = ibv_create_qp_ex(ctx.context, &init); if (!ctx.recv_qp[i]) { fprintf(stderr, "Couldn't create recv QP[%d] errno %d\n", i, errno); @@ -164,11 +164,12 @@ static int create_qps(void) memset(&init, 0, sizeof init); init.qp_type = IBV_QPT_XRC_SEND; + init.pd = ctx.pd; init.send_cq = ctx.send_cq; init.cap.max_send_wr = ctx.num_clients * ctx.num_tests; init.cap.max_send_sge = 1; - ctx.send_qp[i] = ibv_create_qp_ex(ctx.pd, &init); + ctx.send_qp[i] = ibv_create_qp_ex(ctx, &init); if (!ctx.send_qp[i]) { fprintf(stderr, "Couldn't create send QP[%d] errno %d\n", i, errno); @@ -303,11 +304,11 @@ static int send_local_dest(int sockfd, int index) printf(ADDR_FORMAT, "local", ctx.lid, ctx.recv_qp[index]->qp_num, ctx.send_qp[index]->qp_num, ctx.rem_dest[index].recv_psn, - ctx.srq->srq_num); + ibv_get_srq_num(ctx.srq)); sprintf(msg, MSG_FORMAT, ctx.lid, ctx.recv_qp[index]->qp_num, ctx.send_qp[index]->qp_num, ctx.rem_dest[index].recv_psn, - ctx.srq->srq_num); + ibv_get_srq_num(ctx.srq)); if (write(sockfd, msg, MSG_SIZE) != MSG_SIZE) { fprintf(stderr, "Couldn't send local address\n");