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.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED,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 4AE0FC43381 for ; Tue, 19 Mar 2019 11:56:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1C28B20857 for ; Tue, 19 Mar 2019 11:56:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727235AbfCSL4T (ORCPT ); Tue, 19 Mar 2019 07:56:19 -0400 Received: from mx2.suse.de ([195.135.220.15]:54692 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726578AbfCSL4T (ORCPT ); Tue, 19 Mar 2019 07:56:19 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id AE5A0AB42; Tue, 19 Mar 2019 11:56:17 +0000 (UTC) Received: by unicorn.suse.cz (Postfix, from userid 1000) id D64F7E00BF; Tue, 19 Mar 2019 12:56:11 +0100 (CET) Date: Tue, 19 Mar 2019 12:56:11 +0100 From: Michal Kubecek To: Petr Machata Cc: Stephen Hemminger , 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 Message-ID: <20190319115611.GA29968@unicorn.suse.cz> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87tvfzgobt.fsf@mellanox.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Mar 19, 2019 at 10:18:00AM +0000, Petr Machata wrote: > Stephen Hemminger writes: > > 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. Providing only text description doesn't sound right to me either, I would rather prefer having both text and numeric code in such case. > 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. Not exactly, the primary goal of extack was IMHO to provide better granularity than the standard error codes allowed (we all remember the cryptic messages of older iproute2 versions). A better analogy would be numeric error codes which could be passed via extack cookie (e.g. nl_set_extack_cookie_u64()) together with a text representation. But AFAIK only few netlink based interfaces use those. Michal Kubecek