drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h- Extension
.h- Size
- 23968 bytes
- Lines
- 845
- 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
linux/bitops.hlinux/compiler.hlinux/ethtool.hlinux/list.hlinux/mutex.hlinux/netdevice.hlinux/if_vlan.hlinux/net_tstamp.hlinux/dcbnl.hlinux/cpu_rmap.hlinux/ptp_clock_kernel.hlinux/irq.hnet/xdp.hlinux/notifier.hlinux/mlx4/device.hlinux/mlx4/qp.hlinux/mlx4/cq.hlinux/mlx4/srq.hlinux/mlx4/doorbell.hlinux/mlx4/cmd.hen_port.hmlx4_stats.h
Detected Declarations
struct mlx4_en_tx_infostruct mlx4_en_tx_descstruct mlx4_en_rx_allocstruct mlx4_en_privstruct mlx4_en_tx_ringstruct mlx4_en_rx_descstruct mlx4_en_rx_ringstruct mlx4_en_cqstruct mlx4_en_port_profilestruct mlx4_en_profilestruct mlx4_en_devstruct mlx4_en_rss_mapstruct mlx4_en_port_statestruct mlx4_en_mc_liststruct mlx4_en_frag_infostruct mlx4_en_cee_configstruct ethtool_flow_idstruct mlx4_en_stats_bitmapstruct mlx4_en_privstruct mlx4_mac_entrystruct xdp_mdenum cq_typeenum mlx4_en_port_flagenum mlx4_en_mclist_actenum dcb_pfc_typeenum mlx4_en_wol
Annotated Snippet
struct mlx4_en_tx_info {
union {
struct sk_buff *skb;
struct page *page;
};
dma_addr_t map0_dma;
u32 map0_byte_count;
u32 nr_txbb;
u32 nr_bytes;
u8 linear;
u8 data_offset;
u8 inl;
u8 ts_requested;
u8 nr_maps;
} ____cacheline_aligned_in_smp;
#define MLX4_EN_BIT_DESC_OWN 0x80000000
#define MLX4_EN_MEMTYPE_PAD 0x100
struct mlx4_en_tx_desc {
struct mlx4_wqe_ctrl_seg ctrl;
union {
struct mlx4_wqe_data_seg data; /* at least one data segment */
struct mlx4_wqe_lso_seg lso;
struct mlx4_wqe_inline_seg inl;
};
};
#define MLX4_EN_USE_SRQ 0x01000000
#define MLX4_EN_CX3_LOW_ID 0x1000
#define MLX4_EN_CX3_HIGH_ID 0x1005
struct mlx4_en_rx_alloc {
struct page *page;
u32 page_offset;
};
#define MLX4_EN_CACHE_SIZE (2 * NAPI_POLL_WEIGHT)
enum {
MLX4_EN_TX_RING_STATE_RECOVERING,
};
struct mlx4_en_priv;
struct mlx4_en_tx_ring {
/* cache line used and dirtied in tx completion
* (mlx4_en_free_tx_buf())
*/
u32 last_nr_txbb;
u32 cons;
unsigned long wake_queue;
struct netdev_queue *tx_queue;
u32 (*free_tx_desc)(struct mlx4_en_priv *priv,
struct mlx4_en_tx_ring *ring,
int index,
u64 timestamp, int napi_mode);
struct mlx4_en_rx_ring *recycle_ring;
/* cache line used and dirtied in mlx4_en_xmit() */
u32 prod ____cacheline_aligned_in_smp;
unsigned int tx_dropped;
unsigned long bytes;
unsigned long packets;
unsigned long tx_csum;
unsigned long tso_packets;
unsigned long xmit_more;
struct mlx4_bf bf;
/* Following part should be mostly read */
void __iomem *doorbell_address;
__be32 doorbell_qpn;
__be32 mr_key;
u32 size; /* number of TXBBs */
u32 size_mask;
u32 full_size;
u32 buf_size;
void *buf;
struct mlx4_en_tx_info *tx_info;
int qpn;
u8 queue_index;
bool bf_enabled;
bool bf_alloced;
u8 hwtstamp_tx_type;
u8 *bounce_buf;
/* Not used in fast path
Annotation
- Immediate include surface: `linux/bitops.h`, `linux/compiler.h`, `linux/ethtool.h`, `linux/list.h`, `linux/mutex.h`, `linux/netdevice.h`, `linux/if_vlan.h`, `linux/net_tstamp.h`.
- Detected declarations: `struct mlx4_en_tx_info`, `struct mlx4_en_tx_desc`, `struct mlx4_en_rx_alloc`, `struct mlx4_en_priv`, `struct mlx4_en_tx_ring`, `struct mlx4_en_rx_desc`, `struct mlx4_en_rx_ring`, `struct mlx4_en_cq`, `struct mlx4_en_port_profile`, `struct mlx4_en_profile`.
- 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.