From 3c7920b48ea673618b0b13d0a0619e5b79a53682 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 3 Jan 2013 09:19:09 +0000 Subject: [PATCH] ib_srpt: Defer reenabling interrupts until after completion processing finished git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4675 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index c260fb0e3..a5e0affd2 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -2007,13 +2007,12 @@ static void srpt_process_send_completion(struct ib_cq *cq, srpt_process_wait_list(ch); } -static void srpt_process_completion(struct srpt_rdma_ch *ch) +static void srpt_poll(struct srpt_rdma_ch *ch) { struct ib_cq *const cq = ch->cq; struct ib_wc *const wc = ch->wc; int i, n; - 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) @@ -2024,6 +2023,16 @@ static void srpt_process_completion(struct srpt_rdma_ch *ch) } } +static void srpt_process_completion(struct srpt_rdma_ch *ch) +{ + struct ib_cq *const cq = ch->cq; + + do { + srpt_poll(ch); + } while (ib_req_notify_cq(cq, IB_CQ_NEXT_COMP | + IB_CQ_REPORT_MISSED_EVENTS) > 0); +} + /** * srpt_completion() - IB completion queue callback function. */