[PATCH] opensm/libvendor: Fix compile warnings on 64 bit machines when building --with-osmv=sim

2011-06-02 Thread Hal Rosenstock

osm_vendor_mlx.c: In function '__osmv_get_send_txn':
osm_vendor_mlx.c:708: warning: format '%llX' expects type 'long long unsigned 
int', but argument 4 has type 'uint64_t'
osm_vendor_mlx.c:723: warning: format '%llX' expects type 'long long unsigned 
int', but argument 4 has type 'uint64_t'
osm_vendor_mlx.c:733: warning: format '%llX' expects type 'long long unsigned 
int', but argument 4 has type 'uint64_t'
osm_vendor_mlx.c:746: warning: format '%llX' expects type 'long long unsigned 
int', but argument 4 has type 'uint64_t'

osm_vendor_mlx_hca_sim.c: In function '__parse_ca_info_file':
osm_vendor_mlx_hca_sim.c:268: warning: format '%016llx' expects type 'long long 
unsigned int', but argument 5 has type 'uint64_t'

osm_vendor_mlx_dispatcher.c: In function '__osmv_dispatch_route':
osm_vendor_mlx_dispatcher.c:208: warning: format '%llX' expects type 'long long 
unsigned int', but argument 4 has type 'uint64_t'
osm_vendor_mlx_dispatcher.c:221: warning: format '%llX' expects type 'long long 
unsigned int', but argument 4 has type 'uint64_t'
osm_vendor_mlx_dispatcher.c: In function '__osmv_dispatch_simple_mad':
osm_vendor_mlx_dispatcher.c:276: warning: format '%llX' expects type 'long long 
unsigned int', but argument 4 has type 'long unsigned int'
osm_vendor_mlx_dispatcher.c: In function '__osmv_dispatch_rmpp_mad':
osm_vendor_mlx_dispatcher.c:331: warning: format '%llX' expects type 'long long 
unsigned int', but argument 4 has type 'uint64_t'
osm_vendor_mlx_dispatcher.c: In function '__osmv_dispatch_rmpp_rcv':
osm_vendor_mlx_dispatcher.c:570: warning: format '%llX' expects type 'long long 
unsigned int', but argument 4 has type 'uint64_t'
osm_vendor_mlx_dispatcher.c:624: warning: format '%llX' expects type 'long long 
unsigned int', but argument 5 has type 'uint64_t'
osm_vendor_mlx_dispatcher.c:629: warning: format '%llX' expects type 'long long 
unsigned int', but argument 4 has type 'long unsigned int'
osm_vendor_mlx_dispatcher.c: In function '__osmv_dispatch_accept_seg':
osm_vendor_mlx_dispatcher.c:661: warning: format '%llX' expects type 'long long 
unsigned int', but argument 4 has type 'uint64_t'
osm_vendor_mlx_dispatcher.c:674: warning: format '%llX' expects type 'long long 
unsigned int', but argument 4 has type 'uint64_t'

osm_vendor_mlx_sender.c: In function '__osmv_rmpp_send_segment':
osm_vendor_mlx_sender.c:345: warning: format '%llX' expects type 'long long 
unsigned int', but argument 5 has type 'ib_net64_t'

Signed-off-by: Hal Rosenstock h...@mellanox.com
---
diff --git a/libvendor/osm_vendor_mlx.c b/libvendor/osm_vendor_mlx.c
index 9ae59a9..7a40fa5 100644
--- a/libvendor/osm_vendor_mlx.c
+++ b/libvendor/osm_vendor_mlx.c
@@ -704,7 +704,7 @@ __osmv_get_send_txn(IN osm_bind_handle_t h_bind,
if (IB_SUCCESS != ret) {
osm_log(p_bo-p_vendor-p_log, OSM_LOG_ERROR,
__osmv_get_send_txn: ERR 7313: 
-   The transaction id=0x%llX failed to init.\n,
+   The transaction id=0x% PRIx64  failed to 
init.\n,
tid);
goto get_send_txn_done;
}
@@ -719,7 +719,7 @@ __osmv_get_send_txn(IN osm_bind_handle_t h_bind,
|| FALSE == osmv_txn_is_rmpp_init_by_peer(*pp_txn)) {
osm_log(p_bo-p_vendor-p_log, OSM_LOG_ERROR,
__osmv_get_send_txn: ERR 7314: 
-   The transaction id=0x%llX is not unique. Send 
failed.\n,
+   The transaction id=0x% PRIx64  is not 
unique. Send failed.\n,
tid);
 
ret = IB_INVALID_SETTING;
@@ -729,7 +729,7 @@ __osmv_get_send_txn(IN osm_bind_handle_t h_bind,
if (TRUE == resp_expected) {
osm_log(p_bo-p_vendor-p_log, OSM_LOG_ERROR,
__osmv_get_send_txn: ERR 7315: 
-   The transaction id=%llX can't expect a 
response. Send failed.\n,
+   The transaction id=0x% PRIx64  can't expect 
a response. Send failed.\n,
tid);
 
ret = IB_INVALID_PARAMETER;
@@ -742,7 +742,7 @@ __osmv_get_send_txn(IN osm_bind_handle_t h_bind,
if (IB_SUCCESS != ret) {
osm_log(p_bo-p_vendor-p_log, OSM_LOG_ERROR,
__osmv_get_send_txn: ERR 7316: 
-   The transaction id=%llX failed to init the 
rmpp mad. Send failed.\n,
+   The transaction id=0x% PRIx64  failed to 
init the rmpp mad. Send failed.\n,
tid);
osmv_txn_done(h_bind, tid, FALSE);
goto get_send_txn_done;
diff --git a/libvendor/osm_vendor_mlx_dispatcher.c 
b/libvendor/osm_vendor_mlx_dispatcher.c
index fa5fc1f..ba6c4e8 

[PATCH] opensm/osm_switch.c: In switch_find_guid_common, handle NULL parameter

2011-06-02 Thread Hal Rosenstock

Since port-priv can be NULL, struct osm_remote_guids_count * supplied
can be NULL so handle this.

Signed-off-by: Hal Rosenstock h...@mellanox.com
---
diff --git a/opensm/osm_switch.c b/opensm/osm_switch.c
index 9785a9d..fbb8292 100644
--- a/opensm/osm_switch.c
+++ b/opensm/osm_switch.c
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.
- * Copyright (c) 2002-2009 Mellanox Technologies LTD. All rights reserved.
+ * Copyright (c) 2002-2011 Mellanox Technologies LTD. All rights reserved.
  * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
  * Copyright (c) 2009 HNR Consulting. All rights reserved.
  *
@@ -177,6 +177,9 @@ switch_find_guid_common(IN const osm_switch_t * p_sw,
 
CL_ASSERT(p_sw);
 
+   if (!r)
+   goto out;
+
p_physp = osm_node_get_physp_ptr(p_sw-p_node, port_num);
p_rem_physp = osm_physp_get_remote(p_physp);
p_rem_node = osm_physp_get_node_ptr(p_rem_physp);
@@ -193,6 +196,7 @@ switch_find_guid_common(IN const osm_switch_t * p_sw,
}
}
 
+out:
return p_remote_guid;
 }
 
--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] opensm/osm_ucast_ftree.c: Handle [sw hca]_create failures

2011-06-02 Thread Hal Rosenstock

Signed-off-by: Hal Rosenstock h...@mellanox.com
---
diff --git a/opensm/osm_ucast_ftree.c b/opensm/osm_ucast_ftree.c
index 51e252a..477f883 100644
--- a/opensm/osm_ucast_ftree.c
+++ b/opensm/osm_ucast_ftree.c
@@ -2,7 +2,7 @@
  * Copyright (c) 2009 Simula Research Laboratory. All rights reserved.
  * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
  * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.
- * Copyright (c) 2002-2009 Mellanox Technologies LTD. All rights reserved.
+ * Copyright (c) 2002-2011 Mellanox Technologies LTD. All rights reserved.
  * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -1050,10 +1050,14 @@ static uint8_t fabric_get_rank(ftree_fabric_t * p_ftree)
 
 static void fabric_add_hca(ftree_fabric_t * p_ftree, osm_node_t * p_osm_node)
 {
-   ftree_hca_t *p_hca = hca_create(p_osm_node);
+   ftree_hca_t *p_hca;
 
CL_ASSERT(osm_node_get_type(p_osm_node) == IB_NODE_TYPE_CA);
 
+   p_hca = hca_create(p_osm_node);
+   if (!p_hca)
+   return;
+
cl_qmap_insert(p_ftree-hca_tbl, p_osm_node-node_info.node_guid,
   p_hca-map_item);
 }
@@ -1062,10 +1066,14 @@ static void fabric_add_hca(ftree_fabric_t * p_ftree, 
osm_node_t * p_osm_node)
 
 static void fabric_add_sw(ftree_fabric_t * p_ftree, osm_switch_t * p_osm_sw)
 {
-   ftree_sw_t *p_sw = sw_create(p_ftree, p_osm_sw);
+   ftree_sw_t *p_sw;
 
CL_ASSERT(osm_node_get_type(p_osm_sw-p_node) == IB_NODE_TYPE_SWITCH);
 
+   p_sw = sw_create(p_ftree, p_osm_sw);
+   if (!p_sw)
+   return;
+
cl_qmap_insert(p_ftree-sw_tbl, p_osm_sw-p_node-node_info.node_guid,
   p_sw-map_item);
 
--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html