On Tue, Jul 13, 2010 at 11:45 AM, Alex Naslednikov <[email protected]> wrote: > It can happen when the subnet isn't configured yet, for example.
Isn't rate based on link speed and width ? Is one of those values invalid (reserved) ? What am I missing ? -- Hal > > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of Hal Rosenstock > Sent: Tuesday, July 13, 2010 6:41 PM > To: Irena Kruchkovsky > Cc: [email protected] > Subject: Re: [ofw] [Patch] [UMAD][Tools] > > On Tue, Jul 13, 2010 at 10:53 AM, Irena Kruchkovsky <[email protected]> > wrote: >> This patch fixes the wrong rate calculation within ibstat tool. >> >> Signed-off by: Irena Kruchkovsky ([email protected]) >> >> CR: Alexander Naslednikov (xalex at mellanox.co.il) >> >> >> >> Index: D:/Windows/MLNX_VPI/tools/infiniband-diags/src/ibstat.c >> >> =================================================================== >> >> --- D:/Windows/MLNX_VPI/tools/infiniband-diags/src/ibstat.c (revision >> 6077) >> >> +++ D:/Windows/MLNX_VPI/tools/infiniband-diags/src/ibstat.c >> (revision 6092) >> >> @@ -117,7 +117,15 @@ >> >> printf("%sPhysical state: %s\n", pre, >> >> (unsigned)port->state <= >> >> 7 ? port_phy_state_str[port->phys_state] : >> "???"); >> >> - printf("%sRate: %d\n", pre, port->rate); >> >> + if (port->rate != 0) > > Just wondering: > When is the rate 0 returned by umad ? Is that a valid case ? > > -- Hal > >> >> + { >> >> + printf("%sRate: %d Gbps\n", pre, >> +port->rate); >> >> + } >> >> + else >> >> + { >> >> + printf("%sRate: N\\A\n", pre); >> >> + } >> >> + >> >> printf("%sBase lid: %d\n", pre, port->base_lid); >> >> printf("%sLMC: %d\n", pre, port->lmc); >> >> printf("%sSM lid: %d\n", pre, port->sm_lid); >> >> Index: D:/Windows/MLNX_VPI/ulp/libibumad/src/umad.cpp >> >> =================================================================== >> >> --- D:/Windows/MLNX_VPI/ulp/libibumad/src/umad.cpp >> (revision >> 6077) >> >> +++ D:/Windows/MLNX_VPI/ulp/libibumad/src/umad.cpp (revision >> +++ 6092) >> >> @@ -141,9 +141,25 @@ >> >> port->sm_sl = attr.sm_sl; >> >> port->state = attr.state; >> >> port->phys_state = attr.phys_state; >> >> - port->rate = attr.active_speed; >> >> port->capmask = attr.port_cap_flags; >> >> >> >> + switch (attr.active_width){ >> >> + case 1: >> >> + port->rate = (unsigned) >> (2.5*attr.active_speed); >> >> + break; >> >> + case 2: >> >> + port->rate = >> 10*attr.active_speed; //2.5*4 >> >> + break; >> >> + case 4: >> >> + port->rate = >> 20*attr.active_speed; //2.5*8 >> >> + break; >> >> + case 8: >> >> + port->rate = >> 30*attr.active_speed; //2.5*12 >> >> + break; >> >> + default: >> >> + port->rate = 0; >> >> + } >> >> + >> >> // Assume GID 0 contains port GUID and gid prefix >> >> ret = ibv_query_gid(context, (uint8_t) port->portnum, >> 0, &gid); >> >> if (ret != 0) { >> >> _______________________________________________ >> ofw mailing list >> [email protected] >> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw >> > _______________________________________________ > ofw mailing list > [email protected] > http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw > _______________________________________________ ofw mailing list [email protected] http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw
