]> git.baikalelectronics.ru Git - kernel.git/commit
qed: Free RoCE ILT Memory on rmmod qedr
authorMichal Kalderon <Michal.Kalderon@cavium.com>
Mon, 5 Mar 2018 21:50:46 +0000 (23:50 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 7 Mar 2018 17:17:31 +0000 (12:17 -0500)
commit9d42b27da2c788ec2d82aee39a75d4daf0d7086f
treef2efe785ab2c173a3ed399da61ac50f8bcbf3697
parent34396826b17d2e48309c5314df79c70e2c2c8b1d
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: 2d18cd50e627 ("qed: Initialize hardware for new protocols")
Signed-off-by: Michal Kalderon <Michal.Kalderon@cavium.com>
Signed-off-by: Ariel Elior <Ariel.Elior@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qed/qed_cxt.c
drivers/net/ethernet/qlogic/qed/qed_rdma.c