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

# ibv\_open\_qp(3)

open a shareable queue pair (QP)

## NAME

ibv\_open\_qp - open a shareable queue pair (QP)

## SYNOPSIS

```
#include <infiniband/verbs.h>

struct ibv_qp *ibv_open_qp(struct ibv_context *context,
                           struct ibv_qp_open_attr *qp_open_attr);
```

## DESCRIPTION

**ibv\_open\_qp()** opens an existing queue pair (QP) associated with the extended protection domain *xrcd.* The argument *qp\_open\_attr* is an ibv\_qp\_open\_attr struct, as defined in \<infiniband/verbs.h\>.

```
struct ibv_qp_open_attr {
uint32_t          comp_mask;  /* Identifies valid fields */
uint32_t          qp_num;     /* QP number */
struct            *ibv_xrcd;  /* XRC domain */
void             *qp_context; /* User defined opaque value */
enum ibv_qp_type  qp_type;    /* QP transport service type */
```

**ibv\_destroy\_qp()** closes the opened QP and destroys the underlying QP if it has no other references. *qp.*

## RETURN VALUE

**ibv\_open\_qp()** returns a pointer to the opened QP, or NULL if the request fails. Check the QP number (**qp\_num**) in the returned QP.

## NOTES

**ibv\_open\_qp()** will fail if a it is asked to open a QP that does not exist within the xrcd with the specified qp\_num and qp\_type.

## SEE ALSO

[**ibv\_alloc\_pd**(3)](/ibv_alloc_pd/3.md), [**ibv\_create\_qp**(3)](/ibv_create_qp/3.md), [**ibv\_create\_qp\_ex**(3)](/ibv_create_qp_ex/3.md), [**ibv\_modify\_qp**(3)](/ibv_modify_qp/3.md), [**ibv\_query\_qp**(3)](/ibv_query_qp/3.md)

## AUTHORS

- Sean Hefty \<sean.hefty@intel.com\>
