diff options
author | Faisal Latif <faisal.latif@intel.com> | 2009-12-10 00:54:28 +0100 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2009-12-10 00:54:28 +0100 |
commit | d2fa9b26e181d1e3c3df06a57fa13b04afee0e16 (patch) | |
tree | dfac5f80c0a1b0e1ef38a1a6580b7faaf5f1f348 /drivers/infiniband/hw/nes/nes_cm.c | |
parent | RDMA/nes: Check for zero STag (diff) | |
download | linux-d2fa9b26e181d1e3c3df06a57fa13b04afee0e16.tar.xz linux-d2fa9b26e181d1e3c3df06a57fa13b04afee0e16.zip |
RDMA/nes: Free kmap() resources
We fail when creating many qps as kmap() fails for sq_vbase.
Fix this by doing kunmap() as soon as we are done with sq_vbase.
We do kunmap() in one of the locations below:
(1) nes_destroy_qp()
(2) nes_accept()
(3) nes_connect_event
We keep a flag to avoid multiple calls to kunmap().
Signed-off-by: Faisal Latif <faisal.latif@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/nes/nes_cm.c')
-rw-r--r-- | drivers/infiniband/hw/nes/nes_cm.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c index a25816812ced..b139806a9667 100644 --- a/drivers/infiniband/hw/nes/nes_cm.c +++ b/drivers/infiniband/hw/nes/nes_cm.c @@ -52,6 +52,7 @@ #include <linux/random.h> #include <linux/list.h> #include <linux/threads.h> +#include <linux/highmem.h> #include <net/arp.h> #include <net/neighbour.h> #include <net/route.h> @@ -2836,6 +2837,10 @@ int nes_accept(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) cpu_to_le32(conn_param->private_data_len + sizeof(struct ietf_mpa_frame)); wqe->wqe_words[NES_IWARP_SQ_WQE_STAG0_IDX] = ibmr->lkey; + if (nesqp->sq_kmapped) { + nesqp->sq_kmapped = 0; + kunmap(nesqp->page); + } nesqp->nesqp_context->ird_ord_sizes |= cpu_to_le32(NES_QPCONTEXT_ORDIRD_LSMM_PRESENT | @@ -3304,6 +3309,11 @@ static void cm_event_connected(struct nes_cm_event *event) wqe->wqe_words[NES_IWARP_SQ_WQE_LENGTH0_IDX] = 0; wqe->wqe_words[NES_IWARP_SQ_WQE_STAG0_IDX] = 0; + if (nesqp->sq_kmapped) { + nesqp->sq_kmapped = 0; + kunmap(nesqp->page); + } + /* use the reserved spot on the WQ for the extra first WQE */ nesqp->nesqp_context->ird_ord_sizes &= cpu_to_le32(~(NES_QPCONTEXT_ORDIRD_LSMM_PRESENT | |