]> git.openfabrics.org - ~ardavis/dapl.git/commitdiff
ucm: add/cleanup debug log information
authorArlin Davis <arlin.r.davis@intel.com>
Tue, 4 Feb 2014 03:15:57 +0000 (19:15 -0800)
committerArlin Davis <arlin.r.davis@intel.com>
Tue, 4 Feb 2014 03:15:57 +0000 (19:15 -0800)
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
dapl/openib_ucm/device.c

index 6c8f2eceefbdc1fa870b415390f478adce851d11..477d76081a1a235b44c9414767698715a1ef78c9 100644 (file)
@@ -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 */