lkml.org 
[lkml]   [2021]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v1 2/2] can: do not increase rx_bytes statistics for RTR frames
On Tue. 23 Nov. 2021 at 20:53, Vincent Mailhol
<mailhol.vincent@wanadoo.fr> wrote:
> The actual payload length of the CAN Remote Transmission Request (RTR)
> frames is always 0, i.e. nothing is transmitted on the wire. However,
> those RTR frames still uses the DLC to indicate the length of the
> requested frame.
>
> As such, net_device_stats:rx_bytes should not be increased for the RTR
> frames.
>
> This patch fixes all the CAN drivers.

Actually, I just realized that we also need to fix the tx path.

Since [1], can_get_echo_skb() returns the correct length (even
for RTR frames). So as long as the drivers use this function,
everything should be fine. But the fact is that the majority do
not (probably for historical reasons). Long story short, I will
send a v2 in which there will be an additional third patch to
address the tx_bytes statistics of the RTR frames in the tx
path.

[1] commit 59d24425c93d ("can: dev: replace can_priv::ctrlmode_static
by can_get_static_ctrlmode()")
https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git/commit/?h=testing&id=ed3320cec279407a86bc4c72edc4a39eb49165ec

Yours sincerely,
Vincent Mailhol

\
 
 \ /
  Last update: 2021-11-23 19:11    [W:0.142 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site