[openib-general] [PATCH] CM: fix recording starting PSN as rq_psn, not sq_psn

Sean Hefty mshefty at ichips.intel.com
Wed Jan 26 15:33:05 PST 2005


User is currently responsible for setting the RQ PSN in the QP attributes
when transitioning to RTR.

signed-off-by: Sean Hefty <sean.hefty at intel.com>

Index: include/ib_cm.h
===================================================================
--- include/ib_cm.h	(revision 1654)
+++ include/ib_cm.h	(working copy)
@@ -329,7 +329,7 @@
 	struct ib_sa_path_rec	*primary_path;
 	struct ib_sa_path_rec	*alternate_path;
 	u64			service_id;
-	u32			starting_send_psn;
+	u32			starting_psn;
 	void			*private_data;
 	u8			private_data_len;
 	u8			peer_to_peer;
@@ -355,7 +355,7 @@
 
 struct ib_cm_rep_param {
 	struct ib_qp	*qp;
-	u32		starting_send_psn;
+	u32		starting_psn;
 	void		*private_data;
 	u8		private_data_len;
 	u8		responder_resources;
Index: core/cm.c
===================================================================
--- core/cm.c	(revision 1654)
+++ core/cm.c	(working copy)
@@ -111,8 +111,8 @@
 
 	u32 local_qpn;
 	u32 remote_qpn;
-	u32 send_psn;
-	u32 recv_psn;
+	u32 sq_psn;
+	u32 rq_psn;
 	u64 remote_ca_guid;
 	int timeout_ms;
 	u8 max_cm_retries;
@@ -708,7 +708,7 @@
 				       param->remote_cm_response_timeout);
 	cm_req_set_qp_type(req_msg, param->qp->qp_type);
 	cm_req_set_flow_ctrl(req_msg, param->flow_control);
-	cm_req_set_starting_psn(req_msg, cpu_to_be32(param->starting_send_psn));
+	cm_req_set_starting_psn(req_msg, cpu_to_be32(param->starting_psn));
 	cm_req_set_local_resp_timeout(req_msg,
 				      param->local_cm_response_timeout);
 	cm_req_set_retry_count(req_msg, param->retry_count);
@@ -825,7 +825,7 @@
 	cm_id_priv->msg->sent_state = IB_CM_REQ_SENT;
 
 	cm_id_priv->local_qpn = cm_req_get_local_qpn(req_msg);
-	cm_id_priv->send_psn = cm_req_get_starting_psn(req_msg);
+	cm_id_priv->rq_psn = cm_req_get_starting_psn(req_msg);
 	cm_id_priv->local_ack_timeout =
 				cm_req_get_primary_local_ack_timeout(req_msg);
 
@@ -1072,7 +1072,7 @@
 	cm_id_priv->remote_qpn = cm_req_get_local_qpn(req_msg);
 	cm_id_priv->initiator_depth = cm_req_get_resp_res(req_msg);
 	cm_id_priv->responder_resources = cm_req_get_init_depth(req_msg);
-	cm_id_priv->recv_psn = cm_req_get_starting_psn(req_msg);
+	cm_id_priv->sq_psn = cm_req_get_starting_psn(req_msg);
 	cm_id_priv->local_ack_timeout =
 				cm_req_get_primary_local_ack_timeout(req_msg);
 	cm_id_priv->retry_count = cm_req_get_retry_count(req_msg);
@@ -1099,7 +1099,7 @@
 	rep_msg->local_comm_id = cm_id_priv->id.local_id;
 	rep_msg->remote_comm_id = cm_id_priv->id.remote_id;
 	cm_rep_set_local_qpn(rep_msg, param->qp->qp_num);
-	cm_rep_set_starting_psn(rep_msg, param->starting_send_psn);
+	cm_rep_set_starting_psn(rep_msg, param->starting_psn);
 	rep_msg->resp_resources = param->responder_resources;
 	rep_msg->initiator_depth = param->initiator_depth;
 	cm_rep_set_target_ack_delay(rep_msg, param->target_ack_delay);
@@ -1171,8 +1171,7 @@
 	cm_id_priv->msg = msg;
 	cm_id_priv->initiator_depth = param->initiator_depth;
 	cm_id_priv->responder_resources = param->responder_resources;
-	cm_id_priv->send_psn = cpu_to_be32(param->starting_send_psn &
-					   0x00FFFFFF);
+	cm_id_priv->rq_psn = cm_rep_get_starting_psn(rep_msg);
 	spin_unlock_irqrestore(&cm_id_priv->lock, flags);
 out:
 	return ret;
@@ -1309,7 +1308,7 @@
 	cm_id_priv->remote_qpn = cm_rep_get_local_qpn(rep_msg);
 	cm_id_priv->initiator_depth = rep_msg->resp_resources;
 	cm_id_priv->responder_resources = rep_msg->initiator_depth;
-	cm_id_priv->recv_psn = cm_rep_get_starting_psn(rep_msg);
+	cm_id_priv->sq_psn = cm_rep_get_starting_psn(rep_msg);
 	cm_id_priv->rnr_retry_count = cm_rep_get_rnr_retry_count(rep_msg);
 
 	/* todo: handle peer_to_peer
@@ -2593,7 +2592,7 @@
 				IB_QP_MIN_RNR_TIMER;
 		qp_attr->ah_attr = cm_id_priv->av.ah_attr;
 		qp_attr->dest_qp_num = be32_to_cpu(cm_id_priv->remote_qpn);
-		qp_attr->rq_psn = be32_to_cpu(cm_id_priv->recv_psn);
+		qp_attr->rq_psn = be32_to_cpu(cm_id_priv->rq_psn);
 		qp_attr->max_rd_atomic = cm_id_priv->initiator_depth;
 		qp_attr->min_rnr_timer = 0;
 		if (cm_id_priv->alt_av.ah_attr.dlid) {
@@ -2630,7 +2629,7 @@
 		qp_attr->timeout = cm_id_priv->local_ack_timeout;
 		qp_attr->retry_cnt = cm_id_priv->retry_count;
 		qp_attr->rnr_retry = cm_id_priv->rnr_retry_count;
-		qp_attr->sq_psn = cm_id_priv->send_psn;
+		qp_attr->sq_psn = cm_id_priv->sq_psn;
 		qp_attr->max_dest_rd_atomic = cm_id_priv->responder_resources;
 		if (cm_id_priv->alt_av.ah_attr.dlid) {
 			*qp_attr_mask |= IB_QP_PATH_MIG_STATE;



More information about the general mailing list