Skip to content

Commit 62356fc

Browse files
jakemoronirleon
authored andcommitted
RDMA/irdma: Remove doorbell elision logic
In some cases, this logic can result in doorbell writes being skipped when they should not have been (at least on GEN3 HW), so remove it. This also means that the mb() can be safely downgraded to dma_wmb(). Fixes: 551c46e ("RDMA/irdma: Add user/kernel shared libraries") Signed-off-by: Jacob Moroni <jmoroni@google.com> Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com> Link: https://patch.msgid.link/20251125025350.180-9-tatyana.e.nikolova@intel.com Signed-off-by: Leon Romanovsky <leon@kernel.org>
1 parent eef3ad0 commit 62356fc

3 files changed

Lines changed: 2 additions & 31 deletions

File tree

drivers/infiniband/hw/irdma/puda.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,6 @@ static int irdma_puda_qp_create(struct irdma_puda_rsrc *rsrc)
685685
ukqp->rq_size = rsrc->rq_size;
686686

687687
IRDMA_RING_INIT(ukqp->sq_ring, ukqp->sq_size);
688-
IRDMA_RING_INIT(ukqp->initial_ring, ukqp->sq_size);
689688
IRDMA_RING_INIT(ukqp->rq_ring, ukqp->rq_size);
690689
ukqp->wqe_alloc_db = qp->pd->dev->wqe_alloc_db;
691690

drivers/infiniband/hw/irdma/uk.c

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -114,33 +114,8 @@ void irdma_clr_wqes(struct irdma_qp_uk *qp, u32 qp_wqe_idx)
114114
*/
115115
void irdma_uk_qp_post_wr(struct irdma_qp_uk *qp)
116116
{
117-
u64 temp;
118-
u32 hw_sq_tail;
119-
u32 sw_sq_head;
120-
121-
/* valid bit is written and loads completed before reading shadow */
122-
mb();
123-
124-
/* read the doorbell shadow area */
125-
get_64bit_val(qp->shadow_area, 0, &temp);
126-
127-
hw_sq_tail = (u32)FIELD_GET(IRDMA_QP_DBSA_HW_SQ_TAIL, temp);
128-
sw_sq_head = IRDMA_RING_CURRENT_HEAD(qp->sq_ring);
129-
if (sw_sq_head != qp->initial_ring.head) {
130-
if (sw_sq_head != hw_sq_tail) {
131-
if (sw_sq_head > qp->initial_ring.head) {
132-
if (hw_sq_tail >= qp->initial_ring.head &&
133-
hw_sq_tail < sw_sq_head)
134-
writel(qp->qp_id, qp->wqe_alloc_db);
135-
} else {
136-
if (hw_sq_tail >= qp->initial_ring.head ||
137-
hw_sq_tail < sw_sq_head)
138-
writel(qp->qp_id, qp->wqe_alloc_db);
139-
}
140-
}
141-
}
142-
143-
qp->initial_ring.head = qp->sq_ring.head;
117+
dma_wmb();
118+
writel(qp->qp_id, qp->wqe_alloc_db);
144119
}
145120

146121
/**
@@ -1606,7 +1581,6 @@ static void irdma_setup_connection_wqes(struct irdma_qp_uk *qp,
16061581
qp->conn_wqes = move_cnt;
16071582
IRDMA_RING_MOVE_HEAD_BY_COUNT_NOCHECK(qp->sq_ring, move_cnt);
16081583
IRDMA_RING_MOVE_TAIL_BY_COUNT(qp->sq_ring, move_cnt);
1609-
IRDMA_RING_MOVE_HEAD_BY_COUNT_NOCHECK(qp->initial_ring, move_cnt);
16101584
}
16111585

16121586
/**
@@ -1751,7 +1725,6 @@ int irdma_uk_qp_init(struct irdma_qp_uk *qp, struct irdma_qp_uk_init_info *info)
17511725
qp->max_sq_frag_cnt = info->max_sq_frag_cnt;
17521726
sq_ring_size = qp->sq_size << info->sq_shift;
17531727
IRDMA_RING_INIT(qp->sq_ring, sq_ring_size);
1754-
IRDMA_RING_INIT(qp->initial_ring, sq_ring_size);
17551728
if (info->first_sq_wq) {
17561729
irdma_setup_connection_wqes(qp, info);
17571730
qp->swqe_polarity = 1;

drivers/infiniband/hw/irdma/user.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,6 @@ struct irdma_srq_uk {
457457
struct irdma_uk_attrs *uk_attrs;
458458
__le64 *shadow_area;
459459
struct irdma_ring srq_ring;
460-
struct irdma_ring initial_ring;
461460
u32 srq_id;
462461
u32 srq_size;
463462
u32 max_srq_frag_cnt;

0 commit comments

Comments
 (0)