* Fwd: [PATCHv2 1/1] RDMA/rxe: Disable ipv6 features when ipv6.disable set in cmdline
[not found] <20210307004256.7082-1-yanjun.zhu@intel.com>
@ 2021-03-06 16:59 ` Zhu Yanjun
2021-03-23 19:53 ` Jason Gunthorpe
0 siblings, 1 reply; 3+ messages in thread
From: Zhu Yanjun @ 2021-03-06 16:59 UTC (permalink / raw)
To: Yi Zhang, Leon Romanovsky, Jason Gunthorpe, RDMA mailing list
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>
---
V1->V2: Modify the pr_info messages
---
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");
+ 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");
+ return 0;
+ }
recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net,
htons(ROCE_V2_UDP_DPORT), true);
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: Fwd: [PATCHv2 1/1] RDMA/rxe: Disable ipv6 features when ipv6.disable set in cmdline
2021-03-06 16:59 ` Fwd: [PATCHv2 1/1] RDMA/rxe: Disable ipv6 features when ipv6.disable set in cmdline Zhu Yanjun
@ 2021-03-23 19:53 ` Jason Gunthorpe
2021-03-24 9:45 ` Zhu Yanjun
0 siblings, 1 reply; 3+ messages in thread
From: Jason Gunthorpe @ 2021-03-23 19:53 UTC (permalink / raw)
To: Zhu Yanjun; +Cc: Yi Zhang, Leon Romanovsky, RDMA mailing list
On Sun, Mar 07, 2021 at 12:59:07AM +0800, 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>
> V1->V2: Modify the pr_info messages
> 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
> +++ 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");
> + return NULL;
> + }
Why doesn't a similar touch of ipv6_stub in
drivers/infiniband/core/addr.c need a similar protection?
Also do not print.
Jason
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Fwd: [PATCHv2 1/1] RDMA/rxe: Disable ipv6 features when ipv6.disable set in cmdline
2021-03-23 19:53 ` Jason Gunthorpe
@ 2021-03-24 9:45 ` Zhu Yanjun
0 siblings, 0 replies; 3+ messages in thread
From: Zhu Yanjun @ 2021-03-24 9:45 UTC (permalink / raw)
To: Jason Gunthorpe; +Cc: Yi Zhang, Leon Romanovsky, RDMA mailing list
On Wed, Mar 24, 2021 at 3:53 AM Jason Gunthorpe <jgg@nvidia.com> wrote:
>
> On Sun, Mar 07, 2021 at 12:59:07AM +0800, 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>
> > V1->V2: Modify the pr_info messages
> > 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
> > +++ 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");
> > + return NULL;
> > + }
>
> Why doesn't a similar touch of ipv6_stub in
> drivers/infiniband/core/addr.c need a similar protection?
Got it. This patch is for RXE.
I will make a similar commit of ipv6_stub in
drivers/infiniband/core/addr.c soon.
>
> Also do not print.
I will remove print in the next patch.
Zhu Yanjun
>
> Jason
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-03-24 9:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20210307004256.7082-1-yanjun.zhu@intel.com>
2021-03-06 16:59 ` Fwd: [PATCHv2 1/1] RDMA/rxe: Disable ipv6 features when ipv6.disable set in cmdline Zhu Yanjun
2021-03-23 19:53 ` Jason Gunthorpe
2021-03-24 9:45 ` Zhu Yanjun
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox