Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

can: dummy_can: dummy_can_init(): fix packet statistics

The former implementation was only counting the tx_packets value but not
the tx_bytes as the skb was dropped on driver layer.

Enable CAN echo support (IFF_ECHO) in dummy_can_init(), which activates the
code for setting and retrieving the echo SKB and counts the tx_bytes
correctly.

Fixes: 816cf430e84b ("can: add dummy_can driver")
Cc: Vincent Mailhol <mailhol@kernel.org>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Reviewed-by: Vincent Mailhol <mailhol@kernel.org>
Link: https://patch.msgid.link/20260126104540.21024-1-socketcan@hartkopp.net
[mkl: make commit message imperative]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

authored by

Oliver Hartkopp and committed by
Marc Kleine-Budde
c77bfbdd c35636e9

+1
+1
drivers/net/can/dummy_can.c
··· 241 241 242 242 dev->netdev_ops = &dummy_can_netdev_ops; 243 243 dev->ethtool_ops = &dummy_can_ethtool_ops; 244 + dev->flags |= IFF_ECHO; /* enable echo handling */ 244 245 priv = netdev_priv(dev); 245 246 priv->can.bittiming_const = &dummy_can_bittiming_const; 246 247 priv->can.bitrate_max = 20 * MEGA /* BPS */;