Re: [PATCH net-next v2 5/6] net: dsa: motorcomm: Fix MIB synchronization

From: Andrew Lunn

Date: Mon Sep 07 2026 - 16:21:58 EST


On Sat, Sep 05, 2026 at 12:29:47AM +0800, David Yang wrote:
> The previous MIB sync was based on the false assumption that 64-bit
> variables are always atomic. To fix that:
>
> * .get_stats64() uses u64_stats_sync, together with u64_stats_t;
> * others take the free mutex lock if possible.
>
> To minimize time of the write side of u64_stats_sync, a per-port buffer
> is used so that all the stat can be written back altogether after IO
> operations.
>
> Signed-off-by: David Yang <mmyangfl@xxxxxxxxx>

Reviewed-by: Andrew Lunn <andrew@xxxxxxx>

Andrew