From f5736f2b6ab281e57468a3c7ce161bf1426a4cd8 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 12 Sep 2010 18:57:04 +0000 Subject: [PATCH] ib_srpt performance optimization. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2109 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index ef0c6616f..c07ed3641 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -1965,18 +1965,23 @@ static void srpt_process_completion(struct ib_cq *cq, struct srpt_rdma_ch *ch, enum scst_exec_context context) { - struct ib_wc wc; + struct ib_wc wc[16]; + int i, n; EXTRACHECKS_WARN_ON(cq != ch->cq); do { - while (ib_poll_cq(cq, 1, &wc) > 0) { - if (wc.wr_id & SRPT_OP_RECV) - srpt_process_rcv_completion(cq, ch, context, - &wc); - else - srpt_process_send_completion(cq, ch, context, - &wc); + while ((n = ib_poll_cq(cq, ARRAY_SIZE(wc), wc)) > 0) { + for (i = 0; i < n; i++) { + if (wc[i].wr_id & SRPT_OP_RECV) + srpt_process_rcv_completion(cq, ch, + context, + &wc[i]); + else + srpt_process_send_completion(cq, ch, + context, + &wc[i]); + } } } while (ib_req_notify_cq(cq, IB_CQ_NEXT_COMP | IB_CQ_REPORT_MISSED_EVENTS) > 0);