linux/drivers/net/netdevsim
Breno Leitao 2a68a22304 netdevsim: account dropped packet length in stats on queue free
Add a call to dev_dstats_rx_dropped_add() in nsim_queue_free() to
account for the number of packets dropped when purging the skb queue.
This improves the accuracy of RX drop statistics reported by netdevsim.

local_bh_{disable, enable}() protection is used to disable preemption,
which is necessary given that dev_dstats_rx_dropped_add() access
this_cpu_ptr(). See discussion in [1].

Link: https://lore.kernel.org/all/20250617055934.3fd9d322@kernel.org/ [1]
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20250618-netdevsim_stat-v4-4-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: account dropped packet length in stats on queue free 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