From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: Re: bug: 'ethtool -m' reports spurious alarm & warning threshold values for QSFP28 transceivers Date: Thu, 27 Sep 2018 18:38:05 +0200 Message-ID: <20180927163805.GI12979@lunn.ch> References: <82CEAF9FFBA4DD428B132074FB91DF7D5F6481EA@CSI-MAILSRV.csicompanies.internal> <20180926213436.GA4116@hmswarspite.think-freely.org> <091551a9-7a85-4112-bbe2-ce7c7d3cf964@mellanox.com> <20180927145241.GB12979@lunn.ch> <06e89e21-41b2-0711-4ff7-0af5fd7ef53e@mellanox.com> <20180927153204.GE12979@lunn.ch> <82CEAF9FFBA4DD428B132074FB91DF7D5F6489E3@CSI-MAILSRV.csicompanies.internal> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Eran Ben Elisha , Neil Horman , "linville@tuxdriver.com" , "netdev@vger.kernel.org" To: Chris Preimesberger Return-path: Received: from vps0.lunn.ch ([185.16.172.187]:47529 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727320AbeI0W5U (ORCPT ); Thu, 27 Sep 2018 18:57:20 -0400 Content-Disposition: inline In-Reply-To: <82CEAF9FFBA4DD428B132074FB91DF7D5F6489E3@CSI-MAILSRV.csicompanies.internal> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, Sep 27, 2018 at 04:08:24PM +0000, Chris Preimesberger wrote: > Please correct me if I'm wrong, but... > It looks like Eran's proposed fix would remove all warning and > alarm indications from ethtool's output. It's worth mentioning > that for me, the following fields always reported correctly > as Off while no alarm condition was present > and On while alarm condition(s) were present > *per the QSFP's true/programmed threshold values* > *not per the incorrectly reported threshold values* These alarm values are in the first page. So the information the driver returns does contain this information. What is missing is the thresholds, which are not provided by the driver. But there is a comment in the code: /* * There is no clear identifier to signify the existence of * optical diagnostics similar to SFF-8472. So checking existence * of page 3, will provide the gurantee for existence of alarms * and thresholds * If pagging support exists, then supports_alarms is marked as 1 */ These alarm values are optional. The spec says so. So in order to decide if they are implemented, ethtool looks to see if the thresholds are available. If there are thresholds, it makes sense the alarms are implemented. Unfortunately, the driver never returns the thresholds. So ethtool has no real choice and won't display the alarms since it cannot determine if they are valid. In order to get alarms, the driver needs to be extended to return all the pages. Andrew