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.0 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,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 81DB9C43381 for ; Mon, 18 Mar 2019 15:52:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2E1CC2087E for ; Mon, 18 Mar 2019 15:52:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=networkplumber-org.20150623.gappssmtp.com header.i=@networkplumber-org.20150623.gappssmtp.com header.b="Ekvq5Z7+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727400AbfCRPwZ (ORCPT ); Mon, 18 Mar 2019 11:52:25 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:44052 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726714AbfCRPwY (ORCPT ); Mon, 18 Mar 2019 11:52:24 -0400 Received: by mail-pg1-f194.google.com with SMTP id h34so11651006pgh.11 for ; Mon, 18 Mar 2019 08:52:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5Igz8fSeKCCs2DMsut0EJBpQMD3DEcGogKon/HmFTiI=; b=Ekvq5Z7+qxmlwn2TDFvvkDxQUCLjyzwdBsuIZCA/b/xx2QvBTiXlukfOAPclYf9Zs+ zqGD2mFNkkQKf2kYObhqm0chnikULO4zSjGpx5LQi+pWlBnoOVT8TWlUOlz8C0gIFg6T BMc+4ioPU3A20cAs9oYYDkPCdOxI/qzZI3mh/74vIJ15YLj+Vn0pUQOKM8fSO90VsEGK MUtPWR/QyGG8JVO7ozw/u10q3LLkq2rpRZx+dM5ZxD+ruwZKjo7iFzvkxoRtZVRWAIOy UUQY18DkNBkzQgbN6Bx6RCV4mLAk2OdZNoVUJZdSDp7Ue9Z7SXIZbeX78rM+B+EgSMQ4 QUQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5Igz8fSeKCCs2DMsut0EJBpQMD3DEcGogKon/HmFTiI=; b=SahrVH0L8ou5azKm2dMkQvYCmpichBz1cPwPJXH1COan8Lwim8L/TMaEw5qZqNnnLP pZ45p6CvAuLsnSZ5r68vk8U8OiY+7ITErbaztaqkZwJu6ThaoogSXpTrwYOAdzmWGQmu b6sV2V8+K8mtyBBWtaMYkDtYG7slFFNBGn8KbkWNyDCeShDqi/mbzfKs7MmVXY7J3LJn wgLoYZwZkVKAOE4/G61xQSc6vhI6ZYd25LIoEV0D7jd4SgvgAOuJ43tc4ejjFyFL/eWN ovl174xf69XReJBKAURKgWd0HOVUJzG/HkE5yV10CRixPUaamORjRZ55LsJNHgYkvR3x JHAQ== X-Gm-Message-State: APjAAAU5H86XeHysedALflq5VTqw6SZNAtiBvOy1vSf1iI4nClt+yhXx NrKd/uZHtDZ+ZBvIeLoNJELOGg== X-Google-Smtp-Source: APXvYqwCEnxqRXIILWK1L/Gz7FnCApXUJG0dKGq6R+xtooGlAOrmdr3XPnpo3sf17W0ocBz6ujBZGQ== X-Received: by 2002:a17:902:380c:: with SMTP id l12mr20398162plc.238.1552924343670; Mon, 18 Mar 2019 08:52:23 -0700 (PDT) Received: from shemminger-XPS-13-9360 (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id 20sm14409342pgr.80.2019.03.18.08.52.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Mar 2019 08:52:23 -0700 (PDT) Date: Mon, 18 Mar 2019 08:52:21 -0700 From: Stephen Hemminger To: Andrew Lunn Cc: Petr Machata , "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 Message-ID: <20190318085221.037ad66a@shemminger-XPS-13-9360> In-Reply-To: <20190318140253.GH30224@lunn.ch> References: <3a247e91ebe81cdae4bae27ec1631c5015fb943f.1552672441.git.petrm@mellanox.com> <20190316022658.GC29548@lunn.ch> <87zhpsgw7j.fsf@mellanox.com> <20190318140253.GH30224@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 end > > > 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?