[ofa-general] [infiniband-diags] [PATCH] [4/5] libibnetdisc cleanup patches

Al Chu chu11 at llnl.gov
Tue Jul 7 15:25:02 PDT 2009


In libibnetdisc, do not automatically output messages to stderr/stdout
for warnings or non-fatal errors. Use IBND_DEBUG instead of IBPANIC or
IBWARN to allow users of the lib to decide output conditions.

Al

-- 
Albert Chu
chu11 at llnl.gov
Computer Scientist
High Performance Systems Division
Lawrence Livermore National Laboratory
-------------- next part --------------
>From b33e01e4ab71e82265011b1941052584774c9b4b Mon Sep 17 00:00:00 2001
From: Albert Chu <chu11 at llnl.gov>
Date: Tue, 7 Jul 2009 11:31:56 -0700
Subject: [PATCH] In libibnetdisc, do not automatically output messages to stderr/stdout for warnings or non-fatal errors. Use IBND_DEBUG instead of IBPANIC or IBWARN to allow users of the lib to decide output conditions.

Signed-off-by: Albert Chu <chu11 at llnl.gov>
Signed-off-by: Ira Weiny <weiny2 at llnl.gov>
---
 infiniband-diags/libibnetdisc/src/ibnetdisc.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/infiniband-diags/libibnetdisc/src/ibnetdisc.c b/infiniband-diags/libibnetdisc/src/ibnetdisc.c
index a10dfcd..d8bf200 100644
--- a/infiniband-diags/libibnetdisc/src/ibnetdisc.c
+++ b/infiniband-diags/libibnetdisc/src/ibnetdisc.c
@@ -464,8 +464,8 @@ get_remote_node(struct ibnd_fabric_int *fabric, struct ibnd_node_int *node, stru
 		return -1;
 
 	if (query_node(fabric, &node_buf, &port_buf, path)) {
-		IBWARN("NodeInfo on %s failed, skipping port",
-			portid2str(path));
+		IBND_DEBUG("NodeInfo on %s failed, skipping port",
+			   portid2str(path));
 		path->drpath.cnt--;	/* restore path */
 		return -1;
 	}
@@ -507,15 +507,15 @@ ibnd_discover_fabric(struct ibmad_port *ibmad_port, int timeout_ms,
 	int max_hops = MAXHOPS-1; /* default find everything */
 
 	if (!ibmad_port) {
-		IBPANIC("ibmad_port must be specified to "
-			"ibnd_discover_fabric\n");
+		IBND_DEBUG("ibmad_port must be specified to "
+			   "ibnd_discover_fabric\n");
 		return (NULL);
 	}
 	if (mad_rpc_class_agent(ibmad_port, IB_SMI_CLASS) == -1
 			||
 		mad_rpc_class_agent(ibmad_port, IB_SMI_DIRECT_CLASS) == -1) {
-		IBPANIC("ibmad_port must be opened with "
-			"IB_SMI_CLASS && IB_SMI_DIRECT_CLASS\n");
+		IBND_DEBUG("ibmad_port must be opened with "
+			   "IB_SMI_CLASS && IB_SMI_DIRECT_CLASS\n");
 		return (NULL);
 	}
 
@@ -545,7 +545,7 @@ ibnd_discover_fabric(struct ibmad_port *ibmad_port, int timeout_ms,
 	memset(&port_buf, 0, sizeof(port_buf));
 
 	if (query_node(fabric, &node_buf, &port_buf, from)) {
-		IBWARN("can't reach node %s\n", portid2str(from));
+		IBND_DEBUG("can't reach node %s\n", portid2str(from));
 		goto error;
 	}
 
@@ -579,7 +579,7 @@ ibnd_discover_fabric(struct ibmad_port *ibmad_port, int timeout_ms,
 					continue;
 
 				if (get_port_info(fabric, &port_buf, i, path)) {
-					IBWARN("can't reach node %s port %d", portid2str(path), i);
+					IBND_DEBUG("can't reach node %s port %d", portid2str(path), i);
 					continue;
 				}
 
-- 
1.5.4.5



More information about the general mailing list