Message ID | 20230624073927.707915-2-yanjun.zhu@intel.com (mailing list archive) |
---|---|
State | Changes Requested |
Headers | show |
Series | Fix the problem that rxe can not work in net | expand |
diff --git a/drivers/infiniband/sw/rxe/rxe.c b/drivers/infiniband/sw/rxe/rxe.c index 7a7e713de52d..89b24bc34299 100644 --- a/drivers/infiniband/sw/rxe/rxe.c +++ b/drivers/infiniband/sw/rxe/rxe.c @@ -194,6 +194,10 @@ static int rxe_newlink(const char *ibdev_name, struct net_device *ndev) goto err; } + err = rxe_net_init(); + if (err) + return err; + err = rxe_net_add(ibdev_name, ndev); if (err) { rxe_err("failed to add %s\n", ndev->name); @@ -210,12 +214,6 @@ static struct rdma_link_ops rxe_link_ops = { static int __init rxe_module_init(void) { - int err; - - err = rxe_net_init(); - if (err) - return err; - rdma_link_register(&rxe_link_ops); pr_info("loaded\n"); return 0;