---
name: "mlx5dv_create_cq"
section: "3"
platform: "linux"
package: "rdma-core"
version: "65.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/mlx5dv_create_cq"
---

# mlx5dv\_create\_cq(3)

creates a completion queue (CQ)

## NAME

mlx5dv\_create\_cq - creates a completion queue (CQ)

## 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);
  ```

## DESCRIPTION

**mlx5dv\_create\_cq()** creates a completion queue (CQ) with specific driver properties.

## ARGUMENTS

Please see **[ibv\_create\_cq\_ex(3)](/ibv_create_cq_ex/3.md)** man page for **context** and **cq\_attr**

### mlx5\_cq\_attr

-

  ```
  struct mlx5dv_cq_init_attr {
      uint64_t comp_mask;
      uint8_t  cqe_comp_res_format;
      uint32_t flags;
      uint16_t cqe_size;
  };
  ```

- *comp\_mask*

  Bitmask specifying what fields in the structure are valid:

  MLX5DV\_CQ\_INIT\_ATTR\_MASK\_COMPRESSED\_CQE enables creating a CQ in a mode that few CQEs may be compressed into a single CQE, valid values in *cqe\_comp\_res\_format* MLX5DV\_CQ\_INIT\_ATTR\_MASK\_FLAGS valid values in *flags* MLX5DV\_CQ\_INIT\_ATTR\_MASK\_CQE\_SIZE valid values in *cqe\_size*

- *cqe\_comp\_res\_format*

  A bitwise OR of the various CQE response formats of the responder side:

  MLX5DV\_CQE\_RES\_FORMAT\_HASH CQE compression with hash MLX5DV\_CQE\_RES\_FORMAT\_CSUM CQE compression with RX checksum MLX5DV\_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 other values will fail mlx5dv\_create\_cq.

## RETURN VALUE

**mlx5dv\_create\_cq()** returns a pointer to the created CQ, or NULL if the request fails and errno will be set.

## SEE ALSO

[**ibv\_create\_cq\_ex**(3)](/ibv_create_cq_ex/3.md),

## AUTHOR

Yonatan Cohen ⟨yonatanc@mellanox.com⟩\\c
