Skip to contentSkip to conversation

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

PATCH In review Zhu Yanjun 2 participants 3 messages Mar 6, 2021 – Mar 24, 2021 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Zhu Yanjun

author maintainer
#1 lore raw

PATCH v2 1/1 RDMA/rxe: Disable ipv6 features when ipv6.disable set 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.

Fixes 8700e3e7c4857 ("Soft RoCE driver")

---
V1->V2: Modify the pr_info messages

---
 drivers/infiniband/sw/rxe/rxe_net.c | 9 +++++++++
 1 file changed, 9 insertions(+)
(quoted diff) +0 -0

b/drivers/infiniband/sw/rxe/rxe_net.c
index 0701bd1ffd1a..6ef092cb575e 100644

drivers/infiniband/sw/rxe/rxe_net.c +0 -0
@@ -72,6 +72,11 @@ static struct dst_entry *rxe_find_route6(struct

net_device *ndev,

        struct dst_entry *ndst;
        struct flowi6 fl6 = { { 0 } };

+ if (!ipv6_mod_enabled()) {
+ pr_info("IPv6 is disabled");
+ return NULL;
+ }
+

        memset(&fl6, 0, sizeof(fl6));
        fl6.flowi6_oif = ndev->ifindex;
        memcpy(&fl6.saddr, saddr, sizeof(*saddr));

@@ -608,6 +613,10 @@ static int rxe_net_ipv4_init(void)
static int rxe_net_ipv6_init(void)
{
#if IS_ENABLED(CONFIG_IPV6)
+ if (!ipv6_mod_enabled()) {
+ pr_info("IPv6 is disabled");
+ return 0;
+ }

recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net,
htons(ROCE_V2_UDP_DPORT), true);
--
2.25.1

maintainer
#2 lore raw
Quoted 20 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.

Fixes 8700e3e7c4857 ("Soft RoCE driver")

V1->V2: Modify the pr_info messages

 drivers/infiniband/sw/rxe/rxe_net.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/infiniband/sw/rxe/rxe_net.c +1 -0
index 0701bd1ffd1a..6ef092cb575e 100644
+++ b/drivers/infiniband/sw/rxe/rxe_net.c

drivers/infiniband/sw/rxe/rxe_net.c static struct dst_entry *rxe_find_route6(struct · line 79

Quoted 8 lines
drivers/infiniband/sw/rxe/rxe_net.c +4 -0
@@ -72,6 +72,11 @@ static struct dst_entry *rxe_find_route6(struct
 net_device *ndev,
        struct dst_entry *ndst;
        struct flowi6 fl6 = { { 0 } };
 
+       if (!ipv6_mod_enabled()) {
+               pr_info("IPv6 is disabled");
+               return NULL;
+       }

Why doesn't a similar touch of ipv6_stub in drivers/infiniband/core/addr.c need a similar protection?

Also do not print.

Jason

author maintainer
#3 lore raw
Quoted 26 lines · Jason Gunthorpe
Quoted 24 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.

Fixes 8700e3e7c4857 ("Soft RoCE driver")

V1->V2: Modify the pr_info messages

 drivers/infiniband/sw/rxe/rxe_net.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/infiniband/sw/rxe/rxe_net.c +1 -0
index 0701bd1ffd1a..6ef092cb575e 100644
+++ b/drivers/infiniband/sw/rxe/rxe_net.c
@@ -72,6 +72,11 @@ static struct dst_entry *rxe_find_route6(struct
 net_device *ndev,
        struct dst_entry *ndst;
        struct flowi6 fl6 = { { 0 } };
 
Quoted 7 lines

drivers/infiniband/sw/rxe/rxe_net.c static struct dst_entry *rxe_find_route6(struct · line 79

Quoted 4 lines
drivers/infiniband/sw/rxe/rxe_net.c +4 -0
+       if (!ipv6_mod_enabled()) {
+               pr_info("IPv6 is disabled");
+               return NULL;
+       }

Why doesn't a similar touch of ipv6_stub in drivers/infiniband/core/addr.c need a similar protection?

Got it. This patch is for RXE.

I will make a similar commit of ipv6_stub in
drivers/infiniband/core/addr.c soon.

Quoted 2 lines

Also do not print.

I will remove print in the next patch.

Zhu Yanjun

Quoted 2 lines

Jason