linux/drivers/net/netdevsim
Breno Leitao f9e2511d80 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: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Joe Damato <joe@dama.to>
Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20250618-netdevsim_stat-v4-1-19fe0d35e28e@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-06-19 16:15:34 -07:00
..
bpf.c netdevsim: 'support' multi-buf XDP 2025-03-12 13:39:59 -07:00
bus.c netdevsim: allow two netdevsim ports to be connected 2024-03-01 10:43:10 +00:00
dev.c netdevsim: use cond_resched() in nsim_dev_trap_report_work() 2024-10-15 09:58:43 -07:00
ethtool.c net: ethtool: try to protect all callback with netdev instance lock 2025-03-06 12:59:44 -08:00
fib.c netdevsim: Add trailing zero to terminate the string in nsim_nexthop_bucket_activity_write() 2024-10-29 11:43:01 -07:00
health.c netdevsim: prevent bad user input in nsim_dev_health_break_write() 2024-12-15 13:26:47 -08:00
hwstats.c netdevsim: don't embed file_operations into your structs 2025-01-15 13:14:36 +01:00
ipsec.c xfrm: Add explicit dev to .xdo_dev_state_{add,delete,free} 2025-04-16 11:01:41 +02:00
macsec.c netdevsim: macsec: pad u64 to correct length in logs 2024-10-23 09:51:06 +02:00
Makefile netdevsim: add dummy macsec offload 2023-07-14 09:16:53 +01:00
netdev.c netdevsim: migrate to dstats stats collection 2025-06-19 16:15:34 -07:00
netdevsim.h netdevsim: migrate to dstats stats collection 2025-06-19 16:15:34 -07:00
psample.c netdevsim: Only use sampling truncation length when valid 2021-04-22 13:23:56 -07:00
udp_tunnels.c netdevsim: remove udp_ports_sleep 2025-06-18 18:53:51 -07:00