All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv4 for-next 1/1] RDMA/rxe: Disable ipv6 features when ipv6.disable in cmdline
@ 2021-04-12  1:56 Zhu Yanjun
  2021-04-12 18:44 ` Jason Gunthorpe
  0 siblings, 1 reply; 4+ messages in thread
From: Zhu Yanjun @ 2021-04-12  1:56 UTC (permalink / raw)
  To: zyjzyj2000, dledford, jgg, linux-rdma; +Cc: Yi Zhang, Leon Romanovsky

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.

Link: https://lore.kernel.org/linux-rdma/880d7b59-4b17-a44f-1a91-88257bfc3aaa@redhat.com/T/#t
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>
---
V3->V4: I do not know how to reproduce Jason's problem. So I just ignore
        the -EAFNOSUPPORT error. Hope this can fix Jason's problem.
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..b12137257af7 100644
--- a/drivers/infiniband/sw/rxe/rxe_net.c
+++ b/drivers/infiniband/sw/rxe/rxe_net.c
@@ -620,6 +620,11 @@ static int rxe_net_ipv6_init(void)
 	recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net,
 						htons(ROCE_V2_UDP_DPORT), true);
 	if (IS_ERR(recv_sockets.sk6)) {
+		/* Though IPv6 is not supported, IPv4 still needs to continue
+		 */
+		if (PTR_ERR(recv_sockets.sk6) == -EAFNOSUPPORT)
+			return 0;
+
 		recv_sockets.sk6 = NULL;
 		pr_err("Failed to create IPv6 UDP tunnel\n");
 		return -1;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCHv4 for-next 1/1] RDMA/rxe: Disable ipv6 features when ipv6.disable in cmdline
  2021-04-12  1:56 [PATCHv4 for-next 1/1] RDMA/rxe: Disable ipv6 features when ipv6.disable in cmdline Zhu Yanjun
@ 2021-04-12 18:44 ` Jason Gunthorpe
  2021-04-13  6:11   ` Leon Romanovsky
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Gunthorpe @ 2021-04-12 18:44 UTC (permalink / raw)
  To: Zhu Yanjun; +Cc: zyjzyj2000, dledford, linux-rdma, Yi Zhang, Leon Romanovsky

On Sun, Apr 11, 2021 at 09:56:41PM -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.
> 
> Link: https://lore.kernel.org/linux-rdma/880d7b59-4b17-a44f-1a91-88257bfc3aaa@redhat.com/T/#t
> 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>

Is this signature block accurate? I'm pretty sure Leon didn't look at
this version of the patch.

Did Yi test this version, or is this leftover from a prior version?

> ---
> V3->V4: I do not know how to reproduce Jason's problem. So I just ignore
>         the -EAFNOSUPPORT error. Hope this can fix Jason's problem.

Who is Jason?

> diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c
> index 01662727dca0..b12137257af7 100644
> --- a/drivers/infiniband/sw/rxe/rxe_net.c
> +++ b/drivers/infiniband/sw/rxe/rxe_net.c
> @@ -620,6 +620,11 @@ static int rxe_net_ipv6_init(void)
>  	recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net,
>  						htons(ROCE_V2_UDP_DPORT), true);
>  	if (IS_ERR(recv_sockets.sk6)) {
> +		/* Though IPv6 is not supported, IPv4 still needs to continue
> +		 */
> +		if (PTR_ERR(recv_sockets.sk6) == -EAFNOSUPPORT)
> +			return 0;

At least this looks OK to me and the original report certainly said
the error was EAFNOSUPPORT

Please clarify what is going on with the signature block

Jason

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCHv4 for-next 1/1] RDMA/rxe: Disable ipv6 features when ipv6.disable in cmdline
  2021-04-12 18:44 ` Jason Gunthorpe
@ 2021-04-13  6:11   ` Leon Romanovsky
  2021-04-13  6:31     ` Zhu Yanjun
  0 siblings, 1 reply; 4+ messages in thread
From: Leon Romanovsky @ 2021-04-13  6:11 UTC (permalink / raw)
  To: Jason Gunthorpe; +Cc: Zhu Yanjun, zyjzyj2000, dledford, linux-rdma, Yi Zhang

On Mon, Apr 12, 2021 at 03:44:07PM -0300, Jason Gunthorpe wrote:
> On Sun, Apr 11, 2021 at 09:56:41PM -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.
> > 
> > Link: https://lore.kernel.org/linux-rdma/880d7b59-4b17-a44f-1a91-88257bfc3aaa@redhat.com/T/#t
> > 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>
> 
> Is this signature block accurate? I'm pretty sure Leon didn't look at
> this version of the patch.

Yes, I didn't look.

> 
> Did Yi test this version, or is this leftover from a prior version?
> 
> > ---
> > V3->V4: I do not know how to reproduce Jason's problem. So I just ignore
> >         the -EAFNOSUPPORT error. Hope this can fix Jason's problem.
> 
> Who is Jason?
> 
> > diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c
> > index 01662727dca0..b12137257af7 100644
> > --- a/drivers/infiniband/sw/rxe/rxe_net.c
> > +++ b/drivers/infiniband/sw/rxe/rxe_net.c
> > @@ -620,6 +620,11 @@ static int rxe_net_ipv6_init(void)
> >  	recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net,
> >  						htons(ROCE_V2_UDP_DPORT), true);
> >  	if (IS_ERR(recv_sockets.sk6)) {
> > +		/* Though IPv6 is not supported, IPv4 still needs to continue
> > +		 */
> > +		if (PTR_ERR(recv_sockets.sk6) == -EAFNOSUPPORT)
> > +			return 0;
> 
> At least this looks OK to me and the original report certainly said
> the error was EAFNOSUPPORT

The failure can be received only if udp_sock_create() fails in the
rxe_setup_udp_tunnel(). It will print an error despite us not want this.

> 
> Please clarify what is going on with the signature block

And fix error print.

Thanks

> 
> Jason

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCHv4 for-next 1/1] RDMA/rxe: Disable ipv6 features when ipv6.disable in cmdline
  2021-04-13  6:11   ` Leon Romanovsky
@ 2021-04-13  6:31     ` Zhu Yanjun
  0 siblings, 0 replies; 4+ messages in thread
From: Zhu Yanjun @ 2021-04-13  6:31 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Jason Gunthorpe, Zhu Yanjun, Doug Ledford, RDMA mailing list, Yi Zhang

On Tue, Apr 13, 2021 at 2:11 PM Leon Romanovsky <leonro@nvidia.com> wrote:
>
> On Mon, Apr 12, 2021 at 03:44:07PM -0300, Jason Gunthorpe wrote:
> > On Sun, Apr 11, 2021 at 09:56:41PM -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.
> > >
> > > Link: https://lore.kernel.org/linux-rdma/880d7b59-4b17-a44f-1a91-88257bfc3aaa@redhat.com/T/#t
> > > 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>
> >
> > Is this signature block accurate? I'm pretty sure Leon didn't look at
> > this version of the patch.
>
> Yes, I didn't look.

Sorry. This signature block is from the prior version. I will fix it.

>
> >
> > Did Yi test this version, or is this leftover from a prior version?
> >
> > > ---
> > > V3->V4: I do not know how to reproduce Jason's problem. So I just ignore
> > >         the -EAFNOSUPPORT error. Hope this can fix Jason's problem.
> >
> > Who is Jason?
> >
> > > diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c
> > > index 01662727dca0..b12137257af7 100644
> > > --- a/drivers/infiniband/sw/rxe/rxe_net.c
> > > +++ b/drivers/infiniband/sw/rxe/rxe_net.c
> > > @@ -620,6 +620,11 @@ static int rxe_net_ipv6_init(void)
> > >     recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net,
> > >                                             htons(ROCE_V2_UDP_DPORT), true);
> > >     if (IS_ERR(recv_sockets.sk6)) {
> > > +           /* Though IPv6 is not supported, IPv4 still needs to continue
> > > +            */
> > > +           if (PTR_ERR(recv_sockets.sk6) == -EAFNOSUPPORT)
> > > +                   return 0;
> >
> > At least this looks OK to me and the original report certainly said
> > the error was EAFNOSUPPORT
>
> The failure can be received only if udp_sock_create() fails in the
> rxe_setup_udp_tunnel(). It will print an error despite us not want this.
>
> >
> > Please clarify what is going on with the signature block
>
> And fix error print.

Got it. I will fix the signature block and error print.

Zhu Yanjun

>
> Thanks
>
> >
> > Jason

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-04-13  6:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-12  1:56 [PATCHv4 for-next 1/1] RDMA/rxe: Disable ipv6 features when ipv6.disable in cmdline Zhu Yanjun
2021-04-12 18:44 ` Jason Gunthorpe
2021-04-13  6:11   ` Leon Romanovsky
2021-04-13  6:31     ` Zhu Yanjun

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.