Need to cleanup the proxy buffer created during device open.
unregister the proxy buffer with both scif and IB and free memory.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
pthread_mutex_unlock(&smd->plock);
mlog(1, " port space destroyed \n");
+ /* unregister scif window, ib mr, and free m_buf*/
+ if (smd->m_offset)
+ scif_unregister(smd->scif_tx_ep, smd->m_offset, smd->m_len);
+
+ if (smd->m_mr)
+ ibv_dereg_mr(smd->m_mr);
+
+ free (smd->m_buf);
+ mlog(1, " m_buf unregistered and freed \n");
+
if (smd->ref_cnt) {
mlog(0, " WARNING: ref_cnt not 0, = %d \n", smd->ref_cnt);
}