Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3751974iog; Tue, 28 Jun 2022 01:54:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vWFPewFXga9PPPK07IHqmIg5tUNl5sb60jh4c3dT42KpH42AnD8e3vcdsmyKFFPOzgT1qs X-Received: by 2002:a17:902:6b42:b0:15d:3603:6873 with SMTP id g2-20020a1709026b4200b0015d36036873mr3797773plt.30.1656406463948; Tue, 28 Jun 2022 01:54:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656406463; cv=none; d=google.com; s=arc-20160816; b=ZzSBl04VocwLoIKYSUcj8KSZgjpIAfsYdiYKm3vKZ0ADNjUuzbYxKBEFWi9mS0knyH 7QLdhCFC7pa4CNMzAvWEF9wJ0RluRjbr2akV1u+tReU5GQmaOrTlKyn6S/TIfmP+WVwD 7Drdiv7SdMjbxLdIulRpjjNfQ5ZGuuTbfbDFs0fran04DRaFpnWrwYmqgckv5z5pie6I C1C8f7Ag11dxlIR9R+X+pcq5TTkOKnURlXCdpLGKUz5tW1+HEJof1Glv4U7q3VnSu1m2 cZR1bB91u41u1DP58JIPbSe5G0OYDY5gEsKkv88IJKIH4rwBehcnoHEv4h3LMzdpCQfo aWVw== 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=2XME8Vb9Vbl1amyrVc3ZYxOcPa95/aVdocKrdD9656s=; b=yZlRQbgUTbCiO6pMOBBAENUq+Y8xQ6Ga5n20IKtRoZHUa+G5K2hL3PHafO16sjGF/o QWgWg61WZ1RYc/l5FNNaEmZHIx8AY6U8atU7Oo6xdjCo0zKsArYzPwvsgh1Egdx4VvW6 ou5vyThiGpzQ3LVJguf705f+2tzVs4iqTb7N0eveBiL+x62jeR/5Lkv/oFK0ZyHJXmiE UaQXDM3BmKTtprO3DRW6fI3hxMXfMU5/WyvDmvIUSEd1BbAMjczvgvMdpQKvL08/32Eq hptJA5v93aApDDR93h2xMfHgfFVguXutfnquBgvFE+7RFKVLLd4adjw6mB73csbTwujf yFNA== 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 h14-20020a056a00218e00b00522c6bd71d2si19946813pfi.372.2022.06.28.01.54.12; Tue, 28 Jun 2022 01:54:23 -0700 (PDT) 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 S1344009AbiF1Ipv (ORCPT + 99 others); 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 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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, 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 |