Skip to content

Commit 0c7e314

Browse files
Bob Pearsonjgunthorpe
authored andcommitted
RDMA/rxe: Fix rxe_cq_post
A recent patch replaced a tasklet execution of cq->comp_handler by a direct call. While this made sense it let changes to cq->notify state be unprotected and assumed that the cq completion machinery and the ulp done callbacks were reentrant. The result is that in some cases completion events can be lost. This patch moves the cq->comp_handler call inside of the spinlock in rxe_cq_post which solves both issues. This is compatible with the matching code in the request notify verb. Fixes: 78b26a3 ("RDMA/rxe: Remove tasklet call from rxe_cq.c") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bob Pearson <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 699826f commit 0c7e314

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/infiniband/sw/rxe/rxe_cq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,15 @@ int rxe_cq_post(struct rxe_cq *cq, struct rxe_cqe *cqe, int solicited)
113113

114114
queue_advance_producer(cq->queue, QUEUE_TYPE_TO_CLIENT);
115115

116-
spin_unlock_irqrestore(&cq->cq_lock, flags);
117-
118116
if ((cq->notify == IB_CQ_NEXT_COMP) ||
119117
(cq->notify == IB_CQ_SOLICITED && solicited)) {
120118
cq->notify = 0;
121119

122120
cq->ibcq.comp_handler(&cq->ibcq, cq->ibcq.cq_context);
123121
}
124122

123+
spin_unlock_irqrestore(&cq->cq_lock, flags);
124+
125125
return 0;
126126
}
127127

0 commit comments

Comments
 (0)