]> git.openfabrics.org - ~ardavis/dapl.git/commitdiff
mcm: mpxyd error event of m_pi_prep_rcv_q: ERR: ib_qp == 0
authorArlin Davis <arlin.r.davis@intel.com>
Fri, 16 May 2014 16:21:26 +0000 (09:21 -0700)
committerArlin Davis <arlin.r.davis@intel.com>
Fri, 16 May 2014 16:21:26 +0000 (09:21 -0700)
When incorrect ep_mode is provided by consumer the proxy-in
service modes get setup incorrectly. Validate remote address
ep mode, set to unknown if out of range.

Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
dapl/openib_mcm/cm.c
dapl/openib_ucm/cm.c

index 35c82c49bf4f6c37a3a7950c999df678e7952a62..d41ca09f349868c50deb1d8e113bd0b318a6e59a 100644 (file)
@@ -986,12 +986,12 @@ dapli_cm_connect(DAPL_EP *ep, dp_ib_cm_handle_t cm)
        dapl_log(DAPL_DBG_TYPE_CM,
                 " MCM connect: lid %x QPr %x QPt %x lport %x p_sz=%d -> "
                 " lid %x c_qpn %x rport %x ep_map %d %s -> %d %s, retries=%d\n",
-                htons(cm->msg.saddr1.lid), htonl(cm->msg.saddr1.qpn),
+                htons(cm->tp->addr.lid), htonl(cm->msg.saddr1.qpn),
                 htonl(cm->msg.saddr2.qpn),
                 htons(cm->msg.sport), htons(cm->msg.p_size),
                 htons(cm->msg.daddr1.lid), htonl(cm->msg.dqpn),
                 htons(cm->msg.dport),
-                cm->msg.saddr1.ep_map, mcm_map_str(cm->msg.saddr1.ep_map),
+                cm->tp->addr.ep_map, mcm_map_str(cm->tp->addr.ep_map),
                 cm->msg.daddr1.ep_map, mcm_map_str(cm->msg.daddr1.ep_map),
                 cm->tp->retries);
 
@@ -1611,7 +1611,7 @@ dapls_ib_connect(IN DAT_EP_HANDLE ep_handle,
        
        dapl_log(DAPL_DBG_TYPE_CM, " MCM connect -> AF %d LID 0x%x QPN 0x%x GID"
                 " 0x" F64x ":" F64x " port %d ep_map %s sl %d qt %d\n",
-                mcm_ia->family, ntohl(mcm_ia->qpn), ntohs(mcm_ia->lid),
+                mcm_ia->family, ntohs(mcm_ia->lid), ntohl(mcm_ia->qpn),
                 (unsigned long long)ntohll(*(uint64_t*)&mcm_ia->gid[0]),
                 (unsigned long long)ntohll(*(uint64_t*)&mcm_ia->gid[8]),
                 mcm_ia->port, mcm_map_str(mcm_ia->ep_map),
@@ -1625,6 +1625,10 @@ dapls_ib_connect(IN DAT_EP_HANDLE ep_handle,
        /* remote hca and port: lid, gid, network order */
        dapl_os_memcpy(&cm->msg.daddr1, r_addr, sizeof(struct dat_mcm_addr));
 
+       /* validate port and ep_map range */
+       if ((mcm_ia->port > 2) || (mcm_ia->ep_map > 3))
+               cm->msg.daddr1.ep_map = 0;
+
        /* remote uCM information, comes from consumer provider r_addr */
        cm->msg.dport = htons((uint16_t)r_psp);
        cm->msg.dqpn = cm->msg.daddr1.qpn;
index 745de8dae9629112e1f32a7614ef18848f2d3859..a1e909a32a0eb27f3c1ac6670a4f9a7fb5409055 100644 (file)
@@ -1715,7 +1715,7 @@ dapls_ib_connect(IN DAT_EP_HANDLE ep_handle,
 
        dapl_log(DAPL_DBG_TYPE_CM, " UCM connect -> 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),
+                ucm_ia->ib.family, ntohs(ucm_ia->ib.lid), ntohl(ucm_ia->ib.qpn),
                 (unsigned long long)ntohll(*(uint64_t*)&ucm_ia->ib.gid[0]),
                 (unsigned long long)ntohll(*(uint64_t*)&ucm_ia->ib.gid[8]),
                 ntohs(ucm_ia->ib.port), ucm_ia->ib.sl, ucm_ia->ib.qp_type);