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 EE9AFC4332F for ; Fri, 4 Nov 2022 22:52:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229805AbiKDWwd (ORCPT ); Fri, 4 Nov 2022 18:52:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231204AbiKDWvz (ORCPT ); Fri, 4 Nov 2022 18:51:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 298C94B9AF; Fri, 4 Nov 2022 15:48:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B91B662365; Fri, 4 Nov 2022 22:48:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D313C433C1; Fri, 4 Nov 2022 22:48:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667602091; bh=bqV/vszFeBDsONkoSz/IwUrRhBqKQlBIMsG1jNqmdtM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=YZsRN0TFyDcszgT4fq/V9blHS7nDEmG8ozFrrQgBSC29lwI3YtwsyDOz0AoJfWd2u WN81pmcGCiOercsVzUh7qzywCuQwlbDTkt87OXHD0sEFotpLynAR1fQKVKBR/Y5Yc0 mjmYjjRf9kCqBpWQqFqaO5SMPkLChSR41ExsTgGc2y1ii0LT3ktS/Z13NsfwMBYtiQ 3U/ucX3HhXW50GXF+c0filSvc/HuFld10F5Y8iBkdUXkPmNIMoq29igs5R1TK54/Gz 7QrWvLdhkO5t2WpthCYsq89nw+evHaMtT9EkXrJhuFNHW5dQJgvTb0wjZWwQs+hnUJ oyd6fZjXTo7ig== Date: Fri, 4 Nov 2022 15:48:09 -0700 From: Jakub Kicinski To: "Russell King (Oracle)" 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: <20221104154809.671ac378@kernel.org> In-Reply-To: References: <20221104190125.684910-1-kuba@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, 4 Nov 2022 20:18:40 +0000 Russell King (Oracle) wrote: > 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. Makes sense, having the counter go back on a netdev could be highly confusing for local detection. How would you like to proceed? I can try to take a stab at a phylink implementation but a stab it will be.