Skip to content


3.00 avg. rating (77% score) - 1 vote
int ibv_dealloc_pd(struct ibv_pd *pd);


ibv_dealloc_pd() deallocates a Protection Domain.

The destruction of a PD will fail if any other resource is still associated with that PD. In that case the PD, or those resource's state won't be changed.
The following resources can be associated with that PD:

  • AH
  • SRQ
  • QP
  • MR
  • MW

As soon as all of those resources will be destroyed that PD can be destroyed.


Name Direction Description
pd in PD that was returned from ibv_alloc_pd()

Return Values

Value Description
0 On success
errno On failure
EINVAL PD context is invalid
EBUSY RDMA resources are still associated with this PD


Allocate a PD and then deallocate it:

struct ibv_context *context;
struct ibv_pd *pd;
pd = ibv_alloc_pd(context);
if (!pd) {
	fprintf(stderr, "Error, ibv_alloc_pd() failed\n");
	return -1;
if (ibv_dealloc_pd(pd)) {
	fprintf(stderr, "Error, ibv_dealloc_pd() failed\n");
	return -1;


Can I destroy the PD and all of the RDMA resources which are associated with it with one verb call?

No, libibverbs doesn't support it. If a user wishes to deallocate a PD, he needs to destroy all of the RDMA resources which are associated with it before calling ibv_dealloc_pd().

ibv_dealloc_pd() failed, can I know which RDMA resources are allocated and causes this failure?

No, currently the RDMA stack doesn't have this capability.

Share Our Posts

Share this post through social bookmarks.

  • Delicious
  • Digg
  • Newsvine
  • RSS
  • StumbleUpon
  • Technorati


Tell us what do you think.

There are no comments on this entry.

Add a Comment

Fill in the form and submit.

Time limit is exhausted. Please reload CAPTCHA.