[openib-general] [PATCH][uDAPL] openib_scm uses incorrect rd_atomic values for modify_qp

Arlin Davis arlin.r.davis at intel.com
Wed Dec 14 11:56:02 PST 2005


James,

Here is a fix for openib socket cm version. I ran into a problem with the latest verbs qp_modify as
a result of incorrect rd_atomic values so I modified to use the values returned from the
ibv_query_device() instead of hard coded values.

-arlin

Signed-off by: Arlin Davis <ardavis at ichips.intel.com>

Index: dapl/openib_scm/dapl_ib_qp.c
===================================================================
--- dapl/openib_scm/dapl_ib_qp.c	(revision 4464)
+++ dapl/openib_scm/dapl_ib_qp.c	(working copy)
@@ -300,10 +300,11 @@ dapls_modify_qp_state ( IN ib_qp_handle_
 {
 	struct ibv_qp_attr	qp_attr;
 	enum ibv_qp_attr_mask	mask = IBV_QP_STATE;
-		
+	DAPL_EP	*ep_ptr = (DAPL_EP*)qp_handle->qp_context;
+			
 	dapl_os_memzero((void*)&qp_attr, sizeof(qp_attr));
 	qp_attr.qp_state = qp_state;
-	
+
 	switch (qp_state) {
 		/* additional attributes with RTR and RTS */
 		case IBV_QPS_RTR:
@@ -318,17 +319,21 @@ dapls_modify_qp_state ( IN ib_qp_handle_
 			qp_attr.path_mtu 		= IBV_MTU_1024;
 			qp_attr.dest_qp_num 		= qp_cm->qpn;
 			qp_attr.rq_psn 			= 1;
-			qp_attr.max_dest_rd_atomic	= 8;
+			qp_attr.max_dest_rd_atomic	= 
+				ep_ptr->param.ep_attr.max_rdma_read_out;
 			qp_attr.min_rnr_timer		= 12;
 			qp_attr.ah_attr.is_global	= 0;
 			qp_attr.ah_attr.dlid		= qp_cm->lid;
 			qp_attr.ah_attr.sl		= 0;
 			qp_attr.ah_attr.src_path_bits	= 0;
 			qp_attr.ah_attr.port_num	= qp_cm->port;
-
+			
 			dapl_dbg_log (DAPL_DBG_TYPE_EP,
-			      " modify_qp_rtr: qpn %x lid %x port %x\n",
-			      qp_cm->qpn,qp_cm->lid,qp_cm->port );
+			      " modify_qp_rtr: qpn %x lid %x "
+			      "port %x rd_atomic %d\n",
+			      qp_cm->qpn, qp_cm->lid, qp_cm->port,
+			      qp_attr.max_dest_rd_atomic );
+
 			break;
 		}		
 		case IBV_QPS_RTS: 
@@ -343,9 +348,11 @@ dapls_modify_qp_state ( IN ib_qp_handle_
 			qp_attr.retry_cnt	= 7;
 			qp_attr.rnr_retry	= 7;
 			qp_attr.sq_psn		= 1;
-			qp_attr.max_rd_atomic	= 8;
+			qp_attr.max_rd_atomic	= 
+				ep_ptr->param.ep_attr.max_rdma_read_out;
+
 			dapl_dbg_log (DAPL_DBG_TYPE_EP,
-			      " modify_qp_rts: psn %x or %x\n",
+			      " modify_qp_rts: psn %x rd_atomic %d\n",
 			      qp_attr.sq_psn, qp_attr.max_rd_atomic );
 			break;
 		}






More information about the general mailing list