Hi Sean,

On 13:15 Tue 03 Mar     , Sean Hefty wrote:
> portnum index should go from 0 to numports - 1.

At least in linux it is not so. libibumad initializes numports as max
port available for this card (normally on hosts ports 1 and 2 are
initialized).

> This fixes an
> issue on WinOF where a bogus last port is displayed.
> 
> Signed-off-by: Sean Hefty <[email protected]>
> ---
> 
>  infiniband-diags/src/ibstat.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/infiniband-diags/src/ibstat.c b/infiniband-diags/src/ibstat.c
> index 7985be1..41faea8 100644
> --- a/infiniband-diags/src/ibstat.c
> +++ b/infiniband-diags/src/ibstat.c
> @@ -146,7 +146,7 @@ ca_stat(char *ca_name, int portnum, int no_ports)
>       if (no_ports)
>               return 0;
>  
> -     for (portnum = 0; portnum <= ca.numports; portnum++)
> +     for (portnum = 0; portnum < ca.numports; portnum++)
>               port_dump(ca.ports[portnum], 0);

As expected on linux it shows only first port of two ports CA.

Likely we have libibumad implemented differently in this part.

Sasha
_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to