From patchwork Tue Nov 23 11:53:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Mailhol X-Patchwork-Id: 12693445 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 41D56C433EF for ; Tue, 23 Nov 2021 11:55:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=BIuW4XkqGQ6y1O9XQM3zoJfr8VQxw+u2LXe5gWc0dEg=; b=PgAsOF4lx5Rm26 tuBe1keMdkRJB5vjX05nTGGjArFxBFmVCholUM1z9WeMz1MyLTcraOn9ZjDxeHhgw9VI1OB2ldq/b PEKqAfbTNRUeuuXoIhsCJJc/CDNy8Ij9GrAd0QCsxeWbdL8oV3NZO5aM72Lau0uW8p6cefx0lRDgp oeyxAScddXrXk3CieSiXlxuecMi/ufGB8dQB2m6jAreUFI3Ov71aF57ZFij6LsOUCJH5Y4TWiiGZu S+vnQ9xHkHGUfoDmUnj4ck9RmnHEZgDwcJczqvnnQUcOvWerLNY5LoacHDkGbmgOQ0RIdQSWTed7J B+L2t5xNwLmNhoLLSnWw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpUN7-001xMK-9D; Tue, 23 Nov 2021 11:54:01 +0000 Received: from smtp07.smtpout.orange.fr ([80.12.242.129] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpUN2-001xI2-W8 for linux-arm-kernel@lists.infradead.org; Tue, 23 Nov 2021 11:53:58 +0000 Received: from tomoyo.flets-east.jp ([114.149.34.46]) by smtp.orange.fr with ESMTPA id pUMhmyepO2lVYpUMnmei4h; Tue, 23 Nov 2021 12:53:44 +0100 X-ME-Helo: tomoyo.flets-east.jp X-ME-Auth: MDU0YmViZGZmMDIzYiBlMiM2NTczNTRjNWZkZTMwOGRiOGQ4ODf3NWI1ZTMyMzdiODlhOQ== X-ME-Date: Tue, 23 Nov 2021 12:53:44 +0100 X-ME-IP: 114.149.34.46 From: Vincent Mailhol To: Marc Kleine-Budde , linux-can@vger.kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, Vincent Mailhol Subject: [PATCH v1 0/2] fix statistics for CAN RTR and Error frames Date: Tue, 23 Nov 2021 20:53:31 +0900 Message-Id: <20211123115333.624335-1-mailhol.vincent@wanadoo.fr> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211123_035357_235584_8773503A X-CRM114-Status: UNSURE ( 9.72 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org There are two common errors which are made when reporting the CAN RX statistics: 1. Incrementing the "normal" RX stats when receiving an Error frame. Error frames is an abstraction of Socket CAN and does not exist on the wire. 2. Counting the length of the Remote Transmission Frames (RTR). The length of an RTR frame is the length of the requested frame not the actual payload. In reality the payload of an RTR frame is always 0 bytes long. This patch series fix those two issues for all CAN drivers. Vincent Mailhol (2): can: do not increase rx statistics when receiving CAN error frames can: do not increase rx_bytes statistics for RTR frames drivers/net/can/at91_can.c | 9 ++------- drivers/net/can/c_can/c_can_main.c | 8 ++------ drivers/net/can/cc770/cc770.c | 6 ++---- drivers/net/can/dev/dev.c | 4 ---- drivers/net/can/dev/rx-offload.c | 7 +++++-- drivers/net/can/grcan.c | 3 ++- drivers/net/can/ifi_canfd/ifi_canfd.c | 8 ++------ drivers/net/can/janz-ican3.c | 3 ++- drivers/net/can/kvaser_pciefd.c | 8 ++------ drivers/net/can/m_can/m_can.c | 10 ++-------- drivers/net/can/mscan/mscan.c | 10 ++++++---- drivers/net/can/pch_can.c | 6 ++---- drivers/net/can/peak_canfd/peak_canfd.c | 7 ++----- drivers/net/can/rcar/rcar_can.c | 9 +++------ drivers/net/can/rcar/rcar_canfd.c | 7 ++----- drivers/net/can/sja1000/sja1000.c | 5 ++--- drivers/net/can/slcan.c | 3 ++- drivers/net/can/spi/hi311x.c | 3 ++- drivers/net/can/spi/mcp251x.c | 3 ++- drivers/net/can/sun4i_can.c | 10 ++++------ drivers/net/can/usb/ems_usb.c | 5 ++--- drivers/net/can/usb/esd_usb2.c | 5 ++--- drivers/net/can/usb/etas_es58x/es58x_core.c | 7 ------- .../net/can/usb/kvaser_usb/kvaser_usb_core.c | 2 -- .../net/can/usb/kvaser_usb/kvaser_usb_hydra.c | 14 ++++---------- .../net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 7 ++----- drivers/net/can/usb/mcba_usb.c | 3 ++- drivers/net/can/usb/peak_usb/pcan_usb.c | 5 ++--- drivers/net/can/usb/peak_usb/pcan_usb_fd.c | 11 ++++------- drivers/net/can/usb/peak_usb/pcan_usb_pro.c | 11 +++++------ drivers/net/can/usb/ucan.c | 7 +++++-- drivers/net/can/usb/usb_8dev.c | 10 ++++------ drivers/net/can/xilinx_can.c | 17 ++++++----------- 33 files changed, 86 insertions(+), 147 deletions(-)