lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4c957d42-2b03-9416-75a4-e331f2ded8cf@pengutronix.de>
Date:   Wed, 14 Mar 2018 10:36:57 +0100
From:   Marc Kleine-Budde <mkl@...gutronix.de>
To:     Jakob Unterwurzacher <jakob.unterwurzacher@...obroma-systems.com>
Cc:     Martin Elshuber <martin.elshuber@...obroma-systems.com>,
        Philipp Tomsich <philipp.tomsich@...obroma-systems.com>,
        Wolfgang Grandegger <wg@...ndegger.com>,
        linux-can@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: rx_packets/bytes stats for error frames (was: Re: [PATCH v2 1/1] can:
 ucan: add driver for Theobroma Systems UCAN devices)

On 03/14/2018 10:09 AM, Jakob Unterwurzacher wrote:
> 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.

This is handled not consistent in the existing CAN drivers. In flexcan
all and c_can (all but rx overflow) are counted as rx_packets and
rx_bytes. (I haven't looked at the other drivers.)

I tend to count the error frames as ordinary frames.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |



Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ