[ofw] [PATCH 11/13] DAPL v2.0: ucm: incorrectly sends user reject during CR callback errors
Davis, Arlin R
arlin.r.davis at intel.com
Fri Jan 13 15:55:48 PST 2012
Add reason checking on provider rejects and set appropriate op type
in reject message. Reject can be called from cr callback during
failures. User reject will be IB_CM_REJ_REASON_CONSUMER_REJ.
Add warning message on active side.
Signed-off-by: Arlin Davis <arlin.r.davis at intel.com>
---
dapl/openib_ucm/cm.c | 34 ++++++++++++++++++++++++++--------
1 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/dapl/openib_ucm/cm.c b/dapl/openib_ucm/cm.c
index 762bd66..6efcad2 100644
--- a/dapl/openib_ucm/cm.c
+++ b/dapl/openib_ucm/cm.c
@@ -402,11 +402,12 @@ static void ucm_process_recv(ib_hca_transport_t *tp,
break;
default:
dapl_log(DAPL_DBG_TYPE_WARN,
- " ucm_recv: UNKNOWN state"
- " <- op %s, %s spsp %x sqpn %x\n",
- dapl_cm_op_str(ntohs(msg->op)),
- dapl_cm_state_str(cm->state),
- ntohs(msg->sport), ntohl(msg->sqpn));
+ " ucm_recv: Warning, UNKNOWN state"
+ " <- op %s, %s spsp %x sqpn %x slid %x\n",
+ dapl_cm_op_str(ntohs(msg->op)),
+ dapl_cm_state_str(cm->state),
+ ntohs(msg->sport), ntohl(msg->sqpn),
+ ntohs(msg->saddr.ib.lid));
dapl_os_unlock(&cm->lock);
break;
}
@@ -1065,9 +1066,19 @@ static void ucm_connect_rtu(dp_ib_cm_handle_t cm, ib_cm_msg_t *msg)
event = IB_CME_CONNECTED;
else if (ntohs(msg->op) == DCM_REJ_USER)
event = IB_CME_DESTINATION_REJECT_PRIVATE_DATA;
- else
+ else {
+ dapl_log(DAPL_DBG_TYPE_WARN,
+ " Warning, non-user CR REJECT:"
+ " cm %p op %s, st %s dlid %x iqp %x port %x <-"
+ " slid %x iqp %x port %x\n", cm,
+ dapl_cm_op_str(ntohs(msg->op)),
+ dapl_cm_state_str(cm->state),
+ ntohs(msg->daddr.ib.lid), ntohl(msg->daddr.ib.qpn),
+ ntohs(msg->dport), ntohs(msg->saddr.ib.lid),
+ ntohl(msg->saddr.ib.qpn), ntohs(msg->sport));
+
event = IB_CME_DESTINATION_REJECT;
-
+ }
if (event != IB_CME_CONNECTED) {
dapl_log(DAPL_DBG_TYPE_CM,
" ACTIVE: CM_REQ REJECTED:"
@@ -1203,6 +1214,9 @@ ud_bail:
(DAT_COUNT)ntohs(cm->msg.p_size),
(DAT_PVOID *)cm->msg.p_data,
(DAT_PVOID *)&xevent);
+
+ if (event != DAT_IB_UD_CONNECTION_EVENT_ESTABLISHED)
+ dapli_cm_free(cm);
} else
#endif
{
@@ -1942,8 +1956,12 @@ dapls_ib_reject_connection(IN dp_ib_cm_handle_t cm,
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);
+ if (reason == IB_CM_REJ_REASON_CONSUMER_REJ)
+ cm->msg.op = htons(DCM_REJ_USER);
+ else
+ cm->msg.op = htons(DCM_REJ_CM);
+
if (ucm_send(&cm->hca->ib_trans, &cm->msg, pdata, psize)) {
dapl_log(DAPL_DBG_TYPE_WARN,
" cm_reject: send ERR: %s\n", strerror(errno));
--
1.7.3
More information about the ofw
mailing list