Commit f9e2511d authored by Breno Leitao's avatar Breno Leitao Committed by Jakub Kicinski
Browse files

netdevsim: migrate to dstats stats collection



Replace custom statistics tracking with the kernel's dstats infrastructure
to simplify code and improve consistency with other network drivers.

This change:
- Sets dev->pcpu_stat_type = NETDEV_PCPU_STAT_DSTATS for automatic
  automatic allocation and deallocation.
- Removes manual stats fields and their update
- Replaces custom nsim_get_stats64() with dev_get_stats()
- Uses dev_dstats_tx_add() and dev_dstats_tx_dropped() helpers
- Eliminates the need for manual synchronization primitives

The dstats framework provides the same functionality with less code.

Suggested-by: default avatarJakub Kicinski <kuba@kernel.org>
Reviewed-by: default avatarJoe Damato <joe@dama.to>
Signed-off-by: default avatarBreno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20250618-netdevsim_stat-v4-1-19fe0d35e28e@debian.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent c3ee72de
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment