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.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,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 2AAC2C33CAF for ; Thu, 16 Jan 2020 23:48:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E53792073A for ; Thu, 16 Jan 2020 23:48:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="OImhmIjv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392003AbgAPXsS (ORCPT ); Thu, 16 Jan 2020 18:48:18 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:43316 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729858AbgAPXsO (ORCPT ); Thu, 16 Jan 2020 18:48:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender: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=rmXiI3vzC8bbhiQCSSQ77/Y3ycjkva4fep8g+DTRJh0=; b=OImhmIjv6TUI80mkEkVUTIAL8t MvsEOzKFFnLQaVyUmOGsRM47UflQ9ZVLyQfrym0k61eMsf3Coh8TjPmYTafrANTrI86v9wpa/TCN9 1Hbvf0kQiHWxCFj5WtDbjAOSMrazOjJSRGdLNi+HSHV0JbGVVh2Oh+M8mQV3AUemPZSw=; Received: from andrew by vps0.lunn.ch with local (Exim 4.93) (envelope-from ) id 1isErv-0001O9-9t; Fri, 17 Jan 2020 00:48:07 +0100 Date: Fri, 17 Jan 2020 00:48:07 +0100 From: Andrew Lunn To: Florian Fainelli Cc: netdev@vger.kernel.org, cphealy@gmail.com, rmk+kernel@armlinux.org.uk, Heiner Kallweit , "David S. Miller" , open list Subject: Re: [PATCH net-next v3] net: phy: Maintain MDIO device and bus statistics Message-ID: <20200116234807.GJ19046@lunn.ch> References: <20200116044856.1819-1-f.fainelli@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200116044856.1819-1-f.fainelli@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 15, 2020 at 08:48:50PM -0800, Florian Fainelli wrote: > We maintain global statistics for an entire MDIO bus, as well as broken > down, per MDIO bus address statistics. Given that it is possible for > MDIO devices such as switches to access MDIO bus addresses for which > there is not a mdio_device instance created (therefore not a a > corresponding device directory in sysfs either), we also maintain > per-address statistics under the statistics folder. The layout looks > like this: > > /sys/class/mdio_bus/../statistics/ > transfers > errrors > writes > reads > transfers_ > errors_ > writes_ > reads_ > > When a mdio_device instance is registered, a statistics/ folder is > created with the tranfers, errors, writes and reads attributes which > point to the appropriate MDIO bus statistics structure. > > Statistics are 64-bit unsigned quantities and maintained through the > u64_stats_sync.h helper functions. > > Signed-off-by: Florian Fainelli Tested-by: Andrew Lunn Reviewed-by: Andrew Lunn Andrew