Skip to content

Commit 9de506a

Browse files
mkalderondavem330
authored andcommitted
qed: Free RoCE ILT Memory on rmmod qedr
Rdma requires ILT Memory to be allocated for it's QPs. Each ILT entry points to a page used by several Rdma QPs. To avoid allocating all the memory in advance, the rdma implementation dynamically allocates memory as more QPs are added, however it does not dynamically free the memory. The memory should have been freed on rmmod qedr, but isn't. This patch adds the memory freeing on rmmod qedr (currently it will be freed with qed is removed). An outcome of this bug, is that if qedr is unloaded and loaded without unloaded qed, there will be no more RoCE traffic. The reason these are related, is that the logic of detecting the first QP ever opened is by asking whether ILT memory for RoCE has been allocated. In addition, this patch modifies freeing of the Task context to always use the PROTOCOLID_ROCE and not the protocol passed, this is because task context for iWARP and ROCE both use the ROCE protocol id, as opposed to the connection context. Fixes: dbb799c ("qed: Initialize hardware for new protocols") Signed-off-by: Michal Kalderon <[email protected]> Signed-off-by: Ariel Elior <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 87772fe commit 9de506a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2480,7 +2480,10 @@ int qed_cxt_free_proto_ilt(struct qed_hwfn *p_hwfn, enum protocol_type proto)
24802480
if (rc)
24812481
return rc;
24822482

2483-
/* Free Task CXT */
2483+
/* Free Task CXT ( Intentionally RoCE as task-id is shared between
2484+
* RoCE and iWARP )
2485+
*/
2486+
proto = PROTOCOLID_ROCE;
24842487
rc = qed_cxt_free_ilt_range(p_hwfn, QED_ELEM_TASK, 0,
24852488
qed_cxt_get_proto_tid_count(p_hwfn, proto));
24862489
if (rc)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ static void qed_rdma_free(struct qed_hwfn *p_hwfn)
380380

381381
qed_rdma_free_reserved_lkey(p_hwfn);
382382
qed_rdma_resc_free(p_hwfn);
383+
qed_cxt_free_proto_ilt(p_hwfn, p_hwfn->p_rdma_info->proto);
383384
}
384385

385386
static void qed_rdma_get_guid(struct qed_hwfn *p_hwfn, u8 *guid)

0 commit comments

Comments
 (0)