diff mbox

some dapl assistance - [PATCH] dapl-2.0 improperly handles pkey check/query in host order

Message ID E3280858FA94444CA49D2BA02341C983010D14039A@orsmsx506.amr.corp.intel.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Arlin Davis July 19, 2010, 7:04 p.m. UTC
None
diff mbox

Patch

diff --git a/dapl/openib_common/util.c b/dapl/openib_common/util.c
index a69261f..73730ef 100644
--- a/dapl/openib_common/util.c
+++ b/dapl/openib_common/util.c
@@ -326,7 +326,7 @@  DAT_RETURN dapls_ib_query_hca(IN DAPL_HCA * hca_ptr,
 
                /* set SL, PKEY values, defaults = 0 */
                hca_ptr->ib_trans.pkey_idx = 0;
-               hca_ptr->ib_trans.pkey = dapl_os_get_env_val("DAPL_IB_PKEY", 0);
+               hca_ptr->ib_trans.pkey = htons(dapl_os_get_env_val("DAPL_IB_PKEY", 0));
                hca_ptr->ib_trans.sl = dapl_os_get_env_val("DAPL_IB_SL", 0);
 
 		/* index provided, get pkey; pkey provided, get index */
@@ -345,10 +345,10 @@  DAT_RETURN dapls_ib_query_hca(IN DAPL_HCA * hca_ptr,
 				}
 			}
 			if (i == dev_attr.max_pkeys) {
-				dapl_log(DAPL_DBG_TYPE_WARN,
-					 " Warning: new pkey(%d), query (%s)"
-					 " err or key !found, using defaults\n",
-					 hca_ptr->ib_trans.pkey, strerror(errno));
+				dapl_log(DAPL_DBG_TYPE_ERR,
+					 " ERR: new pkey(0x%x), query (%s)"
+					 " err or key !found, using default pkey_idx=0\n",
+					 ntohs(hca_ptr->ib_trans.pkey), strerror(errno));
 			}
 		}
 skip_ib: