[openib-general] [PATCH] opensm fails to find HCA if port is down.

Ralph Campbell ralphc at pathscale.com
Wed Jan 11 10:33:06 PST 2006


I tested this and it works for me.

> On Tue, 2006-01-10 at 17:51, Hal Rosenstock wrote:
> > Hi Ralph,
> > 
> > On Tue, 2006-01-10 at 17:47, Ralph Campbell wrote:
> > > I understand.  Maybe it should be the first active, if none, then the
> > > first UP, and if none, the first !disabled.
> > 
> > Exactly. I think one more loop (first checking physical state for linkup
> > and then checking for not disabled) will take care of it. I'm working on
> > it now as a patch on your patch which I will post.
> 
> In libibumad/umad,c::resolve_ca_port, default algorithm is to prefer
> ports which are active, then those whose physical state is link up, and
> finally those ports whose physical state is not disabled.

Signed-off-by: Hal Rosenstock <halr at voltaire.com>
Signed-off-by: Ralph Campbell <ralphc at pathscale.com>

Index: umad.c
===================================================================
--- umad.c	(revision 4933)
+++ umad.c	(working copy)
@@ -244,7 +244,7 @@
 		DEBUG("checking port %d", i);
 		if (!ca.ports[i])
 			continue;
-		if (up < 0 && ca.ports[i]->phys_state != 3)
+		if (up < 0 && ca.ports[i]->phys_state == 5)
 			up = *port = i;
 		if (ca.ports[i]->state == 4) {
 			active = *port = i;
@@ -253,6 +253,18 @@
 		}
 	}
 
+	if (active == -1 && up == -1) { /* no active or linkup port found */
+		for (i = 0; i <= ca.numports; i++) {
+			DEBUG("checking port %d", i);
+			if (!ca.ports[i])
+				continue;
+			if (ca.ports[i]->phys_state != 3) {
+				up = *port = i;
+				break;
+			}
+		}
+	}
+
 	release_ca(&ca);
 
 	if (active >= 0)

-- 
Ralph Campbell <ralphc at pathscale.com>




More information about the general mailing list