summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp
diff options
context:
space:
mode:
authorSagi Grimberg <sagig@mellanox.com>2015-08-06 18:32:55 +0300
committerDoug Ledford <dledford@redhat.com>2015-08-30 18:12:29 -0400
commit8c18ed03a95cb6c3543b0a9e0df5e9366baea5df (patch)
treeb5763e29d7658d495309083e0dc2768a1b6f1e28 /drivers/infiniband/ulp
parent5190cc2664972f2c51502e928fcb7a608dddab5f (diff)
downloadtalos-op-linux-8c18ed03a95cb6c3543b0a9e0df5e9366baea5df.tar.gz
talos-op-linux-8c18ed03a95cb6c3543b0a9e0df5e9366baea5df.zip
IB/iser: Remove dead code in fmr_pool alloc/free
In the past the we always tried to allocate an fmr_pool and if it failed on ENOSYS (not supported) then we continued with dma mr. This is not the case anymore and if we tried to allocate an fmr_pool then it is supported and we expect to succeed. Also, the check if fmr_pool is allocated when free is called is redundant as well as we are guaranteed it exists. Signed-off-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/ulp')
-rw-r--r--drivers/infiniband/ulp/iser/iser_verbs.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c
index e4f89676248c..adec4d743861 100644
--- a/drivers/infiniband/ulp/iser/iser_verbs.c
+++ b/drivers/infiniband/ulp/iser/iser_verbs.c
@@ -244,22 +244,18 @@ int iser_create_fmr_pool(struct ib_conn *ib_conn, unsigned cmds_max)
IB_ACCESS_REMOTE_READ);
ib_conn->fmr.pool = ib_create_fmr_pool(device->pd, &params);
- if (!IS_ERR(ib_conn->fmr.pool))
- return 0;
+ if (IS_ERR(ib_conn->fmr.pool)) {
+ ret = PTR_ERR(ib_conn->fmr.pool);
+ iser_err("FMR allocation failed, err %d\n", ret);
+ goto err;
+ }
+
+ return 0;
- /* no FMR => no need for page_vec */
+err:
kfree(ib_conn->fmr.page_vec);
ib_conn->fmr.page_vec = NULL;
-
- ret = PTR_ERR(ib_conn->fmr.pool);
- ib_conn->fmr.pool = NULL;
- if (ret != -ENOSYS) {
- iser_err("FMR allocation failed, err %d\n", ret);
- return ret;
- } else {
- iser_warn("FMRs are not supported, using unaligned mode\n");
- return 0;
- }
+ return ret;
}
/**
@@ -270,9 +266,7 @@ void iser_free_fmr_pool(struct ib_conn *ib_conn)
iser_info("freeing conn %p fmr pool %p\n",
ib_conn, ib_conn->fmr.pool);
- if (ib_conn->fmr.pool != NULL)
- ib_destroy_fmr_pool(ib_conn->fmr.pool);
-
+ ib_destroy_fmr_pool(ib_conn->fmr.pool);
ib_conn->fmr.pool = NULL;
kfree(ib_conn->fmr.page_vec);
OpenPOWER on IntegriCloud