Re: [PATCH] IB/mlx5: give back valid speed/width even without plugged in SFP module

2017-10-27 Thread Ghazale Hosseinabadi



On 10/27/2017 04:19 PM, Hal Rosenstock wrote:

On 10/27/2017 7:04 PM, Ghazale Hosseinabadi wrote:


On 10/27/2017 03:52 PM, Hal Rosenstock wrote:

On 10/27/2017 5:54 PM, Ghazale Hosseinabadi wrote:

When running ibstat (if transceiver is not connected in adapter):

ibpanic: [7851] main: stat of IB device 'mlx5_1' failed: Invalid
argument

Any output before that ?

no, It only prints this line.

and setting the width to 1x in the driver so the rate file is properly
populated fixes this ?
Yes, because a value is written in 
/sys/class/infiniband/mlx5_X/ports/1/rate

  I must be missing something as to what is going
on in this scenario.
Without this bug fix, file /sys/class/infiniband/mlx5_X/ports/1/rate is 
empty, which results in ibpanic.


-- Ghazale


sysfs.c:rate_show is inconsistent as it paves over an invalid speed
setting that to SDR but does not pave over invalid width returning
-EINVAL but this comment is in another "direction".

-- Hal


-- Ghazale

   I'm trying to understand how far it gets. It
looks to me that empty rate file would be parsed as 0 and ibstat would
show that rate. ibpanic would occur if file was not found but I could be
missing something.







Re: [PATCH] IB/mlx5: give back valid speed/width even without plugged in SFP module

2017-10-27 Thread Ghazale Hosseinabadi



On 10/27/2017 04:19 PM, Hal Rosenstock wrote:

On 10/27/2017 7:04 PM, Ghazale Hosseinabadi wrote:


On 10/27/2017 03:52 PM, Hal Rosenstock wrote:

On 10/27/2017 5:54 PM, Ghazale Hosseinabadi wrote:

When running ibstat (if transceiver is not connected in adapter):

ibpanic: [7851] main: stat of IB device 'mlx5_1' failed: Invalid
argument

Any output before that ?

no, It only prints this line.

and setting the width to 1x in the driver so the rate file is properly
populated fixes this ?
Yes, because a value is written in 
/sys/class/infiniband/mlx5_X/ports/1/rate

  I must be missing something as to what is going
on in this scenario.
Without this bug fix, file /sys/class/infiniband/mlx5_X/ports/1/rate is 
empty, which results in ibpanic.


-- Ghazale


sysfs.c:rate_show is inconsistent as it paves over an invalid speed
setting that to SDR but does not pave over invalid width returning
-EINVAL but this comment is in another "direction".

-- Hal


-- Ghazale

   I'm trying to understand how far it gets. It
looks to me that empty rate file would be parsed as 0 and ibstat would
show that rate. ibpanic would occur if file was not found but I could be
missing something.







Re: [PATCH] IB/mlx5: give back valid speed/width even without plugged in SFP module

2017-10-27 Thread Ghazale Hosseinabadi



On 10/27/2017 05:17 PM, Hal Rosenstock wrote:

On 10/27/2017 7:19 PM, Hal Rosenstock wrote:

On 10/27/2017 7:04 PM, Ghazale Hosseinabadi wrote:


On 10/27/2017 03:52 PM, Hal Rosenstock wrote:

On 10/27/2017 5:54 PM, Ghazale Hosseinabadi wrote:

When running ibstat (if transceiver is not connected in adapter):

ibpanic: [7851] main: stat of IB device 'mlx5_1' failed: Invalid
argument

Any output before that ?

no, It only prints this line.

and setting the width to 1x in the driver so the rate file is properly
populated fixes this ? I must be missing something as to what is going
on in this scenario.

[off list...]
Are you using libibumad or rdma-core package ?

rdma-core

  Which version ?

rdma-core-13-25

What version of infiniband-diags are you using ?

infiniband-diags-1.6.7-1

Can you build from sources ?
I have patch to libibumad/rdma-core and another patch to ibstat
(infiniband-diags) which I'd like you to try. Is that possible ?

I haven't built user-land packages myself, but I can definitely try it.
Please send me the patches and I will try to build.

Thanks,
Ghazale


Thanks.

-- Hal


sysfs.c:rate_show is inconsistent as it paves over an invalid speed
setting that to SDR but does not pave over invalid width returning
-EINVAL but this comment is in another "direction".

-- Hal


-- Ghazale

   I'm trying to understand how far it gets. It
looks to me that empty rate file would be parsed as 0 and ibstat would
show that rate. ibpanic would occur if file was not found but I could be
missing something.







Re: [PATCH] IB/mlx5: give back valid speed/width even without plugged in SFP module

2017-10-27 Thread Ghazale Hosseinabadi



On 10/27/2017 05:17 PM, Hal Rosenstock wrote:

On 10/27/2017 7:19 PM, Hal Rosenstock wrote:

On 10/27/2017 7:04 PM, Ghazale Hosseinabadi wrote:


On 10/27/2017 03:52 PM, Hal Rosenstock wrote:

On 10/27/2017 5:54 PM, Ghazale Hosseinabadi wrote:

When running ibstat (if transceiver is not connected in adapter):

ibpanic: [7851] main: stat of IB device 'mlx5_1' failed: Invalid
argument

Any output before that ?

no, It only prints this line.

and setting the width to 1x in the driver so the rate file is properly
populated fixes this ? I must be missing something as to what is going
on in this scenario.

[off list...]
Are you using libibumad or rdma-core package ?

rdma-core

  Which version ?

rdma-core-13-25

What version of infiniband-diags are you using ?

infiniband-diags-1.6.7-1

Can you build from sources ?
I have patch to libibumad/rdma-core and another patch to ibstat
(infiniband-diags) which I'd like you to try. Is that possible ?

I haven't built user-land packages myself, but I can definitely try it.
Please send me the patches and I will try to build.

Thanks,
Ghazale


Thanks.

-- Hal


sysfs.c:rate_show is inconsistent as it paves over an invalid speed
setting that to SDR but does not pave over invalid width returning
-EINVAL but this comment is in another "direction".

-- Hal


-- Ghazale

   I'm trying to understand how far it gets. It
looks to me that empty rate file would be parsed as 0 and ibstat would
show that rate. ibpanic would occur if file was not found but I could be
missing something.







Re: [PATCH] IB/mlx5: give back valid speed/width even without plugged in SFP module

2017-10-27 Thread Ghazale Hosseinabadi



On 10/27/2017 03:52 PM, Hal Rosenstock wrote:

On 10/27/2017 5:54 PM, Ghazale Hosseinabadi wrote:

When running ibstat (if transceiver is not connected in adapter):

ibpanic: [7851] main: stat of IB device 'mlx5_1' failed: Invalid argument

Any output before that ?

no, It only prints this line.

-- Ghazale

  I'm trying to understand how far it gets. It
looks to me that empty rate file would be parsed as 0 and ibstat would
show that rate. ibpanic would occur if file was not found but I could be
missing something.





Re: [PATCH] IB/mlx5: give back valid speed/width even without plugged in SFP module

2017-10-27 Thread Ghazale Hosseinabadi



On 10/27/2017 03:52 PM, Hal Rosenstock wrote:

On 10/27/2017 5:54 PM, Ghazale Hosseinabadi wrote:

When running ibstat (if transceiver is not connected in adapter):

ibpanic: [7851] main: stat of IB device 'mlx5_1' failed: Invalid argument

Any output before that ?

no, It only prints this line.

-- Ghazale

  I'm trying to understand how far it gets. It
looks to me that empty rate file would be parsed as 0 and ibstat would
show that rate. ibpanic would occur if file was not found but I could be
missing something.





Re: [PATCH] IB/mlx5: give back valid speed/width even without plugged in SFP module

2017-10-27 Thread Ghazale Hosseinabadi
Hi,

- Original Message -
From: h...@dev.mellanox.co.il
To: pa...@mellanox.com, tbogendoer...@suse.de, mat...@mellanox.com, 
leo...@mellanox.com, dledf...@redhat.com, linux-r...@vger.kernel.org, 
linux-kernel@vger.kernel.org
Cc: ghazale.hosseinab...@oracle.com
Sent: Friday, October 27, 2017 2:30:33 PM GMT -08:00 US/Canada Pacific
Subject: Re: [PATCH] IB/mlx5: give back valid speed/width even without plugged 
in SFP module

On 10/27/2017 4:33 PM, Parav Pandit wrote:
> 
> 
>> -Original Message-
>> From: Hal Rosenstock [mailto:h...@dev.mellanox.co.il]
>> Sent: Friday, October 27, 2017 3:19 PM
>> To: Parav Pandit <pa...@mellanox.com>; Thomas Bogendoerfer
>> <tbogendoer...@suse.de>; Matan Barak <mat...@mellanox.com>; Leon
>> Romanovsky <leo...@mellanox.com>; Doug Ledford <dledf...@redhat.com>;
>> linux-r...@vger.kernel.org; linux-kernel@vger.kernel.org
>> Cc: Ghazale Hosseinabadi <ghazale.hosseinab...@oracle.com>
>> Subject: Re: [PATCH] IB/mlx5: give back valid speed/width even without 
>> plugged
>> in SFP module
>>
>> On 10/27/2017 2:32 PM, Parav Pandit wrote:
>>> However I believe that ibstat tool should be enhanced to report unknown port
>> speed instead of expecting drivers to supply some random number like this.
>>
>> ibstat gets the rate from libibumad via /sys/class/infiniband/> device>/ports//rate file which is supposed to be populated by 
>> the
>> driver. Is there no rate file in this error case ?
>>
> <...>//rate file exist.
> 
> rate_show() has invalid active_width as expected due to nonexistence of SFP.
> So sysfs call return invalid value.
> We don't have invalid_active_width defined right now.
> So ibstat and other applications should not crash on such valid errors.

Agreed. I haven't seen ibstat crash reported though. Can someone provide
the crash details ?

When running ibstat (if transceiver is not connected in adapter):

ibpanic: [7851] main: stat of IB device 'mlx5_1' failed: Invalid argument

Thanks,
Ghazale


Re: [PATCH] IB/mlx5: give back valid speed/width even without plugged in SFP module

2017-10-27 Thread Ghazale Hosseinabadi
Hi,

- Original Message -
From: h...@dev.mellanox.co.il
To: pa...@mellanox.com, tbogendoer...@suse.de, mat...@mellanox.com, 
leo...@mellanox.com, dledf...@redhat.com, linux-r...@vger.kernel.org, 
linux-kernel@vger.kernel.org
Cc: ghazale.hosseinab...@oracle.com
Sent: Friday, October 27, 2017 2:30:33 PM GMT -08:00 US/Canada Pacific
Subject: Re: [PATCH] IB/mlx5: give back valid speed/width even without plugged 
in SFP module

On 10/27/2017 4:33 PM, Parav Pandit wrote:
> 
> 
>> -Original Message-
>> From: Hal Rosenstock [mailto:h...@dev.mellanox.co.il]
>> Sent: Friday, October 27, 2017 3:19 PM
>> To: Parav Pandit ; Thomas Bogendoerfer
>> ; Matan Barak ; Leon
>> Romanovsky ; Doug Ledford ;
>> linux-r...@vger.kernel.org; linux-kernel@vger.kernel.org
>> Cc: Ghazale Hosseinabadi 
>> Subject: Re: [PATCH] IB/mlx5: give back valid speed/width even without 
>> plugged
>> in SFP module
>>
>> On 10/27/2017 2:32 PM, Parav Pandit wrote:
>>> However I believe that ibstat tool should be enhanced to report unknown port
>> speed instead of expecting drivers to supply some random number like this.
>>
>> ibstat gets the rate from libibumad via /sys/class/infiniband/> device>/ports//rate file which is supposed to be populated by 
>> the
>> driver. Is there no rate file in this error case ?
>>
> <...>//rate file exist.
> 
> rate_show() has invalid active_width as expected due to nonexistence of SFP.
> So sysfs call return invalid value.
> We don't have invalid_active_width defined right now.
> So ibstat and other applications should not crash on such valid errors.

Agreed. I haven't seen ibstat crash reported though. Can someone provide
the crash details ?

When running ibstat (if transceiver is not connected in adapter):

ibpanic: [7851] main: stat of IB device 'mlx5_1' failed: Invalid argument

Thanks,
Ghazale


Re: [PATCH] IB/mlx5: give back valid speed/width even without plugged in SFP module

2017-10-27 Thread Ghazale Hosseinabadi
Hi,

- Original Message -
From: h...@dev.mellanox.co.il
To: pa...@mellanox.com, tbogendoer...@suse.de, mat...@mellanox.com, 
leo...@mellanox.com, dledf...@redhat.com, linux-r...@vger.kernel.org, 
linux-kernel@vger.kernel.org
Cc: ghazale.hosseinab...@oracle.com
Sent: Friday, October 27, 2017 1:18:50 PM GMT -08:00 US/Canada Pacific
Subject: Re: [PATCH] IB/mlx5: give back valid speed/width even without plugged 
in SFP module

On 10/27/2017 2:32 PM, Parav Pandit wrote:
> However I believe that ibstat tool should be enhanced to report unknown port 
> speed instead of expecting drivers to supply some random number like this.

ibstat gets the rate from libibumad via /sys/class/infiniband//ports//rate file which is supposed to be populated by the 
driver. Is there no rate file in this error case ?

There is a rate file, but it is empty.

Thanks,
Ghazale

-- Hal


Re: [PATCH] IB/mlx5: give back valid speed/width even without plugged in SFP module

2017-10-27 Thread Ghazale Hosseinabadi
Hi,

- Original Message -
From: h...@dev.mellanox.co.il
To: pa...@mellanox.com, tbogendoer...@suse.de, mat...@mellanox.com, 
leo...@mellanox.com, dledf...@redhat.com, linux-r...@vger.kernel.org, 
linux-kernel@vger.kernel.org
Cc: ghazale.hosseinab...@oracle.com
Sent: Friday, October 27, 2017 1:18:50 PM GMT -08:00 US/Canada Pacific
Subject: Re: [PATCH] IB/mlx5: give back valid speed/width even without plugged 
in SFP module

On 10/27/2017 2:32 PM, Parav Pandit wrote:
> However I believe that ibstat tool should be enhanced to report unknown port 
> speed instead of expecting drivers to supply some random number like this.

ibstat gets the rate from libibumad via /sys/class/infiniband//ports//rate file which is supposed to be populated by the 
driver. Is there no rate file in this error case ?

There is a rate file, but it is empty.

Thanks,
Ghazale

-- Hal