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 0B217C10F0D for ; Tue, 19 Mar 2019 15:58:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CAB4A206B7 for ; Tue, 19 Mar 2019 15:58:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="BjSAKSOZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727357AbfCSP56 (ORCPT ); Tue, 19 Mar 2019 11:57:58 -0400 Received: from mail-eopbgr70085.outbound.protection.outlook.com ([40.107.7.85]:59790 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726466AbfCSP56 (ORCPT ); Tue, 19 Mar 2019 11:57:58 -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=eGIPa566fqRKOxB2TS5H0m5hbxRpLLpEheK0+Xd0h28=; b=BjSAKSOZhkMv+rQQrImR+/pRcSeu+iJ1C9Y8D7D9MLl7dmzHNq+3/Cu2s46KsOQ2mZxYqYxZVeBwrvWvq2o3Pis9bYnWnqUXyeUppurtUbvAiBKW7AgOngyBukiK2Qf+uqd2E22dOnjeCll6VBKf2Q3Y6IWEz5uGtepJzTJuTnE= Received: from AM6PR05MB6133.eurprd05.prod.outlook.com (20.179.3.144) by AM6PR05MB5206.eurprd05.prod.outlook.com (20.177.191.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1709.13; Tue, 19 Mar 2019 15:57:53 +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 15:57:53 +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+skDyyqYNiMQAgAPZ2gCAAA1AgIAAHpWAgAE06ACAAFqQAIAABGgA Date: Tue, 19 Mar 2019 15:57:53 +0000 Message-ID: <87r2b2hn5r.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> <87tvfzgobt.fsf@mellanox.com> <20190319084206.6553a9f1@shemminger-XPS-13-9360> In-Reply-To: <20190319084206.6553a9f1@shemminger-XPS-13-9360> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR07CA0005.eurprd07.prod.outlook.com (2603:10a6:209:2a::18) 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: 7c15efc6-0559-4eae-590a-08d6ac83a56c x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(5600127)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:AM6PR05MB5206; x-ms-traffictypediagnostic: AM6PR05MB5206: x-microsoft-antispam-prvs: x-forefront-prvs: 0981815F2F x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(366004)(396003)(39860400002)(136003)(346002)(199004)(189003)(305945005)(6506007)(386003)(105586002)(2906002)(7736002)(76176011)(86362001)(68736007)(186003)(256004)(14444005)(8936002)(102836004)(26005)(71190400001)(71200400001)(53936002)(93886005)(446003)(476003)(6116002)(11346002)(97736004)(99286004)(2616005)(486006)(66066001)(5660300002)(14454004)(3846002)(6916009)(8676002)(36756003)(4326008)(6246003)(81156014)(81166006)(6436002)(229853002)(106356001)(478600001)(316002)(25786009)(6512007)(52116002)(15650500001)(54906003)(6486002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM6PR05MB5206;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: 1ESBjCUOAueqfFNUlPnTYIUG4Km2PU0ZES6iQSXg37s3NCTFCDlGJ3fJTth6F13i457MEhgRtKaCFrPsAnvCtRJLyyZhfdgolP2U2coNgQzGo/+a/mqZLIBgQNdblks+2MO0OdJhIPm9tNnX3wUF7Bo2+P7IUfru7/TI5MfU3zp0ZWeUROikIjQXI8WX0IM+W9oMNR9eY6zfFjDP86ZRNlNH3mir7zG1g9zZwZgJ9AlxXDAji8Hzv/roSG/7vFnaNXjndKPAaC3LDkiEKlrVUyCdShD0tXMvsq8tHd0whhCvYRERXhwcZd8df3Mf0FTBg6vN6MKdH7yytkKbmpgiVULmLOKGwNj1kmr0/pgnviIWiGggtBDoURJNjRwZ1WkVIarFEe7CUaA1aLpir4n09YWO9ON3UuMupbdQ5xX+Rj0= 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: 7c15efc6-0559-4eae-590a-08d6ac83a56c X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2019 15:57:53.8830 (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: AM6PR05MB5206 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Stephen Hemminger writes: > On Tue, 19 Mar 2019 10:18:00 +0000 > Petr Machata wrote: > >> Stephen Hemminger writes: >>=20 >> > On Mon, 18 Mar 2019 15:02:53 +0100 >> > Andrew Lunn wrote: >> > =20 >> >> On Mon, Mar 18, 2019 at 01:15:41PM +0000, Petr Machata wrote: =20 >> >> > >> >> > Andrew Lunn writes: >> >> > =20 >> >> > >> +enum rtnl_link_down_reason_major { >> >> > >> + RTNL_LDR_OTHER, =20 >> >> > > >> >> > > Does 'other' make any sense? Seem better to just not report anyth= ing >> >> > > at all, or add a comment that more reasons should be added at the= end >> >> > > to reflect whatever the hardware or software can determine. =20 >> >> > >> >> > You still have the minor code to give you some information. =20 >> >> >> >> 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 ne= w >> >> 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. =20 >> > >> > 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? =20 >>=20 >> 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. > > The problem with codes is that without some standard (like IETF) the > values are very system specific and likely to get lots of of version chur= n. I think this would be even worse with just strings.