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

Hal Rosenstock halr at voltaire.com
Tue Jan 10 16:02:34 PST 2006


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>

Index: umad.c
===================================================================
--- umad.c      (revision 4904)
+++ umad.c      (working copy)
@@ -244,7 +244,7 @@ resolve_ca_port(char *ca_name, int *port
                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 @@ resolve_ca_port(char *ca_name, int *port
                }
        }
 
+       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)





More information about the general mailing list