]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: hns3: fix data race in hns3_fetch_stats
authorDavid Yang <mmyangfl@gmail.com>
Mon, 19 Jan 2026 16:07:37 +0000 (00:07 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 21 Jan 2026 02:29:09 +0000 (18:29 -0800)
commit748a81c8ceda1fdbdcd0af595947422e810442aa
tree26f43228e93529baf523010e2df407a1fac8582e
parenta917cd0a23fae160a85b0e8a0dd1d548c5d5242e
net: hns3: fix data race in hns3_fetch_stats

In hns3_fetch_stats(), ring statistics, protected by u64_stats_sync, are
read and accumulated in ignorance of possible u64_stats_fetch_retry()
events. These statistics are already accumulated by
hns3_ring_stats_update(). Fix this by reading them into a temporary
buffer first.

Fixes: b20d7fe51e0d ("net: hns3: add some statitics info to tx process")
Signed-off-by: David Yang <mmyangfl@gmail.com>
Link: https://patch.msgid.link/20260119160759.1455950-1-mmyangfl@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c