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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DA62C4332F for ; Fri, 4 Nov 2022 20:19:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229969AbiKDUTB (ORCPT ); Fri, 4 Nov 2022 16:19:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229505AbiKDUS7 (ORCPT ); Fri, 4 Nov 2022 16:18:59 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F4224B9AC; Fri, 4 Nov 2022 13:18:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=9EmpCQn2JtXjzKJNAAzmFElq0JAsPIVY4uXrTBDtmsw=; b=pGh5Zl03PPKgjEz9Gyg0OcWmFf 23h/4RmeBesW47/gaD9RbCmgQK5jr++OTAF+ninARnOs3oU1mhY4sonVW1QCuwbuw2905Of9c7gaV DahXcIuQjTnFP07MLnlF33ZErOHrE71L+gnQAJmXHaRIy6FhbI1soqbuciRNCwXJ2vGd6iHCbCgYk 4AX7AefOgmB5ATR/dBPS4jKSXKIxlcEq3Ge9Yb6kfVNaqXmd44FQTuSBrR9brXbl/xH9xFAEdY6Qi ue75A0DQeSWbyJU0IPCo9ep8wyHV+mQG6DicSE96+yTeBL6N72+GdrQ13fcLz1XR+14OzJqrFH4sQ N7pUkqKg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:35116) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1or39L-00084d-6R; Fri, 04 Nov 2022 20:18:47 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1or39E-0001A3-MM; Fri, 04 Nov 2022 20:18:40 +0000 Date: Fri, 4 Nov 2022 20:18:40 +0000 From: "Russell King (Oracle)" To: Jakub Kicinski Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com, Florian Fainelli , Michael Chan , Andrew Lunn , corbet@lwn.net, hkallweit1@gmail.com, huangguangbin2@huawei.com, chenhao288@hisilicon.com, moshet@nvidia.com, linux@rempel-privat.de, linux-doc@vger.kernel.org Subject: Re: [PATCH net-next v5] ethtool: linkstate: add a statistic for PHY down events Message-ID: References: <20221104190125.684910-1-kuba@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221104190125.684910-1-kuba@kernel.org> Sender: Russell King (Oracle) Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On Fri, Nov 04, 2022 at 12:01:25PM -0700, Jakub Kicinski wrote: > The previous attempt to augment carrier_down (see Link) > was not met with much enthusiasm so let's do the simple > thing of exposing what some devices already maintain. > Add a common ethtool statistic for link going down. > Currently users have to maintain per-driver mapping > to extract the right stat from the vendor-specific ethtool -S > stats. carrier_down does not fit the bill because it counts > a lot of software related false positives. > > Add the statistic to the extended link state API to steer > vendors towards implementing all of it. > > Implement for bnxt and all Linux-controlled PHYs. mlx5 and (possibly) > enic also have a counter for this but I leave the implementation > to their maintainers. Hi Jakub, I guess we'll need phylink to support this as well, so phylink using drivers can provide this statistic not only for phylib based PHYs, but also for direct SFP connections as well. Thinking about the complexities of copper SFPs that may contain a PHY, it seems to me that the sensible implementation would be for phylink to keep the counter and not use the phylib counter (as that PHY may be re-plugged and thus the count can reset back to zero) which I suspect userspace would not be prepared for. Russell. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!