If a network device doesn't update its statistics with enough frequency the displayed value keep jumping between 0 and a value that in my case is double the correct one. I did some testing and the bug happens because in this line: https://invent.kde.org/plasma/ksystemstats/-/blob/master/plugins/network/NetworkManagerBackend.cpp#L85 both newDownload and previousDownload are the same. This is happening with an Aquantia AQC107 network card which seems to update its /sys/class/net/enp7s0/statistics every second and not faster, i tried to find a way to make it update faster but i haven't found anything on how to do that.
Same problem using BCM5720 on Supermicro H12SSL-I motherboard
I should have mentioned my system is Debain 12 (bookworm) and my kernel is 6.1.0-21-amd64, I've recently upgraded my processor/motherboard and didn't have this fault prior to the change, so this fault seems to be specific to the network interface. The output of sudo ethtool -i eno1 is: driver: tg3 version: 6.1.0-21-amd64 firmware-version: 5720-v1.39 NCSI v1.5.12.0 expansion-rom-version: bus-info: 0000:45:00.0 supports-statistics: yes supports-test: yes supports-eeprom-access: yes supports-register-dump: yes supports-priv-flags: no
The driver for my previous network interface appears to continuously updates the rtnl_link_stats64 statistics (igb_main.c), the driver for my current network card updates once per second (tg3.c), line 11094 calls the function to update the statistics and is only executed once per second. If the system monitor read the statistics at exactly one second intervals and tg3.c updated the statistics at exactly one second intervals this error wouldn't occur, however for some reason the timings appear to be alternate between less than and more than one second for one of the time intervals causing this error. I don't know if this would be classed as a bug in the tg3 driver or if updating once per second is acceptable and should be worked around by whatever software is using the data.
After looking at the systemmonitor code - the software looks at the network data every 500mS, so if there was an option to change the interval to 1000mS then this would fix the problem in situations where the network driver is only updating rtnl_link_stats64 once per second.