mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
vlan: adopt u64_stats_t
As explained in commit 316580b69d
("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>
This commit is contained in:
committed by
Jakub Kicinski
parent
d62607c3fe
commit
09cca53c16
@@ -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 {
|
||||
|
Reference in New Issue
Block a user