lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <VI1PR0502MB3008AE9EEBF086840CC06077D15A0@VI1PR0502MB3008.eurprd05.prod.outlook.com>
Date:   Fri, 27 Oct 2017 18:32:57 +0000
From:   Parav Pandit <parav@...lanox.com>
To:     Thomas Bogendoerfer <tbogendoerfer@...e.de>,
        Matan Barak <matanb@...lanox.com>,
        Leon Romanovsky <leonro@...lanox.com>,
        Doug Ledford <dledford@...hat.com>,
        "linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC:     Ghazale Hosseinabadi <ghazale.hosseinabadi@...cle.com>
Subject: RE: [PATCH] IB/mlx5: give back valid speed/width even without plugged
 in SFP module



> -----Original Message-----
> From: linux-rdma-owner@...r.kernel.org [mailto:linux-rdma-
> owner@...r.kernel.org] On Behalf Of Thomas Bogendoerfer
> Sent: Friday, October 27, 2017 7:30 AM
> To: Matan Barak <matanb@...lanox.com>; Leon Romanovsky
> <leonro@...lanox.com>; Doug Ledford <dledford@...hat.com>; linux-
> rdma@...r.kernel.org; linux-kernel@...r.kernel.org
> Subject: [PATCH] IB/mlx5: give back valid speed/width even without plugged in
> SFP module
> 
> 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.
> 
> Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@...e.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

Similar issue was reported by Ghazale in offline email and she also provided similar patch.
I added her in this mail thread.
Please add below reported-by tag if you find it appropriate.
Reported-by: Ghazale Hosseinabadi <ghazale.hosseinabadi@...cle.com>

Thanks for the short term fix.
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.
Similar tools such as ethtool does report unknown port speed as unknown like below output which doesn't have SFP.

ethtool ens2f0
        <....>
        Speed: Unknown!
        Duplex: Unknown! (255)
        <....>
        Link detected: no

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ