• Alex Elder's avatar
    net: qualcomm: rmnet: don't over-count statistics · 994c393b
    Alex Elder authored
    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: 192c4b5d ("net: qualcomm: rmnet: Add support for 64 bit stats")
    Signed-off-by: default avatarAlex Elder <elder@linaro.org>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    994c393b
rmnet_vnd.c 8.52 KB