* [PATCH V3 net] qed: Free RoCE ILT Memory on rmmod qedr
@ 2018-03-05 21:50 Michal Kalderon
2018-03-07 17:17 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Michal Kalderon @ 2018-03-05 21:50 UTC (permalink / raw)
To: michal.kalderon, davem
Cc: netdev, dledford, jgg, linux-rdma, Michal Kalderon, Ariel Elior
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: dbb799c39717 ("qed: Initialize hardware for new protocols")
Signed-off-by: Michal Kalderon <Michal.Kalderon@cavium.com>
Signed-off-by: Ariel Elior <Ariel.Elior@cavium.com>
---
Difference from V2:
Fixed Broken parenthesis In comment
---
drivers/net/ethernet/qlogic/qed/qed_cxt.c | 5 ++++-
drivers/net/ethernet/qlogic/qed/qed_rdma.c | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/qlogic/qed/qed_cxt.c b/drivers/net/ethernet/qlogic/qed/qed_cxt.c
index 6f546e8..b6f55bc 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_cxt.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_cxt.c
@@ -2480,7 +2480,10 @@ int qed_cxt_free_proto_ilt(struct qed_hwfn *p_hwfn, enum protocol_type proto)
if (rc)
return rc;
- /* Free Task CXT */
+ /* Free Task CXT ( Intentionally RoCE as task-id is shared between
+ * RoCE and iWARP )
+ */
+ proto = PROTOCOLID_ROCE;
rc = qed_cxt_free_ilt_range(p_hwfn, QED_ELEM_TASK, 0,
qed_cxt_get_proto_tid_count(p_hwfn, proto));
if (rc)
diff --git a/drivers/net/ethernet/qlogic/qed/qed_rdma.c b/drivers/net/ethernet/qlogic/qed/qed_rdma.c
index 5d040b8..f3ee653 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_rdma.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_rdma.c
@@ -380,6 +380,7 @@ static void qed_rdma_free(struct qed_hwfn *p_hwfn)
qed_rdma_free_reserved_lkey(p_hwfn);
qed_rdma_resc_free(p_hwfn);
+ qed_cxt_free_proto_ilt(p_hwfn, p_hwfn->p_rdma_info->proto);
}
static void qed_rdma_get_guid(struct qed_hwfn *p_hwfn, u8 *guid)
--
2.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH V3 net] qed: Free RoCE ILT Memory on rmmod qedr
2018-03-05 21:50 [PATCH V3 net] qed: Free RoCE ILT Memory on rmmod qedr Michal Kalderon
@ 2018-03-07 17:17 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-03-07 17:17 UTC (permalink / raw)
To: Michal.Kalderon; +Cc: netdev, dledford, jgg, linux-rdma, Ariel.Elior
From: Michal Kalderon <Michal.Kalderon@cavium.com>
Date: Mon, 5 Mar 2018 23:50:46 +0200
> 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: dbb799c39717 ("qed: Initialize hardware for new protocols")
>
> Signed-off-by: Michal Kalderon <Michal.Kalderon@cavium.com>
> Signed-off-by: Ariel Elior <Ariel.Elior@cavium.com>
Please do not put an empty line in between a Fixes: tag and the
others. They are all tags, and should be grouped together.
> ---
> Difference from V2:
>
> Fixed Broken parenthesis In comment
Applied, thank you.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-03-07 17:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-05 21:50 [PATCH V3 net] qed: Free RoCE ILT Memory on rmmod qedr Michal Kalderon
2018-03-07 17:17 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).