[ofa-general] [PATCH 1/5][v2.0] dapl: add provider specific attribute query option for IB UD MTU size

Arlin Davis arlin.r.davis at intel.com
Wed Sep 24 13:43:55 PDT 2008



Signed-off by: Arlin Davis ardavis at ichips.intel.com
---
 dapl/common/dapl_adapter_util.h      |    1 +
 dapl/common/dapl_ia_query.c          |    2 +-
 dapl/openib_cma/dapl_ib_util.c       |    2 ++
 dapl/openib_scm/dapl_ib_util.c       |   28 +++++++++++++++++++++++++++-
 dapl/openib_scm/dapl_ib_util.h       |    2 ++
 dat/include/dat2/dat_ib_extensions.h |    5 +++--
 6 files changed, 36 insertions(+), 4 deletions(-)

diff --git a/dapl/common/dapl_adapter_util.h b/dapl/common/dapl_adapter_util.h
index 43175a9..c5bf5da 100755
--- a/dapl/common/dapl_adapter_util.h
+++ b/dapl/common/dapl_adapter_util.h
@@ -246,6 +246,7 @@ int dapls_ib_private_data_size (
 
 void 
 dapls_query_provider_specific_attr(
+   	IN DAPL_IA			*ia_ptr,
 	IN DAT_PROVIDER_ATTR		*provider_attr );
 
 #ifdef CQ_WAIT_OBJECT
diff --git a/dapl/common/dapl_ia_query.c b/dapl/common/dapl_ia_query.c
index a8c39a3..6c1bf14 100755
--- a/dapl/common/dapl_ia_query.c
+++ b/dapl/common/dapl_ia_query.c
@@ -172,7 +172,7 @@ dapl_ia_query (
 	/*
 	 *  Query for provider specific attributes
 	 */
-	dapls_query_provider_specific_attr(provider_attr);
+	dapls_query_provider_specific_attr(ia_ptr, provider_attr);
 
 	/*
 	 * Set up evd_stream_merging_supported options. Note there is
diff --git a/dapl/openib_cma/dapl_ib_util.c b/dapl/openib_cma/dapl_ib_util.c
index a8e1fe3..72d8237 100755
--- a/dapl/openib_cma/dapl_ib_util.c
+++ b/dapl/openib_cma/dapl_ib_util.c
@@ -963,8 +963,10 @@ DAT_NAMED_ATTR	ib_attrs[] = {
 #define SPEC_ATTR_SIZE( x )	(sizeof( x ) / sizeof( DAT_NAMED_ATTR))
 
 void dapls_query_provider_specific_attr(
+	IN DAPL_IA		*ia_ptr,
 	IN DAT_PROVIDER_ATTR	*attr_ptr )
 {
     attr_ptr->num_provider_specific_attr = SPEC_ATTR_SIZE(ib_attrs);
     attr_ptr->provider_specific_attr     = ib_attrs;
 }
+
diff --git a/dapl/openib_scm/dapl_ib_util.c b/dapl/openib_scm/dapl_ib_util.c
index 58c9943..92b45d5 100644
--- a/dapl/openib_scm/dapl_ib_util.c
+++ b/dapl/openib_scm/dapl_ib_util.c
@@ -76,6 +76,18 @@ enum ibv_mtu dapl_ib_mtu(int mtu)
 	}
 }
 
+char *dapl_ib_mtu_str(enum ibv_mtu mtu)
+{
+	switch (mtu) {
+	case IBV_MTU_256:  return "256";
+	case IBV_MTU_512:  return "512";
+	case IBV_MTU_1024: return "1024";
+	case IBV_MTU_2048: return "2048";
+	case IBV_MTU_4096: return "4096";
+	default:           return "1024";
+	}
+}
+
 /* just get IP address for hostname */
 DAT_RETURN getipaddr( char *addr, int addr_len)
 {
@@ -475,6 +487,11 @@ DAT_RETURN dapls_ib_query_hca (
 			DAPL_MAX(dev_attr.local_ca_ack_delay,
 				 hca_ptr->ib_trans.ack_timer);
 
+		/* set MTU in transport specific named attribute */
+		hca_ptr->ib_trans.named_attr.name = "DAT_IB_TRANSPORT_MTU";
+		hca_ptr->ib_trans.named_attr.value = 
+			dapl_ib_mtu_str(hca_ptr->ib_trans.mtu);
+
 		dapl_dbg_log (DAPL_DBG_TYPE_UTIL, 
 			" query_hca: (%x.%x) ep %d ep_q %d evd %d"
 			" evd_q %d mtu %d\n", 
@@ -588,6 +605,9 @@ DAT_RETURN dapls_ib_setup_async_callback (
  *      void
  */
 DAT_NAMED_ATTR  ib_attrs[] = {
+    {
+	"DAT_IB_TRANSPORT_MTU", "1024"
+    },
 #ifdef DAT_EXTENSIONS
     {
         "DAT_EXTENSION_INTERFACE", "TRUE"
@@ -610,9 +630,15 @@ DAT_NAMED_ATTR  ib_attrs[] = {
 #define SPEC_ATTR_SIZE( x )     (sizeof( x ) / sizeof( DAT_NAMED_ATTR))
 
 void dapls_query_provider_specific_attr(
+	IN DAPL_IA		*ia_ptr,
         IN DAT_PROVIDER_ATTR    *attr_ptr )
 {
     attr_ptr->num_provider_specific_attr = SPEC_ATTR_SIZE(ib_attrs);
-    attr_ptr->provider_specific_attr     = ib_attrs;
+    attr_ptr->provider_specific_attr = ib_attrs;
+
+    /* set MTU to actual settings */
+    ib_attrs[0].value = ia_ptr->hca_ptr->ib_trans.named_attr.value;
 }
 
+
+
diff --git a/dapl/openib_scm/dapl_ib_util.h b/dapl/openib_scm/dapl_ib_util.h
index f0230b8..863da2b 100644
--- a/dapl/openib_scm/dapl_ib_util.h
+++ b/dapl/openib_scm/dapl_ib_util.h
@@ -197,6 +197,7 @@ typedef struct ibv_comp_channel *ib_wait_obj_handle_t;
 #define	IB_MAX_REJ_PDATA_SIZE	148
 #define	IB_MAX_DREQ_PDATA_SIZE	220
 #define	IB_MAX_DREP_PDATA_SIZE	224
+#define	IB_MAX_RTU_PDATA_SIZE	224
 
 /* DTO OPs, ordered for DAPL ENUM definitions */
 #define OP_RDMA_WRITE           IBV_WR_RDMA_WRITE
@@ -307,6 +308,7 @@ typedef struct _ib_hca_transport
 	uint8_t			hop_limit;
 	uint8_t			tclass;
 	uint8_t			mtu;
+	DAT_NAMED_ATTR		named_attr;
 } ib_hca_transport_t;
 
 /* provider specfic fields for shared memory support */
diff --git a/dat/include/dat2/dat_ib_extensions.h b/dat/include/dat2/dat_ib_extensions.h
index 27af51e..eb10714 100755
--- a/dat/include/dat2/dat_ib_extensions.h
+++ b/dat/include/dat2/dat_ib_extensions.h
@@ -108,8 +108,9 @@ typedef enum dat_ib_ext_type
 	DAT_IB_RECV_IMMED_DATA,		// 4
 	DAT_IB_UD_CONNECT_REQUEST,	// 5
 	DAT_IB_UD_REMOTE_AH,		// 6
-	DAT_IB_UD_SEND,			// 7
-	DAT_IB_UD_RECV			// 8
+	DAT_IB_UD_PASSIVE_REMOTE_AH,	// 7
+	DAT_IB_UD_SEND,			// 8
+	DAT_IB_UD_RECV			// 9
 
 } DAT_IB_EXT_TYPE;
 
-- 
1.5.2.5






More information about the general mailing list