Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp494573rwb; Wed, 7 Dec 2022 22:03:31 -0800 (PST) X-Google-Smtp-Source: AA0mqf4uv9UzUwmNkzBJ4FTrGE4CgX2oedwQJRt1/r1dgg0FpcKlNOkStySjy0/85brqVQArXSSY X-Received: by 2002:a05:6402:1246:b0:46d:a8f2:93e8 with SMTP id l6-20020a056402124600b0046da8f293e8mr330778edw.423.1670479411314; Wed, 07 Dec 2022 22:03:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670479411; cv=none; d=google.com; s=arc-20160816; b=MrBa9RxfhIypp3Dzzb1qCiHeqyRrvxww+8V+lFhSFDLFqarTNta1Uq8FG+MOjDwWU9 p4F70+uFzcZ6QLy1hqDK2HZ/6Xt56sS9W5FJdi6XfKGqKtXIz/eb6fN8mV6wVI6QqSVf qSOAKmaDudHGR6ELwwAoRe8M43g/+0HACHN9E2igXHTyyV+zB2Aabb14i3Rtapc/p4ZK pGy3x2zh1mmtO2grOw/y0WuS3heeXlz5F/Q2EeL90HK0VGpaH/t7AxoiH7kydAEzUDJ8 clxRthP8hk8oYGoJ6sRPfwdRX4+6q9mGlTmBFHbY5lpocMsHS/925WxyohRxydPYc9Ld KH7Q== 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=KbvhYruqWFmG9TroYS/uwzvZdIV50cIoi6dhyynxJ1o=; b=Jo5QVRF1GB+EHYm8PcBiyktp7dHb+VeNeALePp+hkj/XmiBO7SmoZsU31LMLfXRzDd GWLBYs7asP+oSup6Ta8wTcMXUWP+jwzFanV258eybb5rSUML4b3dbDPgsEASzQtH5vxr 9neTlkasPAQ1b5wYD0dqhQ8GRzXhXUVNMw99sPboKnrrfFszFJ/b6cXMe9IpArWzEdCg R4wWzuSdM7LxxEijGR6dcYCzIt+eNnaWjCrWiySTUZeJNh9xjeRnpRQCe+9JOI2Y9i6i VMwzAX4xviB3GmtoNlPnKfzZ8utVy33sKiIJrs88SmuGQf7vK7zU9ZYJ5zRwFz+CyFEc ZdWg== 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 m12-20020a056402510c00b0046844a19058si6606737edd.288.2022.12.07.22.03.10; Wed, 07 Dec 2022 22:03:31 -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 S229546AbiLHFzZ (ORCPT + 75 others); Thu, 8 Dec 2022 00:55:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229572AbiLHFzW (ORCPT ); Thu, 8 Dec 2022 00:55:22 -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 DEA9B99534 for ; Wed, 7 Dec 2022 21:55:21 -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 1p39sJ-0006mT-Dm; Thu, 08 Dec 2022 06:55:15 +0100 Received: from ore by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1p39sG-0001fG-Qo; Thu, 08 Dec 2022 06:55:12 +0100 Date: Thu, 8 Dec 2022 06:55:12 +0100 From: Oleksij Rempel To: Jakub Kicinski Cc: Woojung Huh , Andrew Lunn , Arun.Ramadoss@microchip.com, Florian Fainelli , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, UNGLinuxDriver@microchip.com, Eric Dumazet , Vladimir Oltean , kernel@pengutronix.de, Vivien Didelot , Paolo Abeni , "David S. Miller" Subject: Re: [PATCH net-next v1 1/1] net: dsa: microchip: add stats64 support for ksz8 series of switches Message-ID: <20221208055512.GE19179@pengutronix.de> References: <20221205052904.2834962-1-o.rempel@pengutronix.de> <20221206114133.291881a4@kernel.org> <20221207061630.GC19179@pengutronix.de> <20221207154826.5477008b@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20221207154826.5477008b@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 Wed, Dec 07, 2022 at 03:48:26PM -0800, Jakub Kicinski wrote: > On Wed, 7 Dec 2022 07:16:30 +0100 Oleksij Rempel wrote: > > > 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. > > I have embarrassed myself with my lack of understanding of pause frames > before but nonetheless - are you sure? I thought they are always 64B. > Quick look at the standard seems to agree: > > 31C.3.1 Receive state diagram (INITIATE MAC CONTROL FUNCTION) for > EXTENSION operation > > shows a 64 octet frame. > > Sending long pause frames seems self-defeating as we presumably want > the receiver to react ASAP. I tested it by sending correct and malformed pause frames manually with mausezahn. Since it is possible to send and receive pause frames manually, it is good to count all bytes in use, otherwise we may have bogus or malicious stealth traffic without possibility to measure it. 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 |