Message ID | 1438243595-32288-12-git-send-email-sagig@mellanox.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
On Thu, Jul 30, 2015 at 11:06 AM, Sagi Grimberg <sagig@mellanox.com> wrote: > 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. AFAIK, the ENOSYS flow was something that came into play when working e.g over VF drivers such as mlx4 that don't support fmr-ing but we still wanted an optimal performance. What does "this is not the case anymore" means? these VF drivers are still out there. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 7/30/2015 1:31 PM, Or Gerlitz wrote: > On Thu, Jul 30, 2015 at 11:06 AM, Sagi Grimberg <sagig@mellanox.com> wrote: >> 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. > > AFAIK, the ENOSYS flow was something that came into play when working > e.g over VF drivers such as mlx4 that don't support fmr-ing but we still wanted > an optimal performance. What does "this is not the case anymore" means? these > VF drivers are still out there. Today, iser is not usable with no FRWR and no FMR support. (it once was when we bounced to higher-order allocations but we don't do that anymore). Memory registration is a requirement support for iser today. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Thu, Jul 30, 2015 at 3:23 PM, Sagi Grimberg <sagig@dev.mellanox.co.il> wrote: > Today, iser is not usable with no FRWR and no FMR support. (it once was > when we bounced to higher-order allocations but we don't do that > anymore). Memory registration is a requirement support for iser today. OK, sure, we now have FRWR support, back then we didn't -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c index f7828e3..2a0cb42 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, ¶ms); - 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);
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> --- drivers/infiniband/ulp/iser/iser_verbs.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-)