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

# rdma\_init\_qp\_attr(3)

Returns qp attributes of an rdma\_cm\_id.

## NAME

rdma\_init\_qp\_attr - Returns qp attributes of an rdma\_cm\_id.

## SYNOPSIS

-

  ```
  #include <rdma/rdma_cma.h>
  int rdma_init_qp_attr(struct rdma_cm_id *id,
                 struct ibv_qp_attr *qp_attr,
                 int *qp_attr_mask);
  ```

## DESCRIPTION

**rdma\_init\_qp\_attr()** returns qp attributes of an rdma\_cm\_id.

Information about qp attributes and qp attributes mask is returned through the *qp\_attr* and *qp\_attr\_mask* parameters.

For details on the qp\_attr structure, see ibv\_modify\_qp.

## ARGUMENTS

- *id*

  RDMA identifier.

- *qp\_attr*

  A reference to a qp attributes struct containing response information.

- *qp\_attr\_mask*

  A reference to a qp attributes mask containing response information.

## RETURN VALUE

**rdma\_init\_qp\_attr()** returns 0 on success, or -1 on error. If an error occurs, errno will be set to indicate the failure reason.

## SEE ALSO

[**rdma\_cm**(7)](/rdma_cm/7.md), [**ibv\_modify\_qp**(3)](/ibv_modify_qp/3.md)

## AUTHOR

Danit Goldberg ⟨danitg@mellanox.com⟩\\c
