From: sashiko-bot@kernel.org
To: "T S Rameshkumar" <rameshsv06@gmail.com>
Cc: linux-can@vger.kernel.org,
"Marc Kleine-Budde" <mkl@pengutronix.de>,
"Oliver Hartkopp" <socketcan@hartkopp.net>,
"Vincent Mailhol" <mailhol@kernel.org>,
"Oleksij Rempel" <o.rempel@pengutronix.de>
Subject: Re: [PATCH 1/2] can: vcan: use per-CPU stats to fix KCSAN data-race in vcan_tx
Date: Thu, 03 Dec 2026 11:23:30 +0000 [thread overview]
Message-ID: <sashiko-outbox-247668@kernel.org> (raw)
In-Reply-To: <20261203111103.379929-1-rameshsv06@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] can: vcan: redundant ndo_get_stats64 callback with
NETDEV_PCPU_STAT_TSTATS
--
commit 3a0edae3f5983fb3bb0c7e6ae9f7865bc39dc626
Author: T S Rameshkumar <rameshkumar.t@phytecembedded.in>
can: vcan: use per-CPU stats to fix KCSAN data-race in vcan_tx
This commit converts vcan to use per-CPU statistics via
NETDEV_PCPU_STAT_TSTATS and dev_sw_netstats_{rx,tx}_add() instead of plain
accesses to dev->stats.
> diff --git a/drivers/net/can/vcan.c b/drivers/net/can/vcan.c
> index 76e6b7b5c6a11..15ebd814fe75f 100644
> --- a/drivers/net/can/vcan.c
> +++ b/drivers/net/can/vcan.c
[ ... ]
> @@ -161,6 +155,7 @@ static int vcan_change_mtu(struct net_device *dev, int new_mtu)
> static const struct net_device_ops vcan_netdev_ops = {
> .ndo_start_xmit = vcan_tx,
> .ndo_change_mtu = vcan_change_mtu,
> + .ndo_get_stats64 = dev_get_tstats64,
> };
[Severity: Low]
Can .ndo_get_stats64 = dev_get_tstats64 be omitted here?
Since commit 3e2f544dd8a3 ("net: get stats64 if device if driver is
configured"), dev_get_stats() already calls dev_get_tstats64() directly when
dev->pcpu_stat_type is NETDEV_PCPU_STAT_TSTATS (as set in vcan_setup()) and
ndo_get_stats64 is unset.
Setting .ndo_get_stats64 explicitly takes the ops->ndo_get_stats64 branch in
dev_get_stats() instead, adding an unnecessary memset() and indirect call on
every stats read before dev_get_tstats64() overwrites storage via
netdev_stats_to_stats64().
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261203111103.379929-1-rameshsv06@gmail.com?part=1
next prev parent reply other threads:[~2026-12-03 11:23 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 11:11 [PATCH 1/2] can: vcan: use per-CPU stats to fix KCSAN data-race in vcan_tx T S Rameshkumar
2026-12-03 11:11 ` [PATCH 2/2] selftests: net: can: add vcan concurrent tx/stats test T S Rameshkumar
2026-12-03 11:23 ` sashiko-bot
2026-12-05 0:14 ` netdev-bot+sashiko
2026-12-03 11:23 ` sashiko-bot [this message]
2026-12-03 12:05 ` [PATCH v2 1/2] can: vcan: use per-CPU stats to fix KCSAN data-race in vcan_tx T S Rameshkumar
2026-12-03 12:05 ` [PATCH v2 2/2] selftests: net: can: add vcan concurrent tx/stats test T S Rameshkumar
2026-12-03 12:37 ` sashiko-bot
2026-12-03 12:50 ` Oliver Hartkopp
2026-12-05 0:41 ` netdev-bot+sashiko
2026-12-05 0:41 ` [PATCH v2 1/2] can: vcan: use per-CPU stats to fix KCSAN data-race in vcan_tx netdev-bot+sashiko
2026-12-05 0:14 ` [PATCH " netdev-bot+sashiko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-247668@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-can@vger.kernel.org \
--cc=mailhol@kernel.org \
--cc=mkl@pengutronix.de \
--cc=o.rempel@pengutronix.de \
--cc=rameshsv06@gmail.com \
--cc=sashiko-reviews@lists.linux.dev \
--cc=socketcan@hartkopp.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.