Message ID | 20250618-netdevsim_stat-v4-3-19fe0d35e28e@debian.org |
---|---|
State | New |
Headers | show |
Series | [net-next,v4,1/4] netdevsim: migrate to dstats stats collection | expand |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 9cbc4e54b7e4a..03c26bb0fbbef 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -3016,6 +3016,16 @@ static inline void dev_dstats_rx_dropped(struct net_device *dev) u64_stats_update_end(&dstats->syncp); } +static inline void dev_dstats_rx_dropped_add(struct net_device *dev, + unsigned int packets) +{ + struct pcpu_dstats *dstats = this_cpu_ptr(dev->dstats); + + u64_stats_update_begin(&dstats->syncp); + u64_stats_add(&dstats->rx_drops, packets); + u64_stats_update_end(&dstats->syncp); +} + static inline void dev_dstats_tx_add(struct net_device *dev, unsigned int len) {