From 46155bbe0504f6bff5d9ca756bbcf5174e42ced1 Mon Sep 17 00:00:00 2001 From: Arlin Davis Date: Mon, 3 Feb 2014 19:15:57 -0800 Subject: [PATCH] ucm: add/cleanup debug log information Signed-off-by: Arlin Davis --- dapl/openib_ucm/device.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/dapl/openib_ucm/device.c b/dapl/openib_ucm/device.c index 6c8f2ec..477d760 100644 --- a/dapl/openib_ucm/device.c +++ b/dapl/openib_ucm/device.c @@ -195,6 +195,7 @@ int32_t dapls_ib_release(void) DAT_RETURN dapls_ib_open_hca(IN IB_HCA_NAME hca_name, IN DAPL_HCA * hca_ptr) { struct ibv_device **dev_list; + union dcm_addr *ucm_ia = &hca_ptr->hca_address; struct ibv_port_attr port_attr; int i; DAT_RETURN dat_status; @@ -334,12 +335,6 @@ found: hca_ptr->port_num, inet_ntoa(((struct sockaddr_in *) &hca_ptr->hca_address)->sin_addr)); - dapl_log(DAPL_DBG_TYPE_UTIL, - " open_hca: QPN 0x%x LID 0x%x GID %s\n", - ntohl(hca_ptr->ib_trans.addr.ib.qpn), - ntohs(hca_ptr->ib_trans.addr.ib.lid), - inet_ntop(AF_INET6, hca_ptr->ib_trans.addr.ib.gid, - gid_str, sizeof(gid_str))); /* save LID, GID, QPN, PORT address information, for ia_queries */ /* Set AF_INET6 to insure callee address storage of 28 bytes */ @@ -350,6 +345,13 @@ found: &hca_ptr->ib_trans.addr, sizeof(union dcm_addr)); + dapl_log(DAPL_DBG_TYPE_CM, " UCM IA: AF %d LID 0x%x QPN 0x%x GID" + " 0x" F64x ":" F64x " port %d sl %d qt %d\n", + ucm_ia->ib.family, ntohl(ucm_ia->ib.qpn), ntohs(ucm_ia->ib.lid), + (unsigned long long)ntohll(*(uint64_t*)&ucm_ia->ib.gid[0]), + (unsigned long long)ntohll(*(uint64_t*)&ucm_ia->ib.gid[8]), + ucm_ia->ib.port, ucm_ia->ib.sl, ucm_ia->ib.qp_type); + #ifdef DAT_IB_COLLECTIVES if (dapli_create_collective_service(hca_ptr)) goto bail; @@ -487,6 +489,7 @@ static int ucm_service_create(IN DAPL_HCA *hca) struct ibv_sge sge; int i, mlen = sizeof(ib_cm_msg_t); int hlen = sizeof(struct ibv_grh); /* hdr included with UD recv */ + char *rbuf; dapl_dbg_log(DAPL_DBG_TYPE_UTIL, " ucm_create: \n"); @@ -572,14 +575,14 @@ static int ucm_service_create(IN DAPL_HCA *hca) recv_wr.num_sge = 1; sge.length = mlen + hlen; sge.lkey = tp->mr_rbuf->lkey; + rbuf = tp->rbuf; for (i = 0; i < tp->qpe; i++) { - recv_wr.wr_id = - (uintptr_t)((char *)&tp->rbuf[i] + - sizeof(struct ibv_grh)); - sge.addr = (uintptr_t) &tp->rbuf[i]; + recv_wr.wr_id = (uintptr_t) (rbuf + hlen); + sge.addr = (uintptr_t) rbuf; if (ibv_post_recv(tp->qp, &recv_wr, &recv_err)) goto bail; + rbuf += sge.length; } /* save qp_num as part of ia_address, network order */ -- 2.41.0