Re: [PATCH for-rc] RDMA/rxe: Fix failure during driver load

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

 



On Tue, Jun 1, 2021 at 3:56 PM kamal heib <kamalheib1@xxxxxxxxx> wrote:
>
>
>
> > On 1 Jun 2021, at 10:45, Zhu Yanjun <zyjzyj2000@xxxxxxxxx> wrote:
> >
> > On Tue, Jun 1, 2021 at 1:58 PM Kamal Heib <kamalheib1@xxxxxxxxx> wrote:
> >>
> >> To avoid the following failure when trying to load the rdma_rxe module
> >> while IPv6 is disabled, Add a check to make sure that IPv6 is enabled
> >> before trying to create the IPv6 UDP tunnel.
> >>
> >> $ modprobe rdma_rxe
> >> modprobe: ERROR: could not insert 'rdma_rxe': Operation not permitted
> >
> > About this problem, this link:
> > https://patchwork.kernel.org/project/linux-rdma/patch/20210413234252.12209-1-yanjun.zhu@xxxxxxxxx/
> > also tries to solve ipv6 problem.
> >
> > Zhu Yanjun
> >
>
> Yes, but this patch is fixing the problem more cleanly and I’ve tested it.
>
> Could you please review and ACK this patch?

https://www.spinics.net/lists/linux-rdma/msg100274.html
Compared with the above commit, are the following also needed?

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));

Zhu Yanjun

>
> Thanks,
> Kamal
>
>
> >>
> >> Fixes: dfdd6158ca2c ("IB/rxe: Fix kernel panic in udp_setup_tunnel")
> >> Signed-off-by: Kamal Heib <kamalheib1@xxxxxxxxx>
> >> ---
> >> drivers/infiniband/sw/rxe/rxe_net.c | 14 ++++++++------
> >> 1 file changed, 8 insertions(+), 6 deletions(-)
> >>
> >> diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c
> >> index 01662727dca0..f353fc18769f 100644
> >> --- a/drivers/infiniband/sw/rxe/rxe_net.c
> >> +++ b/drivers/infiniband/sw/rxe/rxe_net.c
> >> @@ -617,12 +617,14 @@ static int rxe_net_ipv6_init(void)
> >> {
> >> #if IS_ENABLED(CONFIG_IPV6)
> >>
> >> -       recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net,
> >> -                                               htons(ROCE_V2_UDP_DPORT), true);
> >> -       if (IS_ERR(recv_sockets.sk6)) {
> >> -               recv_sockets.sk6 = NULL;
> >> -               pr_err("Failed to create IPv6 UDP tunnel\n");
> >> -               return -1;
> >> +       if (ipv6_mod_enabled()) {
> >> +               recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net,
> >> +                                       htons(ROCE_V2_UDP_DPORT), true);
> >> +               if (IS_ERR(recv_sockets.sk6)) {
> >> +                       recv_sockets.sk6 = NULL;
> >> +                       pr_err("Failed to create IPv6 UDP tunnel\n");
> >> +                       return -1;
> >> +               }
> >>        }
> >> #endif
> >>        return 0;
> >> --
> >> 2.26.3
> >>




[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