hw/rdma: Free all receive buffers when QP is destroyed
When QP is destroyed the backend QP is destroyed as well. This ensures
we clean all received buffer we posted to it.
However, a contexts of these buffers are still remain in the device.
Fix it by maintaining a list of buffer's context and free them when QP
is destroyed.
Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Message-Id: <1552300155-25216-8-git-send-email-yuval.shaia@oracle.com>
Reviewed-by: Kamal Heib <kamalheib1@gmail.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
diff --git a/hw/rdma/rdma_rm.c b/hw/rdma/rdma_rm.c
index b50e192..bac3b2f 100644
--- a/hw/rdma/rdma_rm.c
+++ b/hw/rdma/rdma_rm.c
@@ -537,7 +537,7 @@
return;
}
- rdma_backend_destroy_qp(&qp->backend_qp);
+ rdma_backend_destroy_qp(&qp->backend_qp, dev_res);
rdma_res_tbl_dealloc(&dev_res->qp_tbl, qp->qpn);
}