All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhu Yanjun <zyjzyj2000@gmail.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: Zhu Yanjun <yanjun.zhu@intel.com>,
	Doug Ledford <dledford@redhat.com>,
	RDMA mailing list <linux-rdma@vger.kernel.org>,
	Leon Romanovsky <leon@kernel.org>, Yi Zhang <yi.zhang@redhat.com>,
	Leon Romanovsky <leonro@nvidia.com>
Subject: Re: [PATCHv3 for-next 1/1] RDMA/rxe: Disable ipv6 features when ipv6.disable set in cmdline
Date: Fri, 9 Apr 2021 22:36:42 -0400	[thread overview]
Message-ID: <CAD=hENehGzGn=nxNO0B8u=nevFx1CGsiovxtir3OCZ2ffVB1gQ@mail.gmail.com> (raw)
In-Reply-To: <20210408183359.GA676678@nvidia.com>

On Thu, Apr 8, 2021 at 2:34 PM Jason Gunthorpe <jgg@nvidia.com> wrote:
>
> On Thu, Mar 25, 2021 at 09:27:23PM -0400, Zhu Yanjun wrote:
> > From: Zhu Yanjun <zyjzyj2000@gmail.com>
> >
> > 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@redhat.com>
> > Signed-off-by: Zhu Yanjun <zyjzyj2000@gmail.com>
> > Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
> > Tested-by: Yi Zhang <yi.zhang@redhat.com>
> > 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?

As what I said in commit log, when "When ipv6.disable=1 is set in
cmdline, ipv6 is actually disabled"
That is, when cat /proc/cmdline, the command line is
"
cat /proc/cmdline
BOOT_IMAGE=(hd0,msdos1)/vmlinuz-5.12.0-rc3+ root=/dev/mapper/cl-root
ro resume=/dev/mapper/cl-swap rd.lvm.lv=cl/root rd.lvm.lv=cl/swap
crashkernel=512M ipv6.disable=1
"
And if you make the above configurations, then modprobe rdma_rxe should work.
then ''rdma link add rxe0 type rxe netdev eth0" should work well.
ndst = ipv6_stub->ipv6_dst_lookup_flow should not be called.
Can you tell me how to disable IPV6 in your test host?

> in the stack. As such, the operations of ipv6 in RXE will fail.
> So ipv6 features in RXE should also be disabled in RXE."

>
> > @@ -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?

This patch is try to fix the problem in the link
https://lore.kernel.org/linux-rdma/880d7b59-4b17-a44f-1a91-88257bfc3aaa@redhat.com/T/#t

Zhu Yanjun

>
> Jason

  reply	other threads:[~2021-04-09 10:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-26  1:27 [PATCHv3 for-next 1/1] RDMA/rxe: Disable ipv6 features when ipv6.disable set in cmdline Zhu Yanjun
2021-04-08 18:33 ` Jason Gunthorpe
2021-04-10  2:36   ` Zhu Yanjun [this message]
2021-04-09 13:37     ` Jason Gunthorpe
2021-04-12  6:34       ` Zhu Yanjun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAD=hENehGzGn=nxNO0B8u=nevFx1CGsiovxtir3OCZ2ffVB1gQ@mail.gmail.com' \
    --to=zyjzyj2000@gmail.com \
    --cc=dledford@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=leon@kernel.org \
    --cc=leonro@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=yanjun.zhu@intel.com \
    --cc=yi.zhang@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.