Skip to contentSkip to conversation

RDMA/rxe: Disable ipv6 features when ipv6.disable in cmdline

PATCH Superseded Zhu Yanjun 4 participants 4 messages Apr 11, 2021 – Apr 13, 2021

Subsystems (2)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Zhu Yanjun

author
#0 lore raw

PATCH v4 1/1 RDMA/rxe: Disable ipv6 features when ipv6.disable in cmdline

From: Zhu Yanjun <[email protected]>

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.

---
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(+)
drivers/infiniband/sw/rxe/rxe_net.c +5 -0
index 01662727dca0..b12137257af7 100644
@@ -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;
Signature · 1 line
2.27.0
maintainer
#1 lore raw
Quoted 6 lines · Zhu Yanjun

From: Zhu Yanjun <[email protected]>

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.

Quoted 6 lines

Is this signature block accurate? I'm pretty sure Leon didn't look at this version of the patch.

Did Yi test this version, or is this leftover from a prior version?

Quoted 3 lines

---
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.

Who is Jason?

drivers/infiniband/sw/rxe/rxe_net.c static int rxe_net_ipv6_init(void) · line 626

Quoted 12 lines
drivers/infiniband/sw/rxe/rxe_net.c +4 -0
index 01662727dca0..b12137257af7 100644
@@ -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;

At least this looks OK to me and the original report certainly said the error was EAFNOSUPPORT

Please clarify what is going on with the signature block

Jason

maintainer
#2 lore raw
Quoted 14 lines · Jason Gunthorpe
Quoted 6 lines · Zhu Yanjun

From: Zhu Yanjun <[email protected]>

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.

Quoted 6 lines
Quoted 2 lines

Is this signature block accurate? I'm pretty sure Leon didn't look at this version of the patch.

Yes, I didn't look.

Quoted 9 lines

Did Yi test this version, or is this leftover from a prior version?

Quoted 3 lines

---
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.

Who is Jason?

Quoted 15 lines

drivers/infiniband/sw/rxe/rxe_net.c static int rxe_net_ipv6_init(void) · line 626

Quoted 12 lines
drivers/infiniband/sw/rxe/rxe_net.c +4 -0
index 01662727dca0..b12137257af7 100644
@@ -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;

At least this looks OK to me and the original report certainly said the error was EAFNOSUPPORT

The failure can be received only if udp_sock_create() fails in the rxe_setup_udp_tunnel(). It will print an error despite us not want this.

Quoted 2 lines

Please clarify what is going on with the signature block

And fix error print.

Thanks

Quoted 2 lines

Jason

maintainer
#3 lore raw
Quoted 16 lines · Leon Romanovsky
Quoted 14 lines · Jason Gunthorpe
Quoted 12 lines · Zhu Yanjun

From: Zhu Yanjun <[email protected]>

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.

Quoted 4 lines
Quoted 2 lines

Is this signature block accurate? I'm pretty sure Leon didn't look at this version of the patch.

Yes, I didn't look.

Sorry. This signature block is from the prior version. I will fix it.

Quoted 26 lines
Quoted 10 lines

Did Yi test this version, or is this leftover from a prior version?

Quoted 3 lines

---
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.

Who is Jason?

Quoted 15 lines

drivers/infiniband/sw/rxe/rxe_net.c static int rxe_net_ipv6_init(void) · line 626

Quoted 12 lines
drivers/infiniband/sw/rxe/rxe_net.c +4 -0
index 01662727dca0..b12137257af7 100644
@@ -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;

At least this looks OK to me and the original report certainly said the error was EAFNOSUPPORT

Quoted 7 lines

The failure can be received only if udp_sock_create() fails in the rxe_setup_udp_tunnel(). It will print an error despite us not want this.

Quoted 2 lines

Please clarify what is going on with the signature block

And fix error print.

Got it. I will fix the signature block and error print.

Zhu Yanjun

Quoted 5 lines

Thanks

Quoted 2 lines

Jason