drivers/net/ethernet/mellanox/mlx5/core/wq.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx5/core/wq.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlx5/core/wq.h- Extension
.h- Size
- 7924 bytes
- Lines
- 326
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/mlx5/mlx5_ifc.hlinux/mlx5/cq.hlinux/mlx5/qp.h
Detected Declarations
struct mlx5_wq_paramstruct mlx5_wq_ctrlstruct mlx5_wq_cycstruct mlx5_wq_qpstruct mlx5_cqwqstruct mlx5_wq_llfunction mlx5_wq_cyc_get_sizefunction mlx5_wq_cyc_is_fullfunction mlx5_wq_cyc_missingfunction mlx5_wq_cyc_is_emptyfunction mlx5_wq_cyc_pushfunction mlx5_wq_cyc_push_nfunction mlx5_wq_cyc_popfunction mlx5_wq_cyc_update_db_recordfunction mlx5_wq_cyc_ctr2ixfunction mlx5_wq_cyc_get_headfunction mlx5_wq_cyc_get_tailfunction mlx5_wq_cyc_get_contig_wqebbsfunction mlx5_wq_cyc_cc_biggerfunction mlx5_wq_cyc_get_counterfunction mlx5_cqwq_get_sizefunction mlx5_cqwq_get_log_stride_sizefunction mlx5_cqwq_ctr2ixfunction mlx5_cqwq_get_cifunction mlx5_cqwq_get_ctr_wrap_cntfunction mlx5_cqwq_get_wrap_cntfunction mlx5_cqwq_popfunction mlx5_cqwq_update_db_recordfunction mlx5_wq_ll_get_sizefunction mlx5_wq_ll_is_fullfunction mlx5_wq_ll_is_emptyfunction mlx5_wq_ll_missingfunction mlx5_wq_ll_get_wqe_next_ixfunction mlx5_wq_ll_pushfunction mlx5_wq_ll_popfunction mlx5_wq_ll_update_db_recordfunction mlx5_wq_ll_get_headfunction mlx5_wq_ll_get_counter
Annotated Snippet
struct mlx5_wq_param {
int buf_numa_node;
int db_numa_node;
};
struct mlx5_wq_ctrl {
struct mlx5_core_dev *mdev;
struct mlx5_frag_buf buf;
struct mlx5_db db;
};
struct mlx5_wq_cyc {
struct mlx5_frag_buf_ctrl fbc;
__be32 *db;
u16 sz;
u16 wqe_ctr;
u16 cur_sz;
};
struct mlx5_wq_qp {
struct mlx5_wq_cyc rq;
struct mlx5_wq_cyc sq;
};
struct mlx5_cqwq {
struct mlx5_frag_buf_ctrl fbc;
__be32 *db;
u32 cc; /* consumer counter */
};
struct mlx5_wq_ll {
struct mlx5_frag_buf_ctrl fbc;
__be32 *db;
__be16 *tail_next;
u16 head;
u16 wqe_ctr;
u16 cur_sz;
};
int mlx5_wq_cyc_create(struct mlx5_core_dev *mdev, struct mlx5_wq_param *param,
void *wqc, struct mlx5_wq_cyc *wq,
struct mlx5_wq_ctrl *wq_ctrl);
void mlx5_wq_cyc_wqe_dump(struct mlx5_wq_cyc *wq, u16 ix, u8 nstrides);
void mlx5_wq_cyc_reset(struct mlx5_wq_cyc *wq);
int mlx5_wq_qp_create(struct mlx5_core_dev *mdev, struct mlx5_wq_param *param,
void *qpc, struct mlx5_wq_qp *wq,
struct mlx5_wq_ctrl *wq_ctrl);
int mlx5_cqwq_create(struct mlx5_core_dev *mdev, struct mlx5_wq_param *param,
void *cqc, struct mlx5_cqwq *wq,
struct mlx5_wq_ctrl *wq_ctrl);
int mlx5_wq_ll_create(struct mlx5_core_dev *mdev, struct mlx5_wq_param *param,
void *wqc, struct mlx5_wq_ll *wq,
struct mlx5_wq_ctrl *wq_ctrl);
void mlx5_wq_ll_reset(struct mlx5_wq_ll *wq);
void mlx5_wq_destroy(struct mlx5_wq_ctrl *wq_ctrl);
static inline u32 mlx5_wq_cyc_get_size(struct mlx5_wq_cyc *wq)
{
return (u32)wq->fbc.sz_m1 + 1;
}
static inline int mlx5_wq_cyc_is_full(struct mlx5_wq_cyc *wq)
{
return wq->cur_sz == wq->sz;
}
static inline int mlx5_wq_cyc_missing(struct mlx5_wq_cyc *wq)
{
return wq->sz - wq->cur_sz;
}
static inline int mlx5_wq_cyc_is_empty(struct mlx5_wq_cyc *wq)
{
return !wq->cur_sz;
}
static inline void mlx5_wq_cyc_push(struct mlx5_wq_cyc *wq)
{
wq->wqe_ctr++;
wq->cur_sz++;
}
static inline void mlx5_wq_cyc_push_n(struct mlx5_wq_cyc *wq, u16 n)
{
wq->wqe_ctr += n;
wq->cur_sz += n;
Annotation
- Immediate include surface: `linux/mlx5/mlx5_ifc.h`, `linux/mlx5/cq.h`, `linux/mlx5/qp.h`.
- Detected declarations: `struct mlx5_wq_param`, `struct mlx5_wq_ctrl`, `struct mlx5_wq_cyc`, `struct mlx5_wq_qp`, `struct mlx5_cqwq`, `struct mlx5_wq_ll`, `function mlx5_wq_cyc_get_size`, `function mlx5_wq_cyc_is_full`, `function mlx5_wq_cyc_missing`, `function mlx5_wq_cyc_is_empty`.
- 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.