mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 08:02:27 +02:00
RDMA/irdma: Take a lock before moving SRQ tail in poll_cq
Need to take an SRQ lock in poll_cq before moving SRQ tail. Signed-off-by: Jay Bhat <jay.bhat@intel.com> Reviewed-by: Jacob Moroni <jmoroni@google.com> Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com> Link: https://patch.msgid.link/20251031021726.1003-7-tatyana.e.nikolova@intel.com Signed-off-by: Leon Romanovsky <leon@kernel.org>
This commit is contained in:
parent
0a19274555
commit
da58d4223b
|
|
@ -1309,6 +1309,8 @@ int irdma_uk_cq_poll_cmpl(struct irdma_cq_uk *cq,
|
|||
info->op_type = (u8)FIELD_GET(IRDMACQ_OP, qword3);
|
||||
|
||||
if (info->q_type == IRDMA_CQE_QTYPE_RQ && is_srq) {
|
||||
unsigned long flags;
|
||||
|
||||
srq = qp->srq_uk;
|
||||
|
||||
get_64bit_val(cqe, 8, &info->wr_id);
|
||||
|
|
@ -1321,8 +1323,11 @@ int irdma_uk_cq_poll_cmpl(struct irdma_cq_uk *cq,
|
|||
} else {
|
||||
info->stag_invalid_set = false;
|
||||
}
|
||||
spin_lock_irqsave(srq->lock, flags);
|
||||
IRDMA_RING_MOVE_TAIL(srq->srq_ring);
|
||||
spin_unlock_irqrestore(srq->lock, flags);
|
||||
pring = &srq->srq_ring;
|
||||
|
||||
} else if (info->q_type == IRDMA_CQE_QTYPE_RQ && !is_srq) {
|
||||
u32 array_idx;
|
||||
|
||||
|
|
|
|||
|
|
@ -466,6 +466,7 @@ struct irdma_srq_uk {
|
|||
u8 wqe_size;
|
||||
u8 wqe_size_multiplier;
|
||||
u8 deferred_flag;
|
||||
spinlock_t *lock;
|
||||
};
|
||||
|
||||
struct irdma_srq_uk_init_info {
|
||||
|
|
|
|||
|
|
@ -2388,6 +2388,7 @@ static int irdma_create_srq(struct ib_srq *ibsrq,
|
|||
info.vsi = &iwdev->vsi;
|
||||
info.pd = &iwpd->sc_pd;
|
||||
|
||||
iwsrq->sc_srq.srq_uk.lock = &iwsrq->lock;
|
||||
err_code = irdma_sc_srq_init(&iwsrq->sc_srq, &info);
|
||||
if (err_code)
|
||||
goto free_dmem;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user