Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp376113rwb; Tue, 6 Dec 2022 22:59:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf6r1Zd4+OBn+D7wJs5VdFxOlB6oXQTIZXdO1u3FEnUlK/tUBNzjb6cugF4yV/QVrIwdGCIV X-Received: by 2002:a17:902:e352:b0:189:c592:a4f4 with SMTP id p18-20020a170902e35200b00189c592a4f4mr20089961plc.82.1670396364798; Tue, 06 Dec 2022 22:59:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670396364; cv=none; d=google.com; s=arc-20160816; b=HjF7BcKMZ7tf5qxvFeFJfBqVlXZrRgTyncdUtCWV9hxds/GpGQZ3RnluihtFaMR0Jb sBR7T/bWN6UA94fQ4LjalW2DgUELA8dFtTpL+xf5zqRr22ueKWVtcLjbYZFN0k8ywFoz lknt3RPl0cuWCEnhY57mcQw84QJUEnez+qaBxXOOiVQHwTf662BnqIJO57mr0z40Cv9H B/M0ZblqYkFjSi0JBKt/Sdjs9hcqi/vnxdthL8l2SI0roK+oBknlBJEmjSGR1/ZoMTts ljiVDazs9+g4gY398fsPJ2DeJ806/8S1NRI27DAjGCGFTU0MNAVWBARuITvKF7YV8bqA Tg7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=DpGVBo//tf8Dzk0qYtgGfL6dSvsTVJo2OIM36Kmu2W4=; b=VlcoOxkP1mjGZOkG7Mjk9CXhEzCigLLVlWvSMyz7UOwGplx76d3Dk20LlQJLHfaN9j vxXak+Fu/JoKw9bMj6k4KBW7T7zNtoszD5RcBJFLSzH1YjJNWdfvYa+HW4/goGTGQxS6 GL9fE3D6K49/pKbwXr7GjgXm4r8ioGD4l+/c5dyqyGb4PQKe8arnVyE0dX6TOehYeqEr FGoDOEKcJZx92pvohgHvfJaUavx/CSHUVnuRu83uMQNtDxjqQeQmFvms7cKGXyeFvhkc q1okfQOk1iMDNE4X6Ylm6XhrxZAU1BzUk8FxevJ6gRi5K0AvhYjx5fctPLHkThUiMW0M 4r8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d67-20020a633646000000b004769410323fsi20290779pga.820.2022.12.06.22.59.14; Tue, 06 Dec 2022 22:59:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229813AbiLGGQk (ORCPT + 77 others); Wed, 7 Dec 2022 01:16:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229742AbiLGGQh (ORCPT ); Wed, 7 Dec 2022 01:16:37 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AFE758BC6 for ; Tue, 6 Dec 2022 22:16:37 -0800 (PST) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p2njK-0003p7-Oa; Wed, 07 Dec 2022 07:16:30 +0100 Received: from ore by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1p2njK-0007Y7-G9; Wed, 07 Dec 2022 07:16:30 +0100 Date: Wed, 7 Dec 2022 07:16:30 +0100 From: Oleksij Rempel To: Jakub Kicinski Cc: Woojung Huh , Andrew Lunn , Arun.Ramadoss@microchip.com, Florian Fainelli , "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, UNGLinuxDriver@microchip.com, Eric Dumazet , kernel@pengutronix.de, Paolo Abeni , Vladimir Oltean , Vivien Didelot Subject: Re: [PATCH net-next v1 1/1] net: dsa: microchip: add stats64 support for ksz8 series of switches Message-ID: <20221207061630.GC19179@pengutronix.de> References: <20221205052904.2834962-1-o.rempel@pengutronix.de> <20221206114133.291881a4@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20221206114133.291881a4@kernel.org> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 06, 2022 at 11:41:33AM -0800, Jakub Kicinski wrote: > On Mon, 5 Dec 2022 06:29:04 +0100 Oleksij Rempel wrote: > > + stats->rx_packets = raw->rx_bcast + raw->rx_mcast + raw->rx_ucast + > > + raw->rx_pause; > > + stats->tx_packets = raw->tx_bcast + raw->tx_mcast + raw->tx_ucast + > > + raw->tx_pause; > > FWIW for normal netdevs / NICs the rtnl_link_stat pkts do not include > pause frames, normally. Otherwise one can't maintain those stats in SW > (and per-ring stats, if any, don't add up to the full link stats). > But if you have a good reason to do this - I won't nack.. Pause frames are accounted by rx/tx_bytes by HW. Since pause frames may have different size, it is not possible to correct byte counters, so I need to add them to the packet counters. Regards, Oleksij -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |