Commit 46c1376d authored by Steve Wise's avatar Steve Wise Committed by Roland Dreier

RDMA/cxgb4: Call iwpm_init() only once

We need to only register with the iwpm core once.  Currently it is
being done for every adapter, which causes a failure for each adapter
but the first, making multiple adapters unusable.

Fixes: 9eccfe10 ("RDMA/cxgb4: Add support for iWARP Port Mapper user space service")
Signed-off-by: default avatarSteve Wise <swise@opengridcomputing.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent 6b54d54d
...@@ -3925,7 +3925,7 @@ int __init c4iw_cm_init(void) ...@@ -3925,7 +3925,7 @@ int __init c4iw_cm_init(void)
return 0; return 0;
} }
void __exit c4iw_cm_term(void) void c4iw_cm_term(void)
{ {
WARN_ON(!list_empty(&timeout_list)); WARN_ON(!list_empty(&timeout_list));
flush_workqueue(workq); flush_workqueue(workq);
......
...@@ -730,7 +730,6 @@ static void c4iw_dealloc(struct uld_ctx *ctx) ...@@ -730,7 +730,6 @@ static void c4iw_dealloc(struct uld_ctx *ctx)
if (ctx->dev->rdev.oc_mw_kva) if (ctx->dev->rdev.oc_mw_kva)
iounmap(ctx->dev->rdev.oc_mw_kva); iounmap(ctx->dev->rdev.oc_mw_kva);
ib_dealloc_device(&ctx->dev->ibdev); ib_dealloc_device(&ctx->dev->ibdev);
iwpm_exit(RDMA_NL_C4IW);
ctx->dev = NULL; ctx->dev = NULL;
} }
...@@ -827,12 +826,6 @@ static struct c4iw_dev *c4iw_alloc(const struct cxgb4_lld_info *infop) ...@@ -827,12 +826,6 @@ static struct c4iw_dev *c4iw_alloc(const struct cxgb4_lld_info *infop)
setup_debugfs(devp); setup_debugfs(devp);
} }
ret = iwpm_init(RDMA_NL_C4IW);
if (ret) {
pr_err("port mapper initialization failed with %d\n", ret);
ib_dealloc_device(&devp->ibdev);
return ERR_PTR(ret);
}
return devp; return devp;
} }
...@@ -1333,6 +1326,15 @@ static int __init c4iw_init_module(void) ...@@ -1333,6 +1326,15 @@ static int __init c4iw_init_module(void)
pr_err("%s[%u]: Failed to add netlink callback\n" pr_err("%s[%u]: Failed to add netlink callback\n"
, __func__, __LINE__); , __func__, __LINE__);
err = iwpm_init(RDMA_NL_C4IW);
if (err) {
pr_err("port mapper initialization failed with %d\n", err);
ibnl_remove_client(RDMA_NL_C4IW);
c4iw_cm_term();
debugfs_remove_recursive(c4iw_debugfs_root);
return err;
}
cxgb4_register_uld(CXGB4_ULD_RDMA, &c4iw_uld_info); cxgb4_register_uld(CXGB4_ULD_RDMA, &c4iw_uld_info);
return 0; return 0;
...@@ -1350,6 +1352,7 @@ static void __exit c4iw_exit_module(void) ...@@ -1350,6 +1352,7 @@ static void __exit c4iw_exit_module(void)
} }
mutex_unlock(&dev_mutex); mutex_unlock(&dev_mutex);
cxgb4_unregister_uld(CXGB4_ULD_RDMA); cxgb4_unregister_uld(CXGB4_ULD_RDMA);
iwpm_exit(RDMA_NL_C4IW);
ibnl_remove_client(RDMA_NL_C4IW); ibnl_remove_client(RDMA_NL_C4IW);
c4iw_cm_term(); c4iw_cm_term();
debugfs_remove_recursive(c4iw_debugfs_root); debugfs_remove_recursive(c4iw_debugfs_root);
......
...@@ -908,7 +908,7 @@ int c4iw_destroy_ctrl_qp(struct c4iw_rdev *rdev); ...@@ -908,7 +908,7 @@ int c4iw_destroy_ctrl_qp(struct c4iw_rdev *rdev);
int c4iw_register_device(struct c4iw_dev *dev); int c4iw_register_device(struct c4iw_dev *dev);
void c4iw_unregister_device(struct c4iw_dev *dev); void c4iw_unregister_device(struct c4iw_dev *dev);
int __init c4iw_cm_init(void); int __init c4iw_cm_init(void);
void __exit c4iw_cm_term(void); void c4iw_cm_term(void);
void c4iw_release_dev_ucontext(struct c4iw_rdev *rdev, void c4iw_release_dev_ucontext(struct c4iw_rdev *rdev,
struct c4iw_dev_ucontext *uctx); struct c4iw_dev_ucontext *uctx);
void c4iw_init_dev_ucontext(struct c4iw_rdev *rdev, void c4iw_init_dev_ucontext(struct c4iw_rdev *rdev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment