Skip to content

Commit 6d02e51

Browse files
GoKu-Gear6SantoshShilimkar
authored andcommitted
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 <[email protected]> Reviewed-by: Ajaykumar Hotchandani <[email protected]> Signed-off-by: Qing Huang <[email protected]> Signed-off-by: Mukesh Kacker <[email protected]>
1 parent c79f25a commit 6d02e51

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

net/rds/rdma_transport.c

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -447,18 +447,18 @@ int rds_rdma_init(void)
447447
{
448448
int ret;
449449

450-
ret = rds_rdma_listen_init();
451-
if (ret)
452-
goto out;
453-
454450
ret = rds_iw_init();
455451
if (ret)
456-
goto err_iw_init;
452+
goto out;
457453

458454
ret = rds_ib_init();
459455
if (ret)
460456
goto err_ib_init;
461457

458+
ret = rds_rdma_listen_init();
459+
if (ret)
460+
goto err_rdma_listen_init;
461+
462462
if (!unload_allowed) {
463463
printk(KERN_NOTICE "Module %s locked in memory until next boot\n",
464464
MODULE_NAME);
@@ -467,11 +467,18 @@ int rds_rdma_init(void)
467467

468468
goto out;
469469

470+
err_rdma_listen_init:
471+
/* We need to clean up both ib and iw components. */
472+
rds_ib_exit();
470473
err_ib_init:
474+
/* Only rds_iw_init() completes at this point, so we don't have to
475+
* do anything with rds_ib_exit().
476+
*/
471477
rds_iw_exit();
472-
err_iw_init:
473-
rds_rdma_listen_stop();
474478
out:
479+
/* Either nothing is done successfully or everything succeeds at
480+
* this point.
481+
*/
475482
return ret;
476483
}
477484
module_init(rds_rdma_init);

0 commit comments

Comments
 (0)