Re: modprobe rdma_rxe failed when ipv6 disabled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, Yi, Leon and Jason

I made a patch to try to fix this problem. Please comment.
Thanks a lot.

Zhu Yanjun

On Sat, Feb 27, 2021 at 11:32 PM Zhu Yanjun <zyjzyj2000@xxxxxxxxx> wrote:
>
> From 9dcdd09f3ca3cf222b563866acd91d18bc4b93d4 Mon Sep 17 00:00:00 2001
> From: Zhu Yanjun <zyjzyj2000@xxxxxxxxx>
> Date: Sat, 27 Feb 2021 23:01:15 +0000
> Subject: [PATCH 1/1] RDMA/rxe: Disable ipv6 features when ipv6.disable set in
>  cmdline
>
> 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.
>
> Reported-by: Yi Zhang <yi.zhang@xxxxxxxxxx>
> Signed-off-by: Zhu Yanjun <zyjzyj2000@xxxxxxxxx>
> ---
>  drivers/infiniband/sw/rxe/rxe_net.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/drivers/infiniband/sw/rxe/rxe_net.c
> b/drivers/infiniband/sw/rxe/rxe_net.c
> index 0701bd1ffd1a..6ef092cb575e 100644
> --- a/drivers/infiniband/sw/rxe/rxe_net.c
> +++ 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 } };
>
> +       if (!ipv6_mod_enabled()) {
> +               pr_info("IPv6 is disabled by ipv6.disable=1 in cmdline");
> +               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 by ipv6.disable=1 in cmdline");
> +               return 0;
> +       }
>
>         recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net,
>                                                 htons(ROCE_V2_UDP_DPORT), true);
> --
> 2.25.1
>
> On Sat, Feb 27, 2021 at 6:18 PM Yi Zhang <yi.zhang@xxxxxxxxxx> wrote:
> >
> >
> >
> > On 2/27/21 5:05 PM, Zhu Yanjun wrote:
> > > On Fri, Feb 26, 2021 at 11:50 PM Yi Zhang <yi.zhang@xxxxxxxxxx> wrote:
> > >> Hello
> > >>
> > >> I found this failure after ipv6 disabled, is that expected?
> > >>
> > >> # modprobe rdma_rxe
> > >> modprobe: ERROR: could not insert 'rdma_rxe': Operation not permitted
> > >>
> > >> # dmesg
> > >> [  596.783484] rdma_rxe: failed to create udp socket. err = -97
> > >> [  596.789144] rdma_rxe: Failed to create IPv6 UDP tunnel
> > > ipv6 in RXE is based on config_ipv6. If config_ipv6 is disabled. rxe
> > > will not implement ipv6 features.
> > > How do you disable ipv6 in your hosts?
> > Sorry, I should give the detailed info, I disabled it by kernel parameter:
> > # cat /proc/cmdline  | grep -o ipv6.disable=1
> > ipv6.disable=1
> >
> >
> >
> > > Zhu Yanjun
> > >
> > >> # uname -r
> > >> 5.11.0
> > >>
> > >>
> > >>
> > >> Best Regards,
> > >>    Yi Zhang
> > >>
> > >>
> >



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux