During rejects, both usr and ucm internal, the qp_type does not get initialized
so the check for UD type QP messages fail on active side and the wrong
event gets generated. Initialize saddr.ib information before sending reject
back to active side.

Signed-off-by: Arlin Davis <[email protected]>
---
 dapl/openib_ucm/cm.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/dapl/openib_ucm/cm.c b/dapl/openib_ucm/cm.c
index 7ce3aab..cc480c4 100644
--- a/dapl/openib_ucm/cm.c
+++ b/dapl/openib_ucm/cm.c
@@ -304,6 +304,13 @@ static int ucm_reject(ib_hca_transport_t *tp, ib_cm_msg_t 
*msg)
        smsg.sqpn = msg->dqpn;
 
        dapl_os_memcpy(&smsg.daddr, &msg->saddr, sizeof(union dcm_addr));
+       
+       /* no dst_addr IB info in REQ, init lid, gid, get type from saddr */
+       smsg.saddr.ib.lid = tp->addr.ib.lid; 
+       smsg.saddr.ib.qp_type = msg->saddr.ib.qp_type;
+       dapl_os_memcpy(&smsg.saddr.ib.gid[0],
+                      &tp->addr.ib.gid, 16); 
+
        dapl_os_memcpy(&smsg.saddr, &msg->daddr, sizeof(union dcm_addr));
 
        dapl_dbg_log(DAPL_DBG_TYPE_CM, 
@@ -1736,10 +1743,11 @@ dapls_ib_reject_connection(IN dp_ib_cm_handle_t cm,
         if (psize > DCM_MAX_PDATA_SIZE)
                 return DAT_LENGTH_ERROR;
 
-       /* cr_thread will destroy CR, update saddr lid, gid info */
+       /* cr_thread will destroy CR, update saddr lid, gid, qp_type info */
        dapl_os_lock(&cm->lock);
        cm->state = DCM_REJECTED;
        cm->msg.saddr.ib.lid = cm->hca->ib_trans.addr.ib.lid; 
+       cm->msg.saddr.ib.qp_type = cm->msg.daddr.ib.qp_type;
        dapl_os_memcpy(&cm->msg.saddr.ib.gid[0],
                       &cm->hca->ib_trans.addr.ib.gid, 16); 
        cm->msg.op = htons(DCM_REJ_USER);
-- 
1.5.2.5

_______________________________________________
ofw mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw

Reply via email to