Received: by 10.213.65.68 with SMTP id h4csp859524imn; Wed, 14 Mar 2018 02:11:20 -0700 (PDT) X-Google-Smtp-Source: AG47ELuDM5Ie+AM/0pAYNMcQtca4u3Ni1Pzlz0gshyXJ6y4TDS0C63suUcIitMQy03SDMTxIk00h X-Received: by 2002:a17:902:122:: with SMTP id 31-v6mr3471397plb.280.1521018680029; Wed, 14 Mar 2018 02:11:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521018679; cv=none; d=google.com; s=arc-20160816; b=e1HR9UzqZC+dTvNYWMBBIlskslLLPJc9PpIcNvTlTn/tsLPx/39NHd+Q3ds5WqSBX1 Z2pc6+XytUpmGJdAEFCfQiHbfjpF3NDfwRP1K4BjIKmWn6Qd+/wWU0V8bBnBXkgKKlvc SD0jhrqpj2O6SsRDApThNiyl11QiuDDe9Z7Gh2GddxwENL8RvicWwGhiSqeWmP3zJpbU IOjyXt2A2IfYyHSs7DcwnwBtZWjuj7y904UMCNZpqb2/PGkvnhXf5l5RrEqBgIokHlNF YNp0ZMEpFkqltNNwkW12SwbhgCqY7N25/Tmh9jzOlQVqTbdCiPqYwdaTrvZPAY3VRytk /IAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=qZsBJoZCN0fily+rkJmXoipYBeu8FZbrwqSzwsQ8oCY=; b=uhRBb3WzDkCX7Cbo7Qixr5UaSpSTY9II63JHK04TX1/+H9mo2Ue1FTjnJ3jdFYcPNi GfIXX9nmQYhXz1leMtvltqBw/GQJOx+8F1EeNgfXxpAHll/knf2xOSDbXFgEVRiv+ua1 pYlVG6DTDNATClUh22R1IrCOFzkv6St0NE/pFYLF5dIVSZF50jKCFcdLxXROE7rbzZDw IxWfslZfhZV7jZE15uEME95bRxaIG6jqmO/p5o0u9bLCfLNRjYfBcHwXRDDU2Si4SChN Hefkt29i2cwRZyW/eMnoiS0siaCgPy7HYVaXb3LI12nhd6sc588Brul32beLrY/klEWv 478g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q10si1534481pgr.126.2018.03.14.02.11.05; Wed, 14 Mar 2018 02:11:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751523AbeCNJJ5 (ORCPT + 99 others); Wed, 14 Mar 2018 05:09:57 -0400 Received: from vegas.theobroma-systems.com ([144.76.126.164]:49499 "EHLO mail.theobroma-systems.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750855AbeCNJJ4 (ORCPT ); Wed, 14 Mar 2018 05:09:56 -0400 Received: from [86.59.122.178] (port=55790 helo=ju27.lan) by mail.theobroma-systems.com with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1ew2Px-00007R-Av; Wed, 14 Mar 2018 10:09:53 +0100 Subject: Re: [PATCH v2 1/1] can: ucan: add driver for Theobroma Systems UCAN devices To: Marc Kleine-Budde Cc: Martin Elshuber , Philipp Tomsich , Wolfgang Grandegger , linux-can@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180313173520.21257-1-jakob.unterwurzacher@theobroma-systems.com> <20180313173520.21257-2-jakob.unterwurzacher@theobroma-systems.com> From: Jakob Unterwurzacher Message-ID: <6c1b7482-2cde-40e3-eff4-e4b94794a63e@theobroma-systems.com> Date: Wed, 14 Mar 2018 10:09:52 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14.03.18 08:51, Marc Kleine-Budde wrote: >> + memcpy(cf->data, m->msg.can_msg.data, cf->can_dlc); >> + >> + /* don't count error frames as real packets */ >> + if (!(canid & CAN_ERR_FLAG)) { >> + stats->rx_packets++; >> + stats->rx_bytes += cf->can_dlc; >> + } > Please count them, too. We do count them, as errors! This is what happens when you transmit a single CAN frame with nothing connected: "TX errors" shoots up but "RX packets" stays zero. > root@rk3399-q7:~# ip -details -statistics link show can0 [...] > RX: bytes packets errors dropped overrun mcast > 0 0 0 0 0 0 > TX: bytes packets errors dropped carrier collsns > 0 0 20425 0 0 0