On Thu, Mar 25, 2021 at 09:27:23PM -0400, Zhu Yanjun wrote: > 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. > > 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> > 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..3b8ed007e8af 100644 > +++ b/drivers/infiniband/sw/rxe/rxe_net.c > @@ -72,6 +72,9 @@ static struct dst_entry *rxe_find_route6(struct net_device *ndev, > struct dst_entry *ndst; > struct flowi6 fl6 = { { 0 } }; > > + if (!ipv6_mod_enabled()) > + return NULL; > + > memset(&fl6, 0, sizeof(fl6)); > fl6.flowi6_oif = ndev->ifindex; > memcpy(&fl6.saddr, saddr, sizeof(*saddr)); What is this actually fixing? ndst = ipv6_stub->ipv6_dst_lookup_flow() will return an error if the ipv6 support is not loaded so why do we need more tests? > @@ -616,6 +619,8 @@ static int rxe_net_ipv4_init(void) > static int rxe_net_ipv6_init(void) > { > #if IS_ENABLED(CONFIG_IPV6) > + if (!ipv6_mod_enabled()) > + return 0; > > recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net, > htons(ROCE_V2_UDP_DPORT), true); rxe_setup_udp_tunnel() should already fail naturally because the V6 socket won't be created What is the actual symptom this patch is trying to address? Jason