[ofa-general] [PATCH] uDAPL v2: scm, cma: dat max_lmr_block_size is 32 bit, verbs max_mr_size is 64 bit

Davis, Arlin R arlin.r.davis at intel.com
Thu Apr 30 01:11:22 PDT 2009


mismatch of device attribute size restricts max_lmr_block_size to 32 bit
value. Add check, if larger then limit to 4G-1 until DAT v2 spec changes.

Consumers will need check max_lmr_virtual_address for actual max
registration block size until attribute interface changes.

Signed-off-by: Arlin Davis <arlin.r.davis at intel.com>
---
 dapl/openib_cma/dapl_ib_util.c |    9 ++++++---
 dapl/openib_scm/dapl_ib_util.c |   13 ++++++++-----
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/dapl/openib_cma/dapl_ib_util.c b/dapl/openib_cma/dapl_ib_util.c
index 1545d78..3b83ab8 100755
--- a/dapl/openib_cma/dapl_ib_util.c
+++ b/dapl/openib_cma/dapl_ib_util.c
@@ -553,7 +553,9 @@ DAT_RETURN dapls_ib_query_hca(IN DAPL_HCA * hca_ptr,
 		ia_attr->max_evd_qlen = dev_attr.max_cqe;
 		ia_attr->max_iov_segments_per_dto = dev_attr.max_sge;
 		ia_attr->max_lmrs = dev_attr.max_mr;
-		ia_attr->max_lmr_block_size = dev_attr.max_mr_size;
+		/* 32bit attribute from 64bit, 4G-1 limit, DAT v2 needs fix */
+		ia_attr->max_lmr_block_size = 
+		    (dev_attr.max_mr_size >> 32) ? ~0 : dev_attr.max_mr_size;
 		ia_attr->max_rmrs = dev_attr.max_mw;
 		ia_attr->max_lmr_virtual_address = dev_attr.max_mr_size;
 		ia_attr->max_rmr_target_address = dev_attr.max_mr_size;
@@ -583,10 +585,11 @@ DAT_RETURN dapls_ib_query_hca(IN DAPL_HCA * hca_ptr,
 #endif
 		dapl_log(DAPL_DBG_TYPE_UTIL,
 			 "dapl_query_hca: (ver=%x) ep's %d ep_q %d"
-			 " evd's %d evd_q %d\n",
+			 " evd's %d evd_q %d mr %u\n",
 			 ia_attr->hardware_version_major,
 			 ia_attr->max_eps, ia_attr->max_dto_per_ep,
-			 ia_attr->max_evds, ia_attr->max_evd_qlen);
+			 ia_attr->max_evds, ia_attr->max_evd_qlen, 
+			 ia_attr->max_lmr_block_size);
 		dapl_log(DAPL_DBG_TYPE_UTIL,
 			 "dapl_query_hca: msg %llu rdma %llu iov's %d"
 			 " lmr %d rmr %d rd_in,out %d,%d inline=%d\n",
diff --git a/dapl/openib_scm/dapl_ib_util.c b/dapl/openib_scm/dapl_ib_util.c
index 13c07c9..c95b0c2 100644
--- a/dapl/openib_scm/dapl_ib_util.c
+++ b/dapl/openib_scm/dapl_ib_util.c
@@ -546,7 +546,9 @@ DAT_RETURN dapls_ib_query_hca(IN DAPL_HCA * hca_ptr,
 		ia_attr->max_evd_qlen = dev_attr.max_cqe;
 		ia_attr->max_iov_segments_per_dto = dev_attr.max_sge;
 		ia_attr->max_lmrs = dev_attr.max_mr;
-		ia_attr->max_lmr_block_size = dev_attr.max_mr_size;
+		/* 32bit attribute from 64bit, 4G-1 limit, DAT v2 needs fix */
+		ia_attr->max_lmr_block_size = 
+		    (dev_attr.max_mr_size >> 32) ? ~0 : dev_attr.max_mr_size;
 		ia_attr->max_rmrs = dev_attr.max_mw;
 		ia_attr->max_lmr_virtual_address = dev_attr.max_mr_size;
 		ia_attr->max_rmr_target_address = dev_attr.max_mr_size;
@@ -574,7 +576,7 @@ DAT_RETURN dapls_ib_query_hca(IN DAPL_HCA * hca_ptr,
 		hca_ptr->ib_trans.named_attr.value =
 		    dapl_ib_mtu_str(hca_ptr->ib_trans.mtu);
 
-		dapl_dbg_log(DAPL_DBG_TYPE_UTIL,
+		dapl_log(DAPL_DBG_TYPE_UTIL,
 			     " query_hca: (%x.%x) ep %d ep_q %d evd %d"
 			     " evd_q %d mtu %d\n",
 			     ia_attr->hardware_version_major,
@@ -583,13 +585,14 @@ DAT_RETURN dapls_ib_query_hca(IN DAPL_HCA * hca_ptr,
 			     ia_attr->max_evds, ia_attr->max_evd_qlen,
 			     128 << hca_ptr->ib_trans.mtu);
 
-		dapl_dbg_log(DAPL_DBG_TYPE_UTIL,
+		dapl_log(DAPL_DBG_TYPE_UTIL,
 			     " query_hca: msg %llu rdma %llu iov %d lmr %d rmr %d"
-			     " ack_time %d\n",
+			     " ack_time %d mr %u\n",
 			     ia_attr->max_message_size, ia_attr->max_rdma_size,
 			     ia_attr->max_iov_segments_per_dto,
 			     ia_attr->max_lmrs, ia_attr->max_rmrs,
-			     hca_ptr->ib_trans.ack_timer);
+			     hca_ptr->ib_trans.ack_timer,
+			     ia_attr->max_lmr_block_size);
 	}
 
 	if (ep_attr != NULL) {
-- 
1.5.2.5




More information about the general mailing list