drivers/vdpa/mlx5/core/mlx5_vdpa.h
Source file repositories/reference/linux-study-clean/drivers/vdpa/mlx5/core/mlx5_vdpa.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/vdpa/mlx5/core/mlx5_vdpa.h- Extension
.h- Size
- 5267 bytes
- Lines
- 188
- Domain
- Driver Families
- Bucket
- drivers/vdpa
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/etherdevice.hlinux/vringh.hlinux/vdpa.hlinux/mlx5/driver.h
Detected Declarations
struct mlx5_vdpa_direct_mrstruct mlx5_vdpa_mrstruct mlx5_vdpa_resourcesstruct mlx5_control_vqstruct mlx5_vdpa_wq_entstruct mlx5_vdpa_mr_resourcesstruct mlx5_vdpa_devstruct mlx5_vdpa_async_cmd
Annotated Snippet
struct mlx5_vdpa_direct_mr {
u64 start;
u64 end;
u32 perm;
u32 mr;
struct sg_table sg_head;
int log_size;
int nsg;
int nent;
struct list_head list;
u64 offset;
};
struct mlx5_vdpa_mr {
u32 mkey;
/* list of direct MRs descendants of this indirect mr */
struct list_head head;
unsigned long num_directs;
unsigned long num_klms;
struct vhost_iotlb *iotlb;
bool user_mr;
refcount_t refcount;
struct list_head mr_list;
};
struct mlx5_vdpa_resources {
u32 pdn;
struct mlx5_uars_page *uar;
void __iomem *kick_addr;
u64 phys_kick_addr;
u16 uid;
u32 null_mkey;
bool valid;
};
struct mlx5_control_vq {
struct vhost_iotlb *iotlb;
/* spinlock to synchronize iommu table */
spinlock_t iommu_lock;
struct vringh vring;
bool ready;
u64 desc_addr;
u64 device_addr;
u64 driver_addr;
struct vdpa_callback event_cb;
struct vringh_kiov riov;
struct vringh_kiov wiov;
unsigned short head;
unsigned int received_desc;
unsigned int completed_desc;
};
struct mlx5_vdpa_wq_ent {
struct work_struct work;
struct mlx5_vdpa_dev *mvdev;
};
enum {
MLX5_VDPA_DATAVQ_GROUP,
MLX5_VDPA_CVQ_GROUP,
MLX5_VDPA_DATAVQ_DESC_GROUP,
MLX5_VDPA_NUMVQ_GROUPS
};
enum {
MLX5_VDPA_NUM_AS = 2
};
struct mlx5_vdpa_mr_resources {
struct mlx5_vdpa_mr *mr[MLX5_VDPA_NUM_AS];
unsigned int group2asid[MLX5_VDPA_NUMVQ_GROUPS];
/* Pre-deletion mr list */
struct list_head mr_list_head;
/* Deferred mr list */
struct list_head mr_gc_list_head;
struct workqueue_struct *wq_gc;
struct delayed_work gc_dwork_ent;
struct mutex lock;
atomic_t shutdown;
};
struct mlx5_vdpa_dev {
Annotation
- Immediate include surface: `linux/etherdevice.h`, `linux/vringh.h`, `linux/vdpa.h`, `linux/mlx5/driver.h`.
- Detected declarations: `struct mlx5_vdpa_direct_mr`, `struct mlx5_vdpa_mr`, `struct mlx5_vdpa_resources`, `struct mlx5_control_vq`, `struct mlx5_vdpa_wq_ent`, `struct mlx5_vdpa_mr_resources`, `struct mlx5_vdpa_dev`, `struct mlx5_vdpa_async_cmd`.
- Atlas domain: Driver Families / drivers/vdpa.
- 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.