# Re: \[PATCH 9/9\] u64\_stat: Remove the obsolete fetch\_irq() variants

- From: Jakub Kicinski \<kuba@kernel.org\>
- Date: 2022-08-22 18:06:00 
- List: netdev
- Page: https://ratatoskr.run/netdev/2022/08/1903172
- Thread: https://ratatoskr.run/netdev/2022/08/1897429/t.md

```text
On Mon, 22 Aug 2022 17:17:00 +0200 Sebastian Andrzej Siewior wrote:
> Using u64_stats_fetch_begin() is most likely wrong in networking because
> the stats are updated while packets are received which is either in IRQ
> or in BH (except maybe for the SPI/I2C ethernet driver). The _bh()
> version was replaced with _irq() for netpoll reasons.
> u64_stats_fetch_begin() does not disable any of those two (IRQ, BH) on
> 32bit-UP and does not use a seqcount so it is possible that an update
> happens during the read out of stats. Let me look…
> 	drivers/net/ethernet/cortina/gemini.c
> reads in net_device_ops::ndo_get_stats64(), updates in NAPI.
> 
> 	drivers/net/ethernet/huawei/hinic/hinic_rx.c
> reads in net_device_ops::ndo_get_stats64() and
> ethtool_ops::get_ethtool_stats(), updates in NAPI. Good.
> 
> So I guess these want be fixed properly instead of silently via the
> series?

Guess so, but it shouldn't be extra work if we're delaying the driver
conversion till 6.1?
```
