From: Michal Kubecek Subject: Re: [RFC PATCH net-next v2 10/17] ethtool: implement GET_SETTINGS message Date: Mon, 30 Jul 2018 21:42:42 +0200 Message-ID: <20180730194242.daornhxcc74o7f4c@unicorn.suse.cz> References: <67d3b68a50e95db9612cc96e42a52ce332f716a9.1532953989.git.mkubecek@suse.cz> <20180730190941.GL2983@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jiri Pirko , David Miller , Florian Fainelli , Roopa Prabhu , Jakub Kicinski , "John W. Linville" To: Andrew Lunn Return-path: Content-Disposition: inline In-Reply-To: <20180730190941.GL2983@lunn.ch> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Mon, Jul 30, 2018 at 09:09:41PM +0200, Andrew Lunn wrote: > > +Response contents: > > + > > + ETHA_SETTINGS_LINK (u32) link state > > > + [ETHA_SETTINGS_LINK] = { .type = NLA_FLAG }, > > Is this correct? NLA_FLAG is wrong, we need three states: on/off/unknown for "get" replies and on/off/keep for "set" requests. > The link is either up or down. So a u32 seems a bit big. I tend to use u32 everywhere with some obvious exceptions. The reason is that netlink attributes are padded to 32 bits so that no matter if you use u8, u16 or u32, the attribute still ends up taking 8 bytes. But yes, this looks like an obvious exception where u8 wouldn't mean any risk of running out of values one day. Michal Kubecek