include/linux/mlx5/driver.h
Source file repositories/reference/linux-study-clean/include/linux/mlx5/driver.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/mlx5/driver.h- Extension
.h- Size
- 38093 bytes
- Lines
- 1399
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/kernel.hlinux/completion.hlinux/pci.hlinux/pci-tph.hlinux/irq.hlinux/spinlock_types.hlinux/semaphore.hlinux/slab.hlinux/vmalloc.hlinux/xarray.hlinux/workqueue.hlinux/mempool.hlinux/interrupt.hlinux/notifier.hlinux/refcount.hlinux/auxiliary_bus.hlinux/mutex.hlinux/mlx5/device.hlinux/mlx5/doorbell.hlinux/mlx5/eq.hlinux/timecounter.hnet/devlink.h
Detected Declarations
struct mlx5_field_descstruct mlx5_rsc_debugstruct mlx5_cmd_firststruct mlx5_cmd_msgstruct mlx5_cmd_debugstruct cmd_msg_cachestruct mlx5_cmd_statsstruct mlx5_cmdstruct mlx5_cmd_mailboxstruct mlx5_dma_pool_pagestruct mlx5_buf_liststruct mlx5_frag_bufstruct mlx5_frag_buf_ctrlstruct mlx5_core_psvstruct psv_layoutstruct mlx5_core_sig_ctxstruct mlx5_core_rsc_commonstruct mlx5_uars_pagestruct mlx5_bfreg_headstruct mlx5_bfreg_datastruct mlx5_sq_bfregstruct mlx5_core_healthstruct mlx5_vf_contextstruct mlx5_core_sriovstruct mlx5_eventsstruct mlx5_mpfsstruct mlx5_eswitchstruct mlx5_lagstruct mlx5_devcom_devstruct mlx5_fw_resetstruct mlx5_eq_tablestruct mlx5_irq_tablestruct mlx5_sf_dev_tablestruct mlx5_sf_hw_tablestruct mlx5_sf_tablestruct mlx5_crypto_dek_privstruct mlx5_rate_limitstruct mlx5_rl_entrystruct mlx5_rl_tablestruct mlx5_core_rocestruct mlx5_adevstruct mlx5_debugfs_entriesstruct mlx5_frag_buf_node_poolsstruct mlx5_ft_poolstruct mlx5_privstruct mlx5_tdstruct mlx5e_resourcesstruct mlx5e_hw_objs
Annotated Snippet
struct mlx5_field_desc {
int i;
};
struct mlx5_rsc_debug {
struct mlx5_core_dev *dev;
void *object;
enum dbg_rsc_type type;
struct dentry *root;
struct mlx5_field_desc fields[];
};
enum mlx5_dev_event {
MLX5_DEV_EVENT_SYS_ERROR = 128, /* 0 - 127 are FW events */
MLX5_DEV_EVENT_PORT_AFFINITY = 129,
MLX5_DEV_EVENT_MULTIPORT_ESW = 130,
};
enum mlx5_port_status {
MLX5_PORT_UP = 1,
MLX5_PORT_DOWN = 2,
};
enum mlx5_cmdif_state {
MLX5_CMDIF_STATE_UNINITIALIZED,
MLX5_CMDIF_STATE_UP,
MLX5_CMDIF_STATE_DOWN,
};
struct mlx5_cmd_first {
__be32 data[4];
};
struct mlx5_cmd_msg {
struct list_head list;
struct cmd_msg_cache *parent;
u32 len;
struct mlx5_cmd_first first;
struct mlx5_cmd_mailbox *next;
};
struct mlx5_cmd_debug {
struct dentry *dbg_root;
void *in_msg;
void *out_msg;
u8 status;
u16 inlen;
u16 outlen;
};
struct cmd_msg_cache {
/* protect block chain allocations
*/
spinlock_t lock;
struct list_head head;
unsigned int max_inbox_size;
unsigned int num_ent;
};
enum {
MLX5_NUM_COMMAND_CACHES = 5,
};
struct mlx5_cmd_stats {
u64 sum;
u64 n;
/* number of times command failed */
u64 failed;
/* number of times command failed on bad status returned by FW */
u64 failed_mbox_status;
/* last command failed returned errno */
u32 last_failed_errno;
/* last bad status returned by FW */
u8 last_failed_mbox_status;
/* last command failed syndrome returned by FW */
u32 last_failed_syndrome;
struct dentry *root;
/* protect command average calculations */
spinlock_t lock;
};
struct mlx5_cmd {
struct mlx5_nb nb;
/* members which needs to be queried or reinitialized each reload */
struct {
u16 cmdif_rev;
u8 log_sz;
u8 log_stride;
int max_reg_cmds;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/completion.h`, `linux/pci.h`, `linux/pci-tph.h`, `linux/irq.h`, `linux/spinlock_types.h`, `linux/semaphore.h`, `linux/slab.h`.
- Detected declarations: `struct mlx5_field_desc`, `struct mlx5_rsc_debug`, `struct mlx5_cmd_first`, `struct mlx5_cmd_msg`, `struct mlx5_cmd_debug`, `struct cmd_msg_cache`, `struct mlx5_cmd_stats`, `struct mlx5_cmd`, `struct mlx5_cmd_mailbox`, `struct mlx5_dma_pool_page`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.