Skip to content

Commit 471115a

Browse files
mkalderondavem330
authored andcommitted
qed: Fix maximum number of CQs for iWARP
The maximum number of CQs supported is bound to the number of connections supported, which differs between RoCE and iWARP. This fixes a crash that occurred in iWARP when running 1000 sessions using perftest. Fixes: 67b40dc ("qed: Implement iWARP initialization, teardown and qp operations") Signed-off-by: Michal Kalderon <[email protected]> Signed-off-by: Ariel Elior <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d1abfd0 commit 471115a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/net/ethernet/qlogic/qed/qed_rdma.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,11 @@ static int qed_rdma_alloc(struct qed_hwfn *p_hwfn,
209209
goto free_pd_map;
210210
}
211211

212-
/* Allocate bitmap for cq's. The maximum number of CQs is bounded to
213-
* twice the number of QPs.
212+
/* Allocate bitmap for cq's. The maximum number of CQs is bound to
213+
* the number of connections we support. (num_qps in iWARP or
214+
* num_qps/2 in RoCE).
214215
*/
215-
rc = qed_rdma_bmap_alloc(p_hwfn, &p_rdma_info->cq_map,
216-
p_rdma_info->num_qps * 2, "CQ");
216+
rc = qed_rdma_bmap_alloc(p_hwfn, &p_rdma_info->cq_map, num_cons, "CQ");
217217
if (rc) {
218218
DP_VERBOSE(p_hwfn, QED_MSG_RDMA,
219219
"Failed to allocate cq bitmap, rc = %d\n", rc);
@@ -222,10 +222,10 @@ static int qed_rdma_alloc(struct qed_hwfn *p_hwfn,
222222

223223
/* Allocate bitmap for toggle bit for cq icids
224224
* We toggle the bit every time we create or resize cq for a given icid.
225-
* The maximum number of CQs is bounded to twice the number of QPs.
225+
* Size needs to equal the size of the cq bmap.
226226
*/
227227
rc = qed_rdma_bmap_alloc(p_hwfn, &p_rdma_info->toggle_bits,
228-
p_rdma_info->num_qps * 2, "Toggle");
228+
num_cons, "Toggle");
229229
if (rc) {
230230
DP_VERBOSE(p_hwfn, QED_MSG_RDMA,
231231
"Failed to allocate toogle bits, rc = %d\n", rc);

0 commit comments

Comments
 (0)