Skip to content

Commit cd4fedf

Browse files
Parav Panditrolandd
authored andcommitted
RDMA/ocrdma: Correct queue free count math
Correct queue free count math for SQ, RQ for all hardware type. Update user-kernel ABI interface. Signed-off-by: Parav Pandit <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
1 parent c23ddf7 commit cd4fedf

File tree

4 files changed

+1
-17
lines changed

4 files changed

+1
-17
lines changed

drivers/infiniband/hw/ocrdma/ocrdma.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ struct ocrdma_qp_hwq_info {
231231
u32 entry_size;
232232
u32 max_cnt;
233233
u32 max_wqe_idx;
234-
u32 free_delta;
235234
u16 dbid; /* qid, where to ring the doorbell. */
236235
u32 len;
237236
dma_addr_t pa;

drivers/infiniband/hw/ocrdma/ocrdma_abi.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ struct ocrdma_create_qp_uresp {
101101
u32 rsvd1;
102102
u32 num_wqe_allocated;
103103
u32 num_rqe_allocated;
104-
u32 free_wqe_delta;
105-
u32 free_rqe_delta;
106104
u32 db_sq_offset;
107105
u32 db_rq_offset;
108106
u32 db_shift;
@@ -126,8 +124,7 @@ struct ocrdma_create_srq_uresp {
126124
u32 db_rq_offset;
127125
u32 db_shift;
128126

129-
u32 free_rqe_delta;
130-
u32 rsvd2;
127+
u64 rsvd2;
131128
u64 rsvd3;
132129
} __packed;
133130

drivers/infiniband/hw/ocrdma/ocrdma_hw.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1990,19 +1990,12 @@ static void ocrdma_get_create_qp_rsp(struct ocrdma_create_qp_rsp *rsp,
19901990
max_wqe_allocated = 1 << max_wqe_allocated;
19911991
max_rqe_allocated = 1 << ((u16)rsp->max_wqe_rqe);
19921992

1993-
if (qp->dev->nic_info.dev_family == OCRDMA_GEN2_FAMILY) {
1994-
qp->sq.free_delta = 0;
1995-
qp->rq.free_delta = 1;
1996-
} else
1997-
qp->sq.free_delta = 1;
1998-
19991993
qp->sq.max_cnt = max_wqe_allocated;
20001994
qp->sq.max_wqe_idx = max_wqe_allocated - 1;
20011995

20021996
if (!attrs->srq) {
20031997
qp->rq.max_cnt = max_rqe_allocated;
20041998
qp->rq.max_wqe_idx = max_rqe_allocated - 1;
2005-
qp->rq.free_delta = 1;
20061999
}
20072000
}
20082001

drivers/infiniband/hw/ocrdma/ocrdma_verbs.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -940,8 +940,6 @@ static int ocrdma_copy_qp_uresp(struct ocrdma_qp *qp,
940940
uresp.db_rq_offset = OCRDMA_DB_RQ_OFFSET;
941941
uresp.db_shift = 16;
942942
}
943-
uresp.free_wqe_delta = qp->sq.free_delta;
944-
uresp.free_rqe_delta = qp->rq.free_delta;
945943

946944
if (qp->dpp_enabled) {
947945
uresp.dpp_credit = dpp_credit_lmt;
@@ -1307,8 +1305,6 @@ static int ocrdma_hwq_free_cnt(struct ocrdma_qp_hwq_info *q)
13071305
free_cnt = (q->max_cnt - q->head) + q->tail;
13081306
else
13091307
free_cnt = q->tail - q->head;
1310-
if (q->free_delta)
1311-
free_cnt -= q->free_delta;
13121308
return free_cnt;
13131309
}
13141310

@@ -1501,7 +1497,6 @@ static int ocrdma_copy_srq_uresp(struct ocrdma_srq *srq, struct ib_udata *udata)
15011497
(srq->pd->id * srq->dev->nic_info.db_page_size);
15021498
uresp.db_page_size = srq->dev->nic_info.db_page_size;
15031499
uresp.num_rqe_allocated = srq->rq.max_cnt;
1504-
uresp.free_rqe_delta = 1;
15051500
if (srq->dev->nic_info.dev_family == OCRDMA_GEN2_FAMILY) {
15061501
uresp.db_rq_offset = OCRDMA_DB_GEN2_RQ1_OFFSET;
15071502
uresp.db_shift = 24;

0 commit comments

Comments
 (0)