diff options
author | Eric Dumazet <edumazet@google.com> | 2022-06-08 18:46:32 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-06-10 07:53:09 +0300 |
commit | 09cca53c1656960c38c04bb12da30f61952ca660 (patch) | |
tree | a58ff2dad4ed05a59dce37b412ac38aaaa459d63 /include/linux/if_macvlan.h | |
parent | d62607c3fe45911b2331fac073355a8c914bbde2 (diff) | |
download | linux-09cca53c1656960c38c04bb12da30f61952ca660.tar.xz |
vlan: adopt u64_stats_t
As explained in commit 316580b69d0a ("u64_stats: provide u64_stats_t type")
we should use u64_stats_t and related accessors to avoid load/store tearing.
Add READ_ONCE() when reading rx_errors & tx_dropped.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux/if_macvlan.h')
-rw-r--r-- | include/linux/if_macvlan.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h index b42294739063..523025106a64 100644 --- a/include/linux/if_macvlan.h +++ b/include/linux/if_macvlan.h @@ -46,10 +46,10 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan, pcpu_stats = get_cpu_ptr(vlan->pcpu_stats); u64_stats_update_begin(&pcpu_stats->syncp); - pcpu_stats->rx_packets++; - pcpu_stats->rx_bytes += len; + u64_stats_inc(&pcpu_stats->rx_packets); + u64_stats_add(&pcpu_stats->rx_bytes, len); if (multicast) - pcpu_stats->rx_multicast++; + u64_stats_inc(&pcpu_stats->rx_multicast); u64_stats_update_end(&pcpu_stats->syncp); put_cpu_ptr(vlan->pcpu_stats); } else { |