Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF60CC43381 for ; Mon, 18 Mar 2019 13:33:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8DD9120850 for ; Mon, 18 Mar 2019 13:33:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="hBZ/6eGG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727376AbfCRNd1 (ORCPT ); Mon, 18 Mar 2019 09:33:27 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:57438 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726202AbfCRNd0 (ORCPT ); Mon, 18 Mar 2019 09:33:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=7shu4XoUytAYbBynREJYtctuHzwlOKdYFezut8bM9SQ=; b=hBZ/6eGGn/fnYPgr6GfF6wDs+G JTgPHC6iTXHPMqJm9zCl6K7I8+d27soV2TKDpYbsVuBpo9/H6zVsSFUBTfPIDFRdNr9Ksk9Rs7WfU KO04gjZgipW7uO5WR9m8Ppuk5+7R03yfB2SXq7X3syM9G51i9JDAgHrqd1epBdakNG+g=; Received: from andrew by vps0.lunn.ch with local (Exim 4.89) (envelope-from ) id 1h5sOJ-00050t-Si; Mon, 18 Mar 2019 14:33:23 +0100 Date: Mon, 18 Mar 2019 14:33:23 +0100 From: Andrew Lunn To: Petr Machata Cc: "netdev@vger.kernel.org" , Jiri Pirko , Ido Schimmel , "davem@davemloft.net" , Tariq Toukan , "jakub.kicinski@netronome.com" , "stephen@networkplumber.org" Subject: Re: [RFC PATCH net-next 1/3] net: rtnetlink: Add link-down reason to RTNL messages Message-ID: <20190318133323.GG30224@lunn.ch> References: <3a247e91ebe81cdae4bae27ec1631c5015fb943f.1552672441.git.petrm@mellanox.com> <20190316022658.GC29548@lunn.ch> <87zhpsgw7j.fsf@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87zhpsgw7j.fsf@mellanox.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Mon, Mar 18, 2019 at 01:15:41PM +0000, Petr Machata wrote: > > Andrew Lunn writes: > > >> +enum rtnl_link_down_reason_major { > >> + RTNL_LDR_OTHER, > > > > Does 'other' make any sense? Seem better to just not report anything > > at all, or add a comment that more reasons should be added at the end > > to reflect whatever the hardware or software can determine. > > You still have the minor code to give you some information. > > >> + RTNL_LDR_NO_CABLE, > >> + RTNL_LDR_UNSUPPORTED_CABLE, > >> + RTNL_LDR_AUTONEG_FAILURE, > >> + RTNL_LDR_NO_LINK_PARTNER, > >> + RTNL_LDR_LINK_TRAINING_FAILURE, > >> + RTNL_LDR_LOGICAL_MISMATCH, > >> + RTNL_LDR_REMOTE_FAULT, > >> + RTNL_LDR_BAD_SIGNAL_INTEGRITY, > >> + RTNL_LDR_CALIBRATION_FAILURE, > >> + RTNL_LDR_POWER_BUDGET_EXCEEDED, > >> +}; > > > > What about SFP cage empty?, i.e. no SFP, SFP+ module in the cage? An > > No cable? Maybe the name needs to change... An SFP module, and the cable plugged into it via LC connectors, are physically different things. And you can also have an SFP with an RJ45 for 1G copper. I know at higher speeds they can be inseparable, but this needs to be a generic API and also work with them being two separate things. > > > SFP can also report LOS. That does not appear to be any of the above. > > Or that the core SFP code has been unable to read the EEPROM? We have > > My assumption was that cable with unreadable EEPROM is simply a bad > cable. Does the admin actually care which particular part of the cable > is at fault? Yes. I throw away the SFP module, because its EEPROM is broke, but don't need to replace the 1KM of fibre cable, or 100m of Cat 6a copper cable. Classic example would be fibre to the home. Do you really think they are going to dig up the road again, to replace the cable, when all they need to do is replace the SFP module? Andrew