lkml.org 
[lkml]   [2017]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] IB/mlx5: give back valid speed/width even without plugged in SFP module
On Fri, Oct 27, 2017 at 02:30:11PM +0200, Thomas Bogendoerfer wrote:
> If there is no SFP module plugged into a port of mlx5 cards
> 'cat /sys/class/infniband/mlx5_X/ports/1/rate' returns Invalid argument.
> This causes tools like 'ibstat' to malfunction. This change adjusts mlx5
> to all other RoCE/iWarp drivers, which always return valid speed/width.

Like Parav, I have mixed feelings about such change. It returns EINVAL
if nothing is connected and it is right thing to do. It is hard to call
"valid speed/width" for unconnected port.

I would like to have ibstat and other drivers fixed instead of
converting mlx5 to be wrong.

Proposed change breaks existing scripts.

Thanks

>
> Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
> ---
> drivers/infiniband/hw/mlx5/main.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
> index 260f8be1d0ed..4388618e3434 100644
> --- a/drivers/infiniband/hw/mlx5/main.c
> +++ b/drivers/infiniband/hw/mlx5/main.c
> @@ -246,7 +246,10 @@ static int translate_eth_proto_oper(u32 eth_proto_oper, u8 *active_speed,
> *active_speed = IB_SPEED_EDR;
> break;
> default:
> - return -EINVAL;
> + /* Unknown */
> + *active_width = IB_WIDTH_1X;
> + *active_speed = IB_SPEED_SDR;
> + break;
> }
>
> return 0;
> --
> 2.12.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2017-10-28 20:20    [W:0.065 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site