Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1995500lqe; Tue, 9 Apr 2024 06:57:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUnhIhC62fvcmvB49a6CZ75Xqu5xx0ibseESTWvauYItO/QXjIe7MIrw2PVAmGfT0Q78xJE1YRoL75DWMYxcZ5UVhTyyeRTUt/4gv0uJA== X-Google-Smtp-Source: AGHT+IEmInfDOMNGRczqeUA+9IyPW0zB+b97S9e2YzUv1WjMmrNP4veAL29pbsDhGX2NoN18VAy/ X-Received: by 2002:a17:902:d301:b0:1e0:4dfd:c121 with SMTP id b1-20020a170902d30100b001e04dfdc121mr9260474plc.68.1712671057348; Tue, 09 Apr 2024 06:57:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712671057; cv=pass; d=google.com; s=arc-20160816; b=DzSvgNSZYZeUKN2c90Ey3cIuB1Y6QN1AuJeeyH0IqAnKtYsj/19LblMiu490ySz6bS Xj3A8frkMYVDoTvz2PiAjo2PSTqN1JvTKM1JWNNOpk/ZzKQTcH2znQshNe3xRuIPOMNb 27MJZgy/EGww33UbqB1yzOk+ZQ64T0aU75eHw/ok9zyTNuZD3riflPbQF7kK9mGGyCr6 nxhDXE5T7AW9yQd91eA2KSB5SGP5HuJIjjijyAt0PRKYcWi8wXqPEXQqcQ8TDGrg5iyy Cc7eqNOCFxU0tWsMCcMDO5oLsyBma8CWJyYRp/CkBCsQMRNO8GJ287ZZa+12KtS9Pbr5 1IZQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=p1CUVy6yIPP76gfr9Is3STkIlE+svMskZbDhRLVsQV4=; fh=GSuogwRiGZOzZ8XvAAgMvMSj1pyXzbyvEfCwSre3H2M=; b=SBNywihOzoAEOO2rCqPNbeYM4kxWZccGLhZawpv4utuKovz3VN58hOe4Psb/KnEZWO MCCzIzOU7FqaaK/2UM8bpoNBKc7ZeDi8qLapDoh1lWvLZEOCD7qz9JhN80KBtchr9K14 q4JNWhLTZFRIVqJF8DcHNptfkWVpHFwtLSXFDI059Btm4Efq/lsqwKqNjoj+9Jx2ICzL BdqrfF06SOH0dOXRSr+kkw0qoyG0oV0zqynwgsBJzZ7IFhYFe1xVmvYAHHZoGttKZgWP +bPVwM4QSVgCNORm2K+y7fhCK5eEnFmW2BDwEzPVjqmgv0kuilcV6XswuVc5Zs54gYmA t/QA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eflFdtuC; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-137020-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137020-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id m1-20020a170902db0100b001e36b7a9707si8606839plx.448.2024.04.09.06.57.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 06:57:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-137020-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eflFdtuC; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-137020-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137020-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9F5DD287EAA for ; Tue, 9 Apr 2024 13:53:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 72FD71304A3; Tue, 9 Apr 2024 13:46:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="eflFdtuC" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E67212C531; Tue, 9 Apr 2024 13:46:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712670393; cv=none; b=IuDXuTFuFaeD/bz/nk23VLlTGN8TYAMta292vnRH+e63qM19c0ZBFMacjjT0VcZueWQfqlGoVyW0kif/g8XEJ6sqvLxQ0Wg6s29B1XgAgN2vEONBzjn3zS8HmbsI6FUU06RGRL99dPR/XJw/bR0kKcYCfaWgvZ5GZDO0DI4Wnk8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712670393; c=relaxed/simple; bh=zDbyBb/9hhPVBbG3X7C1YdT4HO4jlTdu1qvdQ+VHvJE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bBfQezPsBLgp3LiXrM9rfqYTPrqM9zr+GhR5XcisQ56vX9I8CnG/fMBqluiYmJyFjzcZ1thE8xa7o9bzoqwSwhOjQMkXovcCpWVPv/k8Xt45OxAllCXHmy3iQPdalqaAfXqP4Z+Ze5+0nATJydmu2ESjTujElCStSumh5wE1ltk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=eflFdtuC; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF194C433C7; Tue, 9 Apr 2024 13:46:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1712670393; bh=zDbyBb/9hhPVBbG3X7C1YdT4HO4jlTdu1qvdQ+VHvJE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eflFdtuCE7meJNtJ0Hp2+gGmaAnDIiIBQS7CUgKkcvnDVwoxUWPdC7Nku33lL47Rw OyqoX1knSwghzlxHbL9UGhzngUjdFVkI3M0ZWK8ae8BnOir9NLz88MADXEczliGDrP sjLZM0S9BvPXV+eXIdtqLbO5a7RPrnTho2LNLK7c= Date: Tue, 9 Apr 2024 15:46:30 +0200 From: Greg Kroah-Hartman To: Andy Shevchenko Cc: Jiri Slaby , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Orson Zhai , Baolin Wang , Chunyan Zhang Subject: Re: [PATCH v1 0/3] serial: Do not count XON/XOFF in the statistics Message-ID: <2024040926-whinny-coil-4c15@gregkh> References: <20240403144722.860258-1-andriy.shevchenko@linux.intel.com> <573aac92-9c9b-427b-a76f-3c0b7c3b6ce6@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Apr 04, 2024 at 06:54:38PM +0300, Andy Shevchenko wrote: > On Thu, Apr 04, 2024 at 07:16:55AM +0200, Jiri Slaby wrote: > > On 04. 04. 24, 0:15, Andy Shevchenko wrote: > > > Wed, Apr 03, 2024 at 05:46:14PM +0300, Andy Shevchenko kirjoitti: > > > > Some drivers count XON/XOFF in the Tx statistics, some do not. > > > > I actually a bit uncertain, but I _think_ the correct way is not > > > > to count them, hence this series. > > > > > > Okay, it seems there are much more drivers doing that. Perhaps we need > > > to add that to the rest in this case (i.o.w. invert the series from removal > > > to addition)? > > > > Interesting, perhaps cut & paste? > > > > XON and XOFF are overhead IMO. So should not be counted. When they are, they > > mangle statistics as in transmitted (real) bytes per second. > > > > How are they handled on the RX side? > > It took me a while. > > All serial drivers accept everything and those that care, update statics for > anything they receive. This is because of layering. The Rx XON/XOFF seems > (note I am completely unfamiliar with mysterious ways of TTY layers) to be > handled on TTY level by n_tty_receive_char_flow_ctrl(), i.o.w. we may not > skip counting it easily. > > Now the question is, shall we count the control characters on output or not? > Whatever decision we made, we should document (if not yet) and align drivers > accordingly. > > Another Q is what do books / other OS / projects usually do with them > WRT statistics? It depends on where you are measuring stuff. If you want "raw" bytes on the wire, you count them. If you want to see what the port sends based on what userspace sent/recieved, you don't. > If we count everything on a wire, then we must count them, otherwise > it depends on how we treat them. Agreed. We need to pick one and stick with it. I think, at the driver level, we should count it, as it's a ldisc thing, not a driver thing, right? thanks, greg k-h