summaryrefslogtreecommitdiff
path: root/drivers/infiniband/sw/rxe/rxe_cq.c
diff options
context:
space:
mode:
authorBob Pearson <rpearsonhpe@gmail.com>2023-06-12 11:22:45 -0500
committerJason Gunthorpe <jgg@nvidia.com>2023-06-20 12:46:18 -0300
commit350b6dd4b2f876f1aa0d45a422b17b8377517762 (patch)
tree073763566534715dd12e9e71556bce20ec476d0c /drivers/infiniband/sw/rxe/rxe_cq.c
parentee678e5dffc0b0d63b4a2ec6129063339435bfc5 (diff)
RDMA/rxe: Simplify cq->notify code
The flags parameter to the request notify verb is a bitmask. But, rxe driver treats cq->notify as an int. If someone ever set both the IB_CQ_SOLICITED and the IB_CQ_NEXT_COMP bits rxe_cq_post could fail to generate a completion event. This patch treats the notify flags as a bit mask consistently and can handle the above case correctly. Link: https://lore.kernel.org/r/20230612162244.20038-1-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband/sw/rxe/rxe_cq.c')
-rw-r--r--drivers/infiniband/sw/rxe/rxe_cq.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/infiniband/sw/rxe/rxe_cq.c b/drivers/infiniband/sw/rxe/rxe_cq.c
index 20ff0c0c4605..31a25aaa44a0 100644
--- a/drivers/infiniband/sw/rxe/rxe_cq.c
+++ b/drivers/infiniband/sw/rxe/rxe_cq.c
@@ -115,10 +115,9 @@ int rxe_cq_post(struct rxe_cq *cq, struct rxe_cqe *cqe, int solicited)
spin_unlock_irqrestore(&cq->cq_lock, flags);
- if ((cq->notify == IB_CQ_NEXT_COMP) ||
- (cq->notify == IB_CQ_SOLICITED && solicited)) {
+ if ((cq->notify & IB_CQ_NEXT_COMP) ||
+ (cq->notify & IB_CQ_SOLICITED && solicited)) {
cq->notify = 0;
-
cq->ibcq.comp_handler(&cq->ibcq, cq->ibcq.cq_context);
}