From 7ac9532359c63d5f8e1d21fb3d3999fd0009470a Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 15 Nov 2011 19:06:36 +0000 Subject: [PATCH] ib_srpt: Reduce the I/O overhead slightly git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3920 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index fa7a4a6c0..05838296b 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -1965,18 +1965,19 @@ static void srpt_process_completion(struct ib_cq *cq, EXTRACHECKS_WARN_ON(cq != ch->cq); - ib_req_notify_cq(cq, IB_CQ_NEXT_COMP); - while ((n = ib_poll_cq(cq, ARRAY_SIZE(ch->wc), wc)) > 0) { - for (i = 0; i < n; i++) { - if (opcode_from_wr_id(wc[i].wr_id) == SRPT_RECV) - srpt_process_rcv_completion(cq, ch, rcv_context, - &wc[i]); - else - srpt_process_send_completion(cq, ch, - send_context, - &wc[i]); + do { + while ((n = ib_poll_cq(cq, ARRAY_SIZE(ch->wc), wc)) > 0) { + for (i = 0; i < n; i++) { + if (opcode_from_wr_id(wc[i].wr_id) == SRPT_RECV) + srpt_process_rcv_completion(cq, ch, + rcv_context, &wc[i]); + else + srpt_process_send_completion(cq, ch, + send_context, &wc[i]); + } } - } + } while (ib_req_notify_cq(cq, IB_CQ_NEXT_COMP | + IB_CQ_REPORT_MISSED_EVENTS) > 0); } /**