linux/drivers/net/ethernet/qualcomm/rmnet
Alex Elder 994c393bb6 net: qualcomm: rmnet: don't over-count statistics
The purpose of the loop using u64_stats_fetch_*_irq() is to ensure
statistics on a given CPU are collected atomically. If one of the
statistics values gets updated within the begin/retry window, the
loop will run again.

Currently the statistics totals are updated inside that window.
This means that if the loop ever retries, the statistics for the
CPU will be counted more than once.

Fix this by taking a snapshot of a CPU's statistics inside the
protected window, and then updating the counters with the snapshot
values after exiting the loop.

(Also add a newline at the end of this file...)

Fixes: 192c4b5d48 ("net: qualcomm: rmnet: Add support for 64 bit stats")
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-06-14 12:13:38 -07:00
..
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
rmnet_config.c net: qualcomm: rmnet: Update rmnet device MTU based on real device 2020-12-10 13:30:26 -08:00
rmnet_config.h net: qualcomm: rmnet: Update rmnet device MTU based on real device 2020-12-10 13:30:26 -08:00
rmnet_handlers.c net: qualcomm: rmnet: use masks instead of C bit-fields 2021-03-15 20:41:58 -07:00
rmnet_handlers.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 284 2019-06-05 17:36:37 +02:00
rmnet_map_command.c net: qualcomm: rmnet: kill RMNET_MAP_GET_*() accessor macros 2021-03-15 20:41:58 -07:00
rmnet_map_data.c net: qualcomm: rmnet: don't use C bit-fields in rmnet checksum header 2021-03-15 20:41:58 -07:00
rmnet_map.h net: qualcomm: rmnet: kill RMNET_MAP_GET_*() accessor macros 2021-03-15 20:41:58 -07:00
rmnet_private.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 284 2019-06-05 17:36:37 +02:00
rmnet_vnd.c net: qualcomm: rmnet: don't over-count statistics 2021-06-14 12:13:38 -07:00
rmnet_vnd.h net: qualcomm: rmnet: Update rmnet device MTU based on real device 2020-12-10 13:30:26 -08:00