drivers/vfio/pci/mlx5/cmd.h
Source file repositories/reference/linux-study-clean/drivers/vfio/pci/mlx5/cmd.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/vfio/pci/mlx5/cmd.h- Extension
.h- Size
- 7183 bytes
- Lines
- 252
- Domain
- Driver Families
- Bucket
- drivers/vfio
- 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/kernel.hlinux/vfio_pci_core.hlinux/mlx5/driver.hlinux/mlx5/vport.hlinux/mlx5/cq.hlinux/mlx5/qp.h
Detected Declarations
struct mlx5_vf_migration_tag_stop_copy_datastruct mlx5_vf_migration_headerstruct mlx5_vhca_data_bufferstruct mlx5vf_async_datastruct mlx5vf_save_work_datastruct mlx5_vf_migration_filestruct mlx5_vhca_cq_bufstruct mlx5_vhca_cqstruct mlx5_vhca_recv_bufstruct mlx5_vhca_qpstruct mlx5_vhca_page_trackerstruct mlx5vf_pci_core_deviceenum mlx5_vf_migf_stateenum mlx5_vf_load_stateenum mlx5_vf_migf_header_flagsenum mlx5_vf_migf_header_tagfunction mlx5vf_get_migration_page
Annotated Snippet
struct mlx5_vf_migration_tag_stop_copy_data {
__le64 stop_copy_size;
};
enum mlx5_vf_migf_header_flags {
MLX5_MIGF_HEADER_FLAGS_TAG_MANDATORY = 0,
MLX5_MIGF_HEADER_FLAGS_TAG_OPTIONAL = 1 << 0,
};
enum mlx5_vf_migf_header_tag {
MLX5_MIGF_HEADER_TAG_FW_DATA = 0,
MLX5_MIGF_HEADER_TAG_STOP_COPY_SIZE = 1 << 0,
};
struct mlx5_vf_migration_header {
__le64 record_size;
/* For future use in case we may need to change the kernel protocol */
__le32 flags; /* Use mlx5_vf_migf_header_flags */
__le32 tag; /* Use mlx5_vf_migf_header_tag */
__u8 data[]; /* Its size is given in the record_size */
};
struct mlx5_vhca_data_buffer {
struct page **page_list;
struct dma_iova_state state;
loff_t start_pos;
u64 length;
u32 npages;
u32 mkey;
u32 *mkey_in;
enum dma_data_direction dma_dir;
u8 stop_copy_chunk_num;
bool pre_copy_init_bytes_chunk;
struct list_head buf_elm;
struct mlx5_vf_migration_file *migf;
};
struct mlx5vf_async_data {
struct mlx5_async_work cb_work;
struct work_struct work;
struct mlx5_vhca_data_buffer *buf;
struct mlx5_vhca_data_buffer *header_buf;
int status;
u8 stop_copy_chunk:1;
void *out;
};
struct mlx5vf_save_work_data {
struct mlx5_vf_migration_file *migf;
size_t next_required_umem_size;
struct work_struct work;
u8 chunk_num;
};
#define MAX_NUM_CHUNKS 2
struct mlx5_vf_migration_file {
struct file *filp;
struct mutex lock;
enum mlx5_vf_migf_state state;
enum mlx5_vf_load_state load_state;
u32 pdn;
loff_t max_pos;
u64 record_size;
u32 record_tag;
u64 stop_copy_prep_size;
u64 pre_copy_initial_bytes;
u64 pre_copy_initial_bytes_start;
size_t next_required_umem_size;
u8 num_ready_chunks;
/* Upon chunk mode preserve another set of buffers for stop_copy phase */
struct mlx5_vhca_data_buffer *buf[MAX_NUM_CHUNKS];
struct mlx5_vhca_data_buffer *buf_header[MAX_NUM_CHUNKS];
struct mlx5vf_save_work_data save_data[MAX_NUM_CHUNKS];
spinlock_t list_lock;
struct list_head buf_list;
struct list_head avail_list;
struct mlx5vf_pci_core_device *mvdev;
wait_queue_head_t poll_wait;
struct completion save_comp;
struct mlx5_async_ctx async_ctx;
struct mlx5vf_async_data async_data;
u8 inflight_save:1;
};
struct mlx5_vhca_cq_buf {
struct mlx5_frag_buf_ctrl fbc;
struct mlx5_frag_buf frag_buf;
int cqe_size;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/vfio_pci_core.h`, `linux/mlx5/driver.h`, `linux/mlx5/vport.h`, `linux/mlx5/cq.h`, `linux/mlx5/qp.h`.
- Detected declarations: `struct mlx5_vf_migration_tag_stop_copy_data`, `struct mlx5_vf_migration_header`, `struct mlx5_vhca_data_buffer`, `struct mlx5vf_async_data`, `struct mlx5vf_save_work_data`, `struct mlx5_vf_migration_file`, `struct mlx5_vhca_cq_buf`, `struct mlx5_vhca_cq`, `struct mlx5_vhca_recv_buf`, `struct mlx5_vhca_qp`.
- Atlas domain: Driver Families / drivers/vfio.
- 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.