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 A9221C43334 for ; Tue, 28 Jun 2022 08:45:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241905AbiF1Ipv (ORCPT ); Tue, 28 Jun 2022 04:45:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239715AbiF1Ipp (ORCPT ); Tue, 28 Jun 2022 04:45:45 -0400 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 79C8A2DD49 for ; Tue, 28 Jun 2022 01:45:18 -0700 (PDT) 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 1o66qI-0002yY-8s; Tue, 28 Jun 2022 10:45:06 +0200 Received: from ore by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1o66qG-0000Bz-Ok; Tue, 28 Jun 2022 10:45:04 +0200 Date: Tue, 28 Jun 2022 10:45:04 +0200 From: Oleksij Rempel To: Andrew Lunn Cc: Jakub Kicinski , Woojung Huh , Florian Fainelli , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "David S. Miller" , Eric Dumazet , Lukas Wunner , kernel@pengutronix.de, Paolo Abeni , Vladimir Oltean , Vivien Didelot , UNGLinuxDriver@microchip.com Subject: Re: [PATCH net-next v1 2/3] net: dsa: ar9331: add support for pause stats Message-ID: <20220628084504.GA31626@pengutronix.de> References: <20220624125902.4068436-1-o.rempel@pengutronix.de> <20220624125902.4068436-2-o.rempel@pengutronix.de> <20220624220317.ckhx6z7cmzegvoqi@skbuf> <20220626171008.GA7581@pengutronix.de> <20220627091521.3b80a4e8@kernel.org> <20220627200238.en2b5zij4sakau2t@skbuf> <20220627200959.683de11b@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 28, 2022 at 09:22:53AM +0200, Andrew Lunn wrote: > > Yeah, the corrections are always iffy. I understand the doubts, and we > > can probably leave things "under-specified" until someone with a strong > > preference comes along. But I hope that the virt example makes it clear > > that neither of the choices is better (SR-IOV NICs would have to start > > adding the pause if we declare rtnl stats as inclusive). > > > > I can see advantages to both counting (they are packets) and not > > counting those frames (Linux doesn't see them, they get "invented" > > by HW). > > > > Stats are hard. > > I doubt we can define it either way. I once submitted a patch for one > driver to make it ignore CRC bytes. It then gave the exact same counts > as another hardware i was using, making the testing i was doing > simpler. > > The patch got rejected simply because we have both, with CRC and > without CRC, neither is correct, neither is wrong. > > So i would keep it KISS, pause frames can be included, but i would not > go to extra effort to include them, or to exclude them. After I started investigating this topic, I was really frustrated. It is has hard to find what is wrong: my patch is not working and flow controller is not triggered? Or every HW/driver implements counters in some own way. Same is about byte counts: for same packet with different NICs i have at least 3 different results: 50, 64 and 68. It makes testing and validation a nightmare. 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 |