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=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS 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 7C44DC43381 for ; Mon, 18 Mar 2019 13:15:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3D5EC20857 for ; Mon, 18 Mar 2019 13:15:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="ViMxiQfK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727359AbfCRNPq (ORCPT ); Mon, 18 Mar 2019 09:15:46 -0400 Received: from mail-eopbgr00067.outbound.protection.outlook.com ([40.107.0.67]:59790 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726692AbfCRNPq (ORCPT ); Mon, 18 Mar 2019 09:15:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qvSLq8Ke5Uc0Rt1jNzB5pWMTJ3OQL2Fe1d8PqF/rkk4=; b=ViMxiQfKVmQbJoi++jsgarpo6ObxyI81OiI7uBSKEbLXikORVKExVv1BuE3f7aLyFv2ccmE/DRFbtCIIlgiRShEseQAqF/sdPw8M0RtnALjPGBFMGmttdIoLEnY27+CUc6UlVQM3cAOAwUaTD6RhJIzXrEz4Fv8zgt++j3u4bA4= Received: from AM6PR05MB6133.eurprd05.prod.outlook.com (20.179.3.144) by AM6PR05MB6359.eurprd05.prod.outlook.com (20.179.5.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1709.15; Mon, 18 Mar 2019 13:15:41 +0000 Received: from AM6PR05MB6133.eurprd05.prod.outlook.com ([fe80::8c6:b0f3:d983:2fea]) by AM6PR05MB6133.eurprd05.prod.outlook.com ([fe80::8c6:b0f3:d983:2fea%2]) with mapi id 15.20.1709.015; Mon, 18 Mar 2019 13:15:41 +0000 From: Petr Machata To: Andrew Lunn 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 Thread-Topic: [RFC PATCH net-next 1/3] net: rtnetlink: Add link-down reason to RTNL messages Thread-Index: AQHU21hddEVxaeti1Ey0mD5+skDyyqYNiMQAgAPZ2gA= Date: Mon, 18 Mar 2019 13:15:41 +0000 Message-ID: <87zhpsgw7j.fsf@mellanox.com> References: <3a247e91ebe81cdae4bae27ec1631c5015fb943f.1552672441.git.petrm@mellanox.com> <20190316022658.GC29548@lunn.ch> In-Reply-To: <20190316022658.GC29548@lunn.ch> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5PR0102CA0016.eurprd01.prod.exchangelabs.com (2603:10a6:206::29) To AM6PR05MB6133.eurprd05.prod.outlook.com (2603:10a6:20b:af::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=petrm@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [78.45.160.211] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5a0c6910-4de9-40e8-28ad-08d6aba3d245 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020);SRVR:AM6PR05MB6359; x-ms-traffictypediagnostic: AM6PR05MB6359: x-microsoft-antispam-prvs: x-forefront-prvs: 098076C36C x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(366004)(136003)(346002)(396003)(39860400002)(376002)(199004)(189003)(3846002)(66066001)(25786009)(7736002)(97736004)(68736007)(14454004)(14444005)(256004)(71190400001)(105586002)(106356001)(6116002)(54906003)(8936002)(478600001)(71200400001)(316002)(102836004)(186003)(229853002)(26005)(446003)(2906002)(6916009)(6486002)(2616005)(11346002)(52116002)(6436002)(99286004)(81156014)(386003)(6506007)(81166006)(76176011)(4326008)(36756003)(305945005)(5660300002)(8676002)(6246003)(486006)(86362001)(476003)(6512007)(53936002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM6PR05MB6359;H:AM6PR05MB6133.eurprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: SRGGrj8tpQFw51NOilwtoW4nB5v4YhFaKgDnhPYx6SFm2XnRnbIEa6nYsOrnMuU5bFN4Zp6Duud+B9wPwqezQkjGsqPcME7gFUdNRkV4jASbGKtBVwmYiJWARqt9jzoTV41iLLG2f5qIy5PNz6ZKiQUHeSRYhKl9A57v8/c9r/UzmA8yUJG417y1DMzXzrtti68JR/HmJQAUlAm7kkgcjY3C4ASLMgObZlq5j8dAy+bMAcgrGI7BxCyFWkf4GwzeW9AXrJI3dCu/LtigZPyrWmvRGbpUV4bqWT1YVfvZUTDuH/GTXVq2dU7Oq3dFGatiUE5JyL8H4bgGE7RMEltwYA/bBni8Vry+Gw8Qcg5BG3vtPv55p/K+43s9S5L4u9JVXimm7ml7/WsODgDjcWPcDlDFvtbLvnlhrIp9VHkszy8= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5a0c6910-4de9-40e8-28ad-08d6aba3d245 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Mar 2019 13:15:41.7972 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB6359 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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... > 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? > 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. We can add this. > 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. Sure, I'll take a look at that. I didn't need to deal with PHY so far, so I need to figure out what's what.