drivers/net/ethernet/mellanox/mlx4/mlx4_stats.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx4/mlx4_stats.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlx4/mlx4_stats.h- Extension
.h- Size
- 3486 bytes
- Lines
- 131
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
struct mlx4_en_pkt_statsstruct mlx4_en_counter_statsstruct mlx4_en_port_statsstruct mlx4_en_xdp_statsstruct mlx4_en_phy_statsstruct mlx4_en_flow_stats_rxstruct mlx4_en_flow_stats_txstruct mlx4_en_stat_out_flow_control_mbox
Annotated Snippet
struct mlx4_en_pkt_stats {
unsigned long rx_multicast_packets;
unsigned long rx_broadcast_packets;
unsigned long rx_jabbers;
unsigned long rx_in_range_length_error;
unsigned long rx_out_range_length_error;
unsigned long tx_multicast_packets;
unsigned long tx_broadcast_packets;
unsigned long rx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS];
unsigned long tx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS];
#define NUM_PKT_STATS 43
};
struct mlx4_en_counter_stats {
unsigned long rx_packets;
unsigned long rx_bytes;
unsigned long tx_packets;
unsigned long tx_bytes;
#define NUM_PF_STATS 4
};
struct mlx4_en_port_stats {
unsigned long tso_packets;
unsigned long xmit_more;
unsigned long queue_stopped;
unsigned long wake_queue;
unsigned long tx_timeout;
unsigned long rx_alloc_pages;
unsigned long rx_chksum_good;
unsigned long rx_chksum_none;
unsigned long rx_chksum_complete;
unsigned long tx_chksum_offload;
#define NUM_PORT_STATS 10
};
struct mlx4_en_xdp_stats {
unsigned long rx_xdp_drop;
unsigned long rx_xdp_redirect;
unsigned long rx_xdp_redirect_fail;
unsigned long rx_xdp_tx;
unsigned long rx_xdp_tx_full;
#define NUM_XDP_STATS 5
};
struct mlx4_en_phy_stats {
unsigned long rx_packets_phy;
unsigned long rx_bytes_phy;
unsigned long tx_packets_phy;
unsigned long tx_bytes_phy;
#define NUM_PHY_STATS 4
};
#define NUM_MAIN_STATS 21
#define MLX4_NUM_PRIORITIES 8
struct mlx4_en_flow_stats_rx {
u64 rx_pause;
u64 rx_pause_duration;
u64 rx_pause_transition;
#define NUM_FLOW_STATS_RX 3
#define NUM_FLOW_PRIORITY_STATS_RX (NUM_FLOW_STATS_RX * \
MLX4_NUM_PRIORITIES)
};
#define FLOW_PRIORITY_STATS_IDX_RX_FRAMES (NUM_MAIN_STATS + \
NUM_PORT_STATS + \
NUM_PF_STATS + \
NUM_FLOW_PRIORITY_STATS_RX)
struct mlx4_en_flow_stats_tx {
u64 tx_pause;
u64 tx_pause_duration;
u64 tx_pause_transition;
#define NUM_FLOW_STATS_TX 3
#define NUM_FLOW_PRIORITY_STATS_TX (NUM_FLOW_STATS_TX * \
MLX4_NUM_PRIORITIES)
};
#define FLOW_PRIORITY_STATS_IDX_TX_FRAMES (NUM_MAIN_STATS + \
NUM_PORT_STATS + \
NUM_PF_STATS + \
NUM_FLOW_PRIORITY_STATS_RX + \
NUM_FLOW_STATS_RX + \
NUM_FLOW_PRIORITY_STATS_TX)
#define NUM_FLOW_STATS (NUM_FLOW_STATS_RX + NUM_FLOW_STATS_TX + \
NUM_FLOW_PRIORITY_STATS_TX + \
NUM_FLOW_PRIORITY_STATS_RX)
Annotation
- Detected declarations: `struct mlx4_en_pkt_stats`, `struct mlx4_en_counter_stats`, `struct mlx4_en_port_stats`, `struct mlx4_en_xdp_stats`, `struct mlx4_en_phy_stats`, `struct mlx4_en_flow_stats_rx`, `struct mlx4_en_flow_stats_tx`, `struct mlx4_en_stat_out_flow_control_mbox`.
- 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.