> + /* Unmap the old queue so we can resize it. */
> + size = sizeof(struct ipath_cq_wc) +
> + (sizeof(struct ipath_wc) * cq->ibv_cq.cqe);
> + (void) munmap(cq->queue, size);
> + ret = ibv_cmd_resize_cq_resp(ibcq, cqe, &cmd, sizeof cmd,
> + &resp.ibv_resp, sizeof resp);
> + if (ret) {
> + pthread_spin_unlock(&cq->lock);
> + return ret;
> + }
It seems that this method of returning a new buffer address to mmap
from the resize operation leads to some really nasty error handling
though. If the resize operation fails (either because of bad
userspace values or because the kernel is out of memory and can't
allocate a new buffer) then the old CQ is gone, possibly beyond recovery.
mthca avoids all this by allocating a resize buffer in advance.
- R.
_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general
To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general