[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190319115611.GA29968@unicorn.suse.cz>
Date: Tue, 19 Mar 2019 12:56:11 +0100
From: Michal Kubecek <mkubecek@...e.cz>
To: Petr Machata <petrm@...lanox.com>
Cc: Stephen Hemminger <stephen@...workplumber.org>,
Andrew Lunn <andrew@...n.ch>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Jiri Pirko <jiri@...lanox.com>,
Ido Schimmel <idosch@...lanox.com>,
"davem@...emloft.net" <davem@...emloft.net>,
Tariq Toukan <tariqt@...lanox.com>,
"jakub.kicinski@...ronome.com" <jakub.kicinski@...ronome.com>
Subject: Re: [RFC PATCH net-next 1/3] net: rtnetlink: Add link-down reason to
RTNL messages
On Tue, Mar 19, 2019 at 10:18:00AM +0000, Petr Machata wrote:
> Stephen Hemminger <stephen@...workplumber.org> 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
Powered by blists - more mailing lists