From: Zhu Yanjun <zyjzyj2000@xxxxxxxxx> When ipv6.disable=1 is set in cmdline, ipv6 is actually disabled in the stack. As such, the operations of ipv6 in RXE will fail. So ipv6 features in RXE should also be disabled in RXE. Link: https://lore.kernel.org/linux-rdma/880d7b59-4b17-a44f-1a91-88257bfc3aaa@xxxxxxxxxx/T/#t Fixes: 8700e3e7c4857 ("Soft RoCE driver") Reported-by: Yi Zhang <yi.zhang@xxxxxxxxxx> Signed-off-by: Zhu Yanjun <zyjzyj2000@xxxxxxxxx> Reviewed-by: Leon Romanovsky <leonro@xxxxxxxxxx> Tested-by: Yi Zhang <yi.zhang@xxxxxxxxxx> --- V3->V4: I do not know how to reproduce Jason's problem. So I just ignore the -EAFNOSUPPORT error. Hope this can fix Jason's problem. V2->V3: Remove print message V1->V2: Modify the pr_info messages --- drivers/infiniband/sw/rxe/rxe_net.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c index 01662727dca0..b12137257af7 100644 --- a/drivers/infiniband/sw/rxe/rxe_net.c +++ b/drivers/infiniband/sw/rxe/rxe_net.c @@ -620,6 +620,11 @@ static int rxe_net_ipv6_init(void) recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net, htons(ROCE_V2_UDP_DPORT), true); if (IS_ERR(recv_sockets.sk6)) { + /* Though IPv6 is not supported, IPv4 still needs to continue + */ + if (PTR_ERR(recv_sockets.sk6) == -EAFNOSUPPORT) + return 0; + recv_sockets.sk6 = NULL; pr_err("Failed to create IPv6 UDP tunnel\n"); return -1; -- 2.27.0