From: Qing Huang Date: Tue, 6 Oct 2015 22:32:22 +0000 (-0700) Subject: net/rds: start rdma listening after ib/iw initialization is done X-Git-Tag: v4.1.12-92~240^2~4^2~1^2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=859da98aaa0591b0f4d871b7da78f82d5ed34b38;p=users%2Fjedix%2Flinux-maple.git net/rds: start rdma listening after ib/iw initialization is done This prevents RDS from handling incoming rdma packets before RDS completes initializing its recv/send components. We don't need to call rds_rdma_listen_stop() if rds_rdma_listen_init() didn't succeed. We only need to call rds_ib_exit() if rds_ib_init() succeeds but other parts fail. The same applies to rds_iw_init()/rds_iw_exit(). So we need to change error handling sequence accordingly. Jump to ib/iw error handling path when we get an err code from rds_rdma_listen_init(). Orabug: 21684447 Acked-by: Santosh Shilimkar Reviewed-by: Ajaykumar Hotchandani Signed-off-by: Qing Huang Signed-off-by: Mukesh Kacker --- diff --git a/net/rds/rdma_transport.c b/net/rds/rdma_transport.c index e8c175d14d7ea..b5c4834c4385c 100644 --- a/net/rds/rdma_transport.c +++ b/net/rds/rdma_transport.c @@ -447,18 +447,18 @@ int rds_rdma_init(void) { int ret; - ret = rds_rdma_listen_init(); - if (ret) - goto out; - ret = rds_iw_init(); if (ret) - goto err_iw_init; + goto out; ret = rds_ib_init(); if (ret) goto err_ib_init; + ret = rds_rdma_listen_init(); + if (ret) + goto err_rdma_listen_init; + if (!unload_allowed) { printk(KERN_NOTICE "Module %s locked in memory until next boot\n", MODULE_NAME); @@ -467,11 +467,18 @@ int rds_rdma_init(void) goto out; +err_rdma_listen_init: + /* We need to clean up both ib and iw components. */ + rds_ib_exit(); err_ib_init: + /* Only rds_iw_init() completes at this point, so we don't have to + * do anything with rds_ib_exit(). + */ rds_iw_exit(); -err_iw_init: - rds_rdma_listen_stop(); out: + /* Either nothing is done successfully or everything succeeds at + * this point. + */ return ret; } module_init(rds_rdma_init);