[ofw] [Patch] [UMAD][Tools]
Hal Rosenstock
hal.rosenstock at gmail.com
Tue Jul 13 08:41:14 PDT 2010
On Tue, Jul 13, 2010 at 10:53 AM, Irena Kruchkovsky
<irena at mellanox.co.il> wrote:
> This patch fixes the wrong rate calculation within ibstat tool.
>
> Signed-off by: Irena Kruchkovsky (irena at mellanox.co.il)
>
> 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
> ofw at lists.openfabrics.org
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw
>
More information about the ofw
mailing list