[ofa-general] [PATCH] infiniband-diags: Fix IB network discovery from switch node.
Eli Dorfman (Voltaire)
dorfman.eli at gmail.com
Wed Aug 26 07:37:30 PDT 2009
Subject: [PATCH] Fix IB network discovery from switch node.
Signed-off-by: Eli Dorfman <elid at voltaire.com>
---
infiniband-diags/libibnetdisc/src/ibnetdisc.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/infiniband-diags/libibnetdisc/src/ibnetdisc.c b/infiniband-diags/libibnetdisc/src/ibnetdisc.c
index c69467e..779e659 100644
--- a/infiniband-diags/libibnetdisc/src/ibnetdisc.c
+++ b/infiniband-diags/libibnetdisc/src/ibnetdisc.c
@@ -590,13 +590,15 @@ ibnd_fabric_t *ibnd_discover_fabric(struct ibmad_port * ibmad_port,
if (!port)
goto error;
- rc = get_remote_node(ibmad_port, fabric, node, port, from,
- mad_get_field(node->info, 0,
- IB_NODE_LOCAL_PORT_F), 0);
- if (rc < 0)
- goto error;
- if (rc > 0) /* non-fatal error, nothing more to be done */
- return ((ibnd_fabric_t *) fabric);
+ if (node->node.type != IB_NODE_SWITCH) {
+ rc = get_remote_node(ibmad_port, fabric, node, port, from,
+ mad_get_field(node->info, 0,
+ IB_NODE_LOCAL_PORT_F), 0);
+ if (rc < 0)
+ goto error;
+ if (rc > 0) /* non-fatal error, nothing more to be done */
+ return ((ibnd_fabric_t *) fabric);
+ }
for (dist = 0; dist <= max_hops; dist++) {
--
1.5.5
More information about the general
mailing list