From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: Re: [RFC PATCH net-next v2 10/17] ethtool: implement GET_SETTINGS message Date: Tue, 21 Aug 2018 16:10:22 +0200 Message-ID: <20180821141022.GD2985@lunn.ch> References: <67d3b68a50e95db9612cc96e42a52ce332f716a9.1532953989.git.mkubecek@suse.cz> <20180730185455.GJ2983@lunn.ch> <20180821093245.ktattosaduf6jvya@unicorn.suse.cz> 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: Michal Kubecek Return-path: Content-Disposition: inline In-Reply-To: <20180821093245.ktattosaduf6jvya@unicorn.suse.cz> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Tue, Aug 21, 2018 at 11:32:46AM +0200, Michal Kubecek wrote: > On Mon, Jul 30, 2018 at 08:54:55PM +0200, Andrew Lunn wrote: > > > +/* Internal kernel helper to query a device ethtool_link_settings. > > > + * > > > + * Backward compatibility note: for compatibility with legacy drivers > > > + * that implement only the ethtool_cmd API, this has to work with both > > > + * drivers implementing get_link_ksettings API and drivers > > > + * implementing get_settings API. When drivers implement get_settings > > > + * and report ethtool_cmd deprecated fields > > > + * (transceiver/maxrxpkt/maxtxpkt), these fields are silently ignored > > > + * because the resulting struct ethtool_link_settings does not report them. > > > > ~/linux/drivers$ grep -r [.]get_settings * > > net/ethernet/8390/etherh.c: .get_settings = etherh_get_settings, > > > > I don't think it is worth adding support for .get_settings for just > > one driver. It is better to just convert that driver to the new API. > > I have prepared a patch converting 8390/etherh driver to use > {g,s}et_link_ksettings and I'm going to submit it when net-next opens. > Do you think we can then drop {g,s}et_settings callbacks completely > (i.e. also from ioctl() code and ethtool_ops)? Do we care about > unconverted out of tree drivers? Hi Michal We cannot break ethtool, the ABI it uses. But there is already code to use get_link_ksettings() and only fall back to get_settings if it does not exist. So we can clean up all the fallback code, remove the ethtool_ops, etc. I personally don't care about out of tree drivers. They have had over 2 years to change to the new API. Andrew