]> git.baikalelectronics.ru Git - kernel.git/commit
can: kvaser_usb: do not increase tx statistics when sending error message frames
authorVincent Mailhol <mailhol.vincent@wanadoo.fr>
Tue, 7 Dec 2021 12:15:28 +0000 (21:15 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:40:59 +0000 (11:40 +0100)
commit217bd57dc9bb15a2727dcfa8f3726fd6425e65dc
tree5ec70e4d93ab68446602ed707f04b6384db143b5
parent1e165e974e245fa93c3ac6b23e11bc8a4a4b57cf
can: kvaser_usb: do not increase tx statistics when sending error message frames

[ Upstream commit 6bc96c547ba5537ac6590bbf00478a4d78a50fd6 ]

The CAN error message frames (i.e. error skb) are an interface
specific to socket CAN. The payload of the CAN error message frames
does not correspond to any actual data sent on the wire. Only an error
flag and a delimiter are transmitted when an error occurs (c.f. ISO
11898-1 section 10.4.4.2 "Error flag").

For this reason, it makes no sense to increment the tx_packets and
tx_bytes fields of struct net_device_stats when sending an error
message frame because no actual payload will be transmitted on the
wire.

N.B. Sending error message frames is a very specific feature which, at
the moment, is only supported by the Kvaser Hydra hardware. Please
refer to [1] for more details on the topic.

[1] https://lore.kernel.org/linux-can/CAMZ6RqK0rTNg3u3mBpZOoY51jLZ-et-J01tY6-+mWsM4meVw-A@mail.gmail.com/t/#u

Link: https://lore.kernel.org/all/20211207121531.42941-3-mailhol.vincent@wanadoo.fr
Co-developed-by: Jimmy Assarsson <extja@kvaser.com>
Signed-off-by: Jimmy Assarsson <extja@kvaser.com>
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Stable-dep-of: 5ff3a457d5c8 ("can: kvaser_usb: kvaser_usb_leaf: Get capabilities from device")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c