mlx5dv_create_cq(3)
β¨ mlx5dv_create_cq β it's giving completion queue energy β¨
okay so bestie, this one's from the mlx5 Programmer's Manual, and it's lowkey iconic. sit down, grab a boba, we're making a completion queue π
π NAME π
mlx5dv_create_cq β creates a completion queue (CQ). that's it. that's the vibe. π¦
πΈ SYNOPSIS πΈ
#include <infiniband/mlx5dv.h>
struct ibv_cq_ex *mlx5dv_create_cq(struct ibv_context *context,
struct ibv_cq_init_attr_ex *cq_attr,
struct mlx5dv_cq_init_attr *mlx5_cq_attr);
three args, one CQ, no cap π
β¨ DESCRIPTION β¨
mlx5dv_create_cq() creates a completion queue (CQ) β but like, with specific driver properties. not your basic CQ, a customized CQ. main character behavior honestly π
π«Ά ARGUMENTS π«Ά
so for context and cq_attr, please see the ibv_create_cq_ex(3) man page, mwah π
π§ mlx5_cq_attr π§
here's the struct, look at her:
struct mlx5dv_cq_init_attr {
uint64_t comp_mask;
uint8_t cqe_comp_res_format;
uint32_t flags;
uint16_t cqe_size;
};
comp_mask
it's a bitmask specifying which fields in the struct are actually valid (like a vibe check for your struct π):
MLX5DV_CQ_INIT_ATTR_MASK_COMPRESSED_CQEβ enables creating a CQ in a mode where, like, a few CQEs may be compressed into a single CQE. valid values live incqe_comp_res_format(see below, bestie β¬οΈ)MLX5DV_CQ_INIT_ATTR_MASK_FLAGSβ valid values live inflagsMLX5DV_CQ_INIT_ATTR_MASK_CQE_SIZEβ valid values live incqe_size
cqe_comp_res_format
a bitwise OR of the various CQE response formats of the responder side (yes, you can stack them, we love a bitwise OR π₯):
MLX5DV_CQE_RES_FORMAT_HASHβ CQE compression with hashMLX5DV_CQE_RES_FORMAT_CSUMβ CQE compression with RX checksumMLX5DV_CQE_RES_FORMAT_CSUM_STRIDXβ CQE compression with stride index
flags
a bitwise OR of the various values described below:
MLX5DV_CQ_INIT_ATTR_FLAGS_CQE_PADβ create a padded 128B CQE
cqe_size
configure the CQE size to be 64 or 128 bytes. and like β other values will fail mlx5dv_create_cq. no in-between, no "but what if I want 96", just no π the function said what it said.
π RETURN VALUE π
mlx5dv_create_cq() returns a pointer to the created CQ β slay π β or NULL if the request fails, and errno will be set. (so check your returns, bestie, don't just vibe and hope π)
π SEE ALSO π
π AUTHOR π
Yonatan Cohen <yonatanc@mellanox.com> β thank you for your service π«‘
and that's the whole page, periodt π this icon dropped in mlx5, dated 2018-9-1 β a classic, honestly. go forth and make your CQs, bestie, you got this πβ¨π
π¦ where this page comes from
- alpine 3.24: rdma-core-doc 61.0-r0 Β· GPL-2.0-only OR BSD-2-Clause
- centos-stream 10: rdma-core-devel 62.0-3.el10 Β· GPLv2 or BSD
- centos-stream 9: rdma-core-devel 61.0-3.el9 Β· GPLv2 or BSD
- centos-stream 9: rdma-core-devel 61.0-3.el9 Β· GPLv2 or BSD
- ubuntu jammy: libibverbs-dev 39.0-1 Β· BSD-MIT OR GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms