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, URIBL_BLOCKED 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 BEFE8C43381 for ; Tue, 19 Mar 2019 10:18:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8067920857 for ; Tue, 19 Mar 2019 10:18:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="xtPWqvXy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727122AbfCSKSJ (ORCPT ); Tue, 19 Mar 2019 06:18:09 -0400 Received: from mail-eopbgr50070.outbound.protection.outlook.com ([40.107.5.70]:52993 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726244AbfCSKSJ (ORCPT ); Tue, 19 Mar 2019 06:18:09 -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=mt+lpxip5xHTIz3W0XcpjcwZX1jq/lnZXSD4P2dRaAQ=; b=xtPWqvXytElVyuhsNKAq9eYkMchUNKPndJ3aaJeWktu4Hxj6wc3+4wgL5/4zc2x08kJ9CTGIBrbTDwvpdrlurBrG4QBP11jZHqUeBM755UjjG+IOwHMpKq2C2MFpuLkU0mCiJj5YQZBW6/x3JH+y6pArk9d3mLfYa/vvCxizapY= Received: from AM6PR05MB6133.eurprd05.prod.outlook.com (20.179.3.144) by AM6PR05MB4869.eurprd05.prod.outlook.com (20.177.34.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1709.15; Tue, 19 Mar 2019 10:18:00 +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; Tue, 19 Mar 2019 10:18:00 +0000 From: Petr Machata To: Stephen Hemminger CC: Andrew Lunn , "netdev@vger.kernel.org" , Jiri Pirko , Ido Schimmel , "davem@davemloft.net" , Tariq Toukan , "jakub.kicinski@netronome.com" 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+skDyyqYNiMQAgAPZ2gCAAA1AgIAAHpWAgAE06AA= Date: Tue, 19 Mar 2019 10:18:00 +0000 Message-ID: <87tvfzgobt.fsf@mellanox.com> References: <3a247e91ebe81cdae4bae27ec1631c5015fb943f.1552672441.git.petrm@mellanox.com> <20190316022658.GC29548@lunn.ch> <87zhpsgw7j.fsf@mellanox.com> <20190318140253.GH30224@lunn.ch> <20190318085221.037ad66a@shemminger-XPS-13-9360> In-Reply-To: <20190318085221.037ad66a@shemminger-XPS-13-9360> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5PR0602CA0021.eurprd06.prod.outlook.com (2603:10a6:203:a3::31) 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: 86f4018d-1ed4-43ed-0d8c-08d6ac542a12 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:AM6PR05MB4869; x-ms-traffictypediagnostic: AM6PR05MB4869: x-microsoft-antispam-prvs: x-forefront-prvs: 0981815F2F x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(39860400002)(346002)(366004)(376002)(396003)(199004)(189003)(97736004)(8936002)(99286004)(6436002)(105586002)(2906002)(86362001)(68736007)(6916009)(81166006)(106356001)(8676002)(71190400001)(71200400001)(7736002)(81156014)(15650500001)(6486002)(486006)(66066001)(305945005)(6116002)(25786009)(5660300002)(256004)(2616005)(6512007)(11346002)(316002)(53936002)(54906003)(446003)(186003)(229853002)(4326008)(478600001)(14454004)(14444005)(476003)(3846002)(6246003)(26005)(102836004)(386003)(52116002)(76176011)(6506007)(93886005)(36756003);DIR:OUT;SFP:1101;SCL:1;SRVR:AM6PR05MB4869;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: fDYKKggCco1e1rf9iV4LhAbwMHreK2gXYdsiVT7lOP/tREudmeBkT0vdFl0NiJkhxCluy2nug8pDYi2/5DDZaL5D5pIf9MPMm3HAN8Gt/KU/QXdz2TVGTd+OsopTAqOwKbsbYfkEz9F3wZI9HOITfEv6hVfxu0adCgwRXVvT31xd07klsTfTI+MsxSNWm1n+w6yNDAcxxEHJExrnEpRQtjx7oOC7X8zmA/Nr95mI4FjlgJ7yFfszQ16p626NOM8jS5Ruwdq6SkKCMZqoOZ25VXTm5YgAMO9CU/A74KFAhdNguW4iLL016AKgvxUSaI2KHuWTKBq7fx7LmZI7RnYh/EAB3kIbOzIb7yEojcInVnbemg5VW8DnTkxXEOP2QLjl9rGgyyTicWE6OJL6YPG8XPHvWESdOedyeaXiCCx6xL8= 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: 86f4018d-1ed4-43ed-0d8c-08d6ac542a12 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2019 10:18:00.5822 (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: AM6PR05MB4869 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Stephen Hemminger writes: > On Mon, 18 Mar 2019 15:02:53 +0100 > Andrew Lunn wrote: > >> 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 en= d >> > > to reflect whatever the hardware or software can determine. >> > >> > You still have the minor code to give you some information. >> >> The problem i have with OTHER, is that you know it is not NO_CABLE, >> UNSUPPORTED_CABLE, AUTONEG_FAILURE, etc. But for people to know what >> OTHER cannot be, they have to know all the codes. >> >> But then later, some other driver writer does the right thing, adds a >> new value to the end for a code they can detect. Say for example >> SFP_OVERHEATED. This happened to be what the previous driver was >> using for OTHER. Now we have one driver returning SFP_OVERHEATED and >> the older driver OTHER. So OTHER no longer actually mean 'other', it >> just means something random, which could actually be the same as one >> of the listed codes. >> >> You can stop this from happening by not having OTHER. Always add a new >> code if there is something you can report, but there currently is no >> code for it. And the userspace tool should just print the decimal >> value if it does not know what text to translate it into. > > Gut feel is that enumerated values are going to grow and grow and be > long term API headache. > > Would it be possible to use a string like the external ack error > message? It would, but then if any automated tools want to make use of it beyond just blindly displaying it, they will need to parse it with all the usual problems. In the end the string itself becomes the API anyway. Adding a string would make sense as an extra piece of information, not as the primary channel. Extack is like this as well, the primary channel there is errno.