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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 E5EFCC2D0A3 for ; Thu, 29 Oct 2020 09:03:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 85CEC2076B for ; Thu, 29 Oct 2020 09:03:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726381AbgJ2JDa (ORCPT ); Thu, 29 Oct 2020 05:03:30 -0400 Received: from mx2.suse.de ([195.135.220.15]:41076 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725904AbgJ2JDa (ORCPT ); Thu, 29 Oct 2020 05:03:30 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 07B80ABA2; Thu, 29 Oct 2020 09:03:29 +0000 (UTC) Received: by lion.mk-sys.cz (Postfix, from userid 1000) id 787B0604D8; Thu, 29 Oct 2020 10:03:28 +0100 (CET) Date: Thu, 29 Oct 2020 10:03:28 +0100 From: Michal Kubecek To: Ido Schimmel Cc: Jakub Kicinski , netdev@vger.kernel.org, davem@davemloft.net, f.fainelli@gmail.com, andrew@lunn.ch, David.Laight@aculab.com, mlxsw@nvidia.com, Ido Schimmel Subject: Re: [RFC PATCH net-next v3] ethtool: Improve compatibility between netlink and ioctl interfaces Message-ID: <20201029090328.jwl7w7noeib3d4cz@lion.mk-sys.cz> References: <20201027145114.226918-1-idosch@idosch.org> <20201027145305.48ca1123@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20201028005339.45daonidsidbzawn@lion.mk-sys.cz> <20201028173436.GA504959@shredder> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201028173436.GA504959@shredder> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Oct 28, 2020 at 07:34:36PM +0200, Ido Schimmel wrote: > On Wed, Oct 28, 2020 at 01:53:39AM +0100, Michal Kubecek wrote: > > On Tue, Oct 27, 2020 at 02:53:05PM -0700, Jakub Kicinski wrote: > > > > > > I did not look at the legacy code but I'm confused by what you wrote. > > > > > > IIUC for ioctl it's the user space that sets the advertised. > > > For netlink it's the kernel. > > > So how does the legacy flag make the kernel behave like it used to? > > > > The idea why I suggested "legacy" as the name was that it allowed > > ethtool to preserve the old behaviour (without having to query for > > supported modes first). But from this point of view it's indeed a bit > > confusing. > > I think it would be best to solve this by having user space query the > kernel for supported link modes if autoneg is being enabled without > additional parameters. Then user space will issue a set request with > ETHTOOL_A_LINKMODES_OURS being set to all supported link modes. > > It does not require kernel changes and would be easier on users that > currently need to resort to old ethtool despite having a kernel that > supports netlink-based ethtool. That would certainly be a solution. I'm not exactly happy about having to issue two requests but (1) it would be limited to specific case with "autoneg on" without advertise, speed and duplex (and lanes, when/if it's introduced), (2) we would need an extra request to check support of the flag anyway and (3) supported modes of a device are unlikely to change so that we don't have to worry about races. Michal