From mboxrd@z Thu Jan 1 00:00:00 1970 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 48C58C43381 for ; Sat, 16 Mar 2019 02:27:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 16E0B218A1 for ; Sat, 16 Mar 2019 02:27:03 +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="RuULSFc8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726720AbfCPC1B (ORCPT ); Fri, 15 Mar 2019 22:27:01 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:55940 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726218AbfCPC1B (ORCPT ); Fri, 15 Mar 2019 22:27:01 -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=Sfxn1e+x20kdEIQHGLeWzv69BJf9IdlJLqfjpZ+E47c=; b=RuULSFc80YVzYnOy3f3OOAt3Qh RnMLSOitRGlSyUrQCzw4CZs+UZFrDbUjpm8Qz1/cQUgOxwJrL5KUSYadoGRhG+QfP5ktcyS713LJl 9BH1cNUEPollzbv7463fGpbfytJwBCZf0uH8hvVldQYmgl0CieLmBBONVyHh0KFRJHAA=; Received: from andrew by vps0.lunn.ch with local (Exim 4.89) (envelope-from ) id 1h4z2I-00014T-4q; Sat, 16 Mar 2019 03:26:58 +0100 Date: Sat, 16 Mar 2019 03:26:58 +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: <20190316022658.GC29548@lunn.ch> References: <3a247e91ebe81cdae4bae27ec1631c5015fb943f.1552672441.git.petrm@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3a247e91ebe81cdae4bae27ec1631c5015fb943f.1552672441.git.petrm@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 Hi Petr > +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. > + 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 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 people reporting this problem at the moment. We also have that the SERDES has not yet obtained sync to its peer, which you know from phylink_mac_change. That probably means the peer is using a different bit rate. I think it would be good if you handle the general case errors which phylib and phylink can report, as well as the proprietary cases your driver can report. We don't want this to be a Mellanox only API. Andrew