lkml.org 
[lkml]   [2018]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: rx_packets/bytes stats for error frames
From
Date


Am 14.03.2018 um 10:36 schrieb Marc Kleine-Budde:
> 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.

+1, I think we should count the packets and bytes delivered to the
network layer.

Wolfgang.

\
 
 \ /
  Last update: 2018-03-14 10:46    [W:0.101 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site