Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1618751ybt; Thu, 2 Jul 2020 09:35:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrfP2i7A5xHydET2USOjJw1cy9icb1cssz7ji28Cs5Xsq9V/Qv0tsJcLtJC9yb7Y8dn/JR X-Received: by 2002:a50:9a82:: with SMTP id p2mr35043049edb.130.1593707717940; Thu, 02 Jul 2020 09:35:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593707717; cv=none; d=google.com; s=arc-20160816; b=dvFk3qez7AQk4A1eFn0Tult5q0BgIG23qQ7bDgu6wvuCP7cZ5jaQg0KQ1q80ImmGMj MRdnHXBRGIipx3RtIgn0JNma+XRU/dmOfMsNQrSBs6gGWhx3hDWiQs3K2eY51VcMKNem f9Vik+6cInfs1ym3WDfj/nAr21yUM4y8w9a/yKSjpgm+iDRgXS3U1u2YnecqrO+azlnj 0HYP+HkcZrkS9RA5tTHNWp4z14PKpY6Ths1ojF8v7wy8hMFjH053ePWafVPKNOxdcKu8 SDxF0NDXALSoILBfNsPrY9/SOarrRiv+GQwdzCV76DfMZUml2wKvivxMQC+S7zDatKi9 D4sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=eUmN9lwnxmIwjWyrCYdoIUZgs9u6IXaw3/Mh440VVT4=; b=yw6iHm2dSieLEjFYh5Cr96liMbzvuP8RrFNPM/BHm02MiaoHZOlnqvRyxTaVLdvtgq V1OrsEUdp3q7cU6WKbrxqusGe01N6rNY9TEP2dpQmpT1DE5n/kzugSyAnuqWwVC6AdJL rfehjNH9OUZmkX+xcIHQPQodltABE1hhTM1LTrArLOOZ2gZcU7mWGMF1ymQaaJApITme mCGITVtMQAGzsJvqVyJH5XxBZrQccOz8lmGLy/gCdpRB8rMpYoaDJ83BtdcQFm8LszDC o29vLRfRYlw+x4GmpNvGrtaQUfByknoxk7a1RUg+VAIv9u9XOgAIIcE/pikTZxfy3Myy G19g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n6si6089571ejs.278.2020.07.02.09.34.54; Thu, 02 Jul 2020 09:35:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726778AbgGBQec (ORCPT + 99 others); Thu, 2 Jul 2020 12:34:32 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:44222 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726715AbgGBQec (ORCPT ); Thu, 2 Jul 2020 12:34:32 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1jr2AK-003Le7-P9; Thu, 02 Jul 2020 18:34:24 +0200 Date: Thu, 2 Jul 2020 18:34:24 +0200 From: Andrew Lunn To: Michal Kubecek Cc: Florian Fainelli , netdev@vger.kernel.org, Heiner Kallweit , Russell King , "David S. Miller" , Jakub Kicinski , open list Subject: Re: [PATCH net-next 0/4] net: ethtool: Untangle PHYLIB dependency Message-ID: <20200702163424.GG752507@lunn.ch> References: <20200702042942.76674-1-f.fainelli@gmail.com> <20200702155652.ivokudjptoect6ch@lion.mk-sys.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200702155652.ivokudjptoect6ch@lion.mk-sys.cz> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 02, 2020 at 05:56:52PM +0200, Michal Kubecek wrote: > On Wed, Jul 01, 2020 at 09:29:38PM -0700, Florian Fainelli wrote: > > Hi all, > > > > This patch series untangles the ethtool netlink dependency with PHYLIB > > which exists because the cable test feature calls directly into PHY > > library functions. The approach taken here is to utilize a new set of > > net_device_ops function pointers which are automatically set to the PHY > > library variants when a network device driver attaches to a PHY device. > > I'm not sure about the idea of creating a copy of netdev_ops for each > device using phylib. First, there would be some overhead (just checked > my 5.8-rc3 kernel, struct netdev_ops is 632 bytes). Second, there is > quite frequent pattern of comparing dev->netdev_ops against known > constants to check if a network device is of certain type; I can't say > for sure if it is also used with devices using phylib in existing code > but it feels risky. I agree with Michal here. I don't like this. I think we need phylib to register a set of ops with ethtool when it loads. It would also allow us to clean up phy_ethtool_get_strings(), phy_ethtool_get_sset_count(), phy_ethtool_get_stats(). Andrew