[ofw] Re: [PATCH] [ib-diag] ibstat: port_dump is called too many times

Sasha Khapyorsky sashak at voltaire.com
Fri Mar 6 04:45:47 PST 2009


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 <sean.hefty at intel.com>
> ---
> 
>  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



More information about the ofw mailing list