From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751301AbdJ1Kmt (ORCPT ); Sat, 28 Oct 2017 06:42:49 -0400 Received: from mx2.suse.de ([195.135.220.15]:39449 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751001AbdJ1Kmr (ORCPT ); Sat, 28 Oct 2017 06:42:47 -0400 Date: Sat, 28 Oct 2017 12:42:44 +0200 From: Thomas Bogendoerfer To: Hal Rosenstock Cc: Ghazale Hosseinabadi , linux-rdma@vger.kernel.org, matanb@mellanox.com, leonro@mellanox.com, parav@mellanox.com, linux-kernel@vger.kernel.org, dledford@redhat.com Subject: Re: [PATCH] IB/mlx5: give back valid speed/width even without plugged in SFP module Message-Id: <20171028124244.34dcc77d90637f5fc4a77017@suse.de> In-Reply-To: <4dcf0ca6-77ff-bfd3-9f79-c114617f536f@dev.mellanox.co.il> References: <64ef31c8-cb1a-4579-ba12-11fbf6d1d5c0@default> <0af834ca-52ff-47da-a225-744aab4e59d6@dev.mellanox.co.il> <9be6d049-c3fc-6cf2-8d91-4449f4bcc896@oracle.com> <4dcf0ca6-77ff-bfd3-9f79-c114617f536f@dev.mellanox.co.il> X-Mailer: Sylpheed 3.5.0beta1 (GTK+ 2.24.25; i586-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 27 Oct 2017 19:19:05 -0400 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. rate_show() generates an EINVAL, that's propably what ibstat/*libs confuses. > and setting the width to 1x in the driver so the rate file is properly > populated fixes this ? yes, because then rate_show() will not return EINVAL. > I must be missing something as to what is going on in this scenario. > > 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". I thought about going in the other direction by making the speed/width unknown case somehow visible in rate_show(). When I checked all other drivers only mlx5 stand out so I decided to only change mlx5. But I make a change to let rate_show() print out, that is currently has no rate for the port. Thomas. -- Thomas Bogendoerfer