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

# ibv\_query\_comp\_cntr\_caps(3)

Query completion counter capabilities

## NAME

**ibv\_query\_comp\_cntr\_caps** - Query completion counter capabilities

## SYNOPSIS

-

  ```
  #include <infiniband/verbs.h>
  int ibv_query_comp_cntr_caps(struct ibv_context *context,
                               struct ibv_comp_cntr_caps *caps);
  ```

## DESCRIPTION

**ibv\_query\_comp\_cntr\_caps**() queries the completion counter capabilities of the RDMA device associated with *context*.

## ARGUMENTS

### ibv\_comp\_cntr\_caps

-

  ```
  struct ibv_comp_cntr_caps {
      uint64_t max_value;
      uint32_t max_counters;
      uint32_t supported_qp_attach_ops;
  };
  ```

- *max\_value*

  The maximum value a completion counter can hold. A subsequent increment that would exceed this value wraps the counter to zero.

- *max\_counters*

  The maximum number of completion counters that can be created on this device.

- *supported\_qp\_attach\_ops*

  A bitmask of **ibv\_qp\_attach\_comp\_cntr\_op** values indicating which attach operations are supported by the device. See [**ibv\_qp\_attach\_comp\_cntr**(3)](/ibv_qp_attach_comp_cntr/3.md) for the list of operations.

## RETURN VALUE

**ibv\_query\_comp\_cntr\_caps**() returns 0 on success, or the value of errno on failure (which indicates the failure reason).

## ERRORS

- ENOTSUP

  Completion counters are not supported on this device.

## SEE ALSO

[**ibv\_create\_comp\_cntr**(3)](/ibv_create_comp_cntr/3.md), [**ibv\_qp\_attach\_comp\_cntr**(3)](/ibv_qp_attach_comp_cntr/3.md)

## AUTHORS

Michael Margolin ⟨mrgolin@amazon.com⟩\\c
