drivers/net/ovpn/stats.h
Source file repositories/reference/linux-study-clean/drivers/net/ovpn/stats.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ovpn/stats.h- Extension
.h- Size
- 1409 bytes
- Lines
- 64
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/netdevice.h
Detected Declarations
struct ovpn_peer_statstruct ovpn_peer_statsfunction ovpn_peer_stats_incrementfunction ovpn_peer_stats_increment_rxfunction ovpn_peer_stats_increment_txfunction ovpn_dev_dstats_tx_droppedfunction ovpn_dev_dstats_rx_dropped
Annotated Snippet
struct ovpn_peer_stat {
atomic64_t bytes;
atomic64_t packets;
};
/* rx and tx stats combined */
struct ovpn_peer_stats {
struct ovpn_peer_stat rx;
struct ovpn_peer_stat tx;
};
void ovpn_peer_stats_init(struct ovpn_peer_stats *ps);
static inline void ovpn_peer_stats_increment(struct ovpn_peer_stat *stat,
const unsigned int n)
{
atomic64_add(n, &stat->bytes);
atomic64_inc(&stat->packets);
}
static inline void ovpn_peer_stats_increment_rx(struct ovpn_peer_stats *stats,
const unsigned int n)
{
ovpn_peer_stats_increment(&stats->rx, n);
}
static inline void ovpn_peer_stats_increment_tx(struct ovpn_peer_stats *stats,
const unsigned int n)
{
ovpn_peer_stats_increment(&stats->tx, n);
}
static inline void ovpn_dev_dstats_tx_dropped(struct net_device *dev)
{
local_bh_disable();
dev_dstats_tx_dropped(dev);
local_bh_enable();
}
static inline void ovpn_dev_dstats_rx_dropped(struct net_device *dev)
{
local_bh_disable();
dev_dstats_rx_dropped(dev);
local_bh_enable();
}
#endif /* _NET_OVPN_OVPNSTATS_H_ */
Annotation
- Immediate include surface: `linux/netdevice.h`.
- Detected declarations: `struct ovpn_peer_stat`, `struct ovpn_peer_stats`, `function ovpn_peer_stats_increment`, `function ovpn_peer_stats_increment_rx`, `function ovpn_peer_stats_increment_tx`, `function ovpn_dev_dstats_tx_dropped`, `function ovpn_dev_dstats_rx_dropped`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.