I'd suggest to look at the CQ context and act accordingly, something
like:
if (cq->poll_ctx == IB_POLL_DIRECT) {
while (!wait_for_completion_timeout(&sdrain.done,
mescs_to_jiffies(100))
ib_process_cq_direct(cq, 1024)
} else {
wait_for_completion(&sdrain.done);
}
Thoughts?
Hello Sagi,
The above code will only work as expected if the caller won't call
ib_process_cq_direct() for the same queue from another context.
Why? ib_poll_cq is safe from multiple contexts. Is it because the
completion structures are on stack? because if so we can easily move
them to the cq...
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html