[openib-general] [PATCH] CM PSN byte ordering
Sean Hefty
mshefty at ichips.intel.com
Thu Feb 3 11:35:36 PST 2005
Patch fixes PSN byte ordering issues in the CM.
Signed-off-by: Sean Hefty <sean.hefty at intel.com>
Index: core/cm.c
===================================================================
--- core/cm.c (revision 1725)
+++ core/cm.c (working copy)
@@ -1104,7 +1104,7 @@ static void cm_format_rep(struct cm_rep_
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, cpu_to_be32(param->qp->qp_num));
- cm_rep_set_starting_psn(rep_msg, param->starting_psn);
+ cm_rep_set_starting_psn(rep_msg, cpu_to_be32(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);
@@ -2718,7 +2718,7 @@ static int cm_init_qp_rts_attr(struct cm
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->sq_psn;
+ qp_attr->sq_psn = be32_to_cpu(cm_id_priv->sq_psn);
qp_attr->max_rd_atomic = cm_id_priv->initiator_depth;
if (cm_id_priv->alt_av.ah_attr.dlid) {
*qp_attr_mask |= IB_QP_PATH_MIG_STATE;
Index: core/cm_msgs.h
===================================================================
--- core/cm_msgs.h (revision 1720)
+++ core/cm_msgs.h (working copy)
@@ -210,7 +210,7 @@ static inline void cm_req_set_flow_ctrl(
static inline u32 cm_req_get_starting_psn(struct cm_req_msg *req_msg)
{
- return be32_to_cpu(req_msg->offset44) >> 8;
+ return cpu_to_be32(be32_to_cpu(req_msg->offset44) >> 8);
}
static inline void cm_req_set_starting_psn(struct cm_req_msg *req_msg,
More information about the general
mailing list