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 <[EMAIL PROTECTED]> 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) _______________________________________________ openib-general mailing list openib-general@openib.org http://openib.org/mailman/listinfo/openib-general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general