All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-rc v1] RDMA/rxe: Fix failure during driver load
@ 2021-06-03  9:01 Kamal Heib
  2021-06-03  9:51 ` yanjun.zhu
  2021-06-03 19:51 ` Jason Gunthorpe
  0 siblings, 2 replies; 4+ messages in thread
From: Kamal Heib @ 2021-06-03  9:01 UTC (permalink / raw)
  To: linux-rdma; +Cc: Doug Ledford, Jason Gunthorpe, Kamal Heib

To avoid the following failure when trying to load the rdma_rxe module
while IPv6 is disabled, add a check for EAFNOSUPPORT to ignore the
failure, also delete the needless debug print from rxe_setup_udp_tunnel().

$ modprobe rdma_rxe
modprobe: ERROR: could not insert 'rdma_rxe': Operation not permitted

Fixes: dfdd6158ca2c ("IB/rxe: Fix kernel panic in udp_setup_tunnel")
Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
---
 drivers/infiniband/sw/rxe/rxe_net.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c
index 01662727dca0..6cb4446a0bdb 100644
--- a/drivers/infiniband/sw/rxe/rxe_net.c
+++ b/drivers/infiniband/sw/rxe/rxe_net.c
@@ -207,10 +207,8 @@ static struct socket *rxe_setup_udp_tunnel(struct net *net, __be16 port,
 
 	/* Create UDP socket */
 	err = udp_sock_create(net, &udp_cfg, &sock);
-	if (err < 0) {
-		pr_err("failed to create udp socket. err = %d\n", err);
+	if (err < 0)
 		return ERR_PTR(err);
-	}
 
 	tnl_cfg.encap_type = 1;
 	tnl_cfg.encap_rcv = rxe_udp_encap_recv;
@@ -619,6 +617,12 @@ static int rxe_net_ipv6_init(void)
 
 	recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net,
 						htons(ROCE_V2_UDP_DPORT), true);
+	if (PTR_ERR(recv_sockets.sk6) == -EAFNOSUPPORT) {
+		recv_sockets.sk6 = NULL;
+		pr_warn("IPv6 is not supported can not create UDP socket\n");
+		return 0;
+	}
+
 	if (IS_ERR(recv_sockets.sk6)) {
 		recv_sockets.sk6 = NULL;
 		pr_err("Failed to create IPv6 UDP tunnel\n");
-- 
2.26.3


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

* Re: [PATCH for-rc v1] RDMA/rxe: Fix failure during driver load
  2021-06-03  9:01 [PATCH for-rc v1] RDMA/rxe: Fix failure during driver load Kamal Heib
@ 2021-06-03  9:51 ` yanjun.zhu
  2021-06-03 19:51 ` Jason Gunthorpe
  1 sibling, 0 replies; 4+ messages in thread
From: yanjun.zhu @ 2021-06-03  9:51 UTC (permalink / raw)
  To: Kamal Heib, linux-rdma; +Cc: Doug Ledford, Jason Gunthorpe

June 3, 2021 5:01 PM, "Kamal Heib" <kamalheib1@gmail.com> wrote:

> To avoid the following failure when trying to load the rdma_rxe module
> while IPv6 is disabled, add a check for EAFNOSUPPORT to ignore the
> failure, also delete the needless debug print from rxe_setup_udp_tunnel().
> 
> $ modprobe rdma_rxe
> modprobe: ERROR: could not insert 'rdma_rxe': Operation not permitted
> 
> Fixes: dfdd6158ca2c ("IB/rxe: Fix kernel panic in udp_setup_tunnel")
> Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
> ---
> drivers/infiniband/sw/rxe/rxe_net.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c
> index 01662727dca0..6cb4446a0bdb 100644
> --- a/drivers/infiniband/sw/rxe/rxe_net.c
> +++ b/drivers/infiniband/sw/rxe/rxe_net.c
> @@ -207,10 +207,8 @@ static struct socket *rxe_setup_udp_tunnel(struct net *net, __be16 port,
> 
> /* Create UDP socket */
> err = udp_sock_create(net, &udp_cfg, &sock);
> - if (err < 0) {
> - pr_err("failed to create udp socket. err = %d\n", err);
> + if (err < 0)
> return ERR_PTR(err);
> - }
> 
> tnl_cfg.encap_type = 1;
> tnl_cfg.encap_rcv = rxe_udp_encap_recv;
> @@ -619,6 +617,12 @@ static int rxe_net_ipv6_init(void)
> 
> recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net,
> htons(ROCE_V2_UDP_DPORT), true);
> + if (PTR_ERR(recv_sockets.sk6) == -EAFNOSUPPORT) {
> + recv_sockets.sk6 = NULL;
> + pr_warn("IPv6 is not supported can not create UDP socket\n");

This warning doesn't read smoothly.

Zhu Yanjun

> + return 0;
> + }
> +
> if (IS_ERR(recv_sockets.sk6)) {
> recv_sockets.sk6 = NULL;
> pr_err("Failed to create IPv6 UDP tunnel\n");
> -- 
> 2.26.3

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

* Re: [PATCH for-rc v1] RDMA/rxe: Fix failure during driver load
  2021-06-03  9:01 [PATCH for-rc v1] RDMA/rxe: Fix failure during driver load Kamal Heib
  2021-06-03  9:51 ` yanjun.zhu
@ 2021-06-03 19:51 ` Jason Gunthorpe
  2021-06-06  7:13   ` Kamal Heib
  1 sibling, 1 reply; 4+ messages in thread
From: Jason Gunthorpe @ 2021-06-03 19:51 UTC (permalink / raw)
  To: Kamal Heib; +Cc: linux-rdma, Doug Ledford

On Thu, Jun 03, 2021 at 12:01:12PM +0300, Kamal Heib wrote:
> To avoid the following failure when trying to load the rdma_rxe module
> while IPv6 is disabled, add a check for EAFNOSUPPORT to ignore the
> failure, also delete the needless debug print from rxe_setup_udp_tunnel().
> 
> $ modprobe rdma_rxe
> modprobe: ERROR: could not insert 'rdma_rxe': Operation not permitted
> 
> Fixes: dfdd6158ca2c ("IB/rxe: Fix kernel panic in udp_setup_tunnel")
> Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
> --
>  drivers/infiniband/sw/rxe/rxe_net.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)

I tidied the pr_warn english and put this to for-next

It has been broken for so long, and in such a small way, I can't see
this as a -rc fix.

Thanks,
Jason

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

* Re: [PATCH for-rc v1] RDMA/rxe: Fix failure during driver load
  2021-06-03 19:51 ` Jason Gunthorpe
@ 2021-06-06  7:13   ` Kamal Heib
  0 siblings, 0 replies; 4+ messages in thread
From: Kamal Heib @ 2021-06-06  7:13 UTC (permalink / raw)
  To: Jason Gunthorpe; +Cc: linux-rdma, Doug Ledford

On Thu, Jun 03, 2021 at 04:51:45PM -0300, Jason Gunthorpe wrote:
> On Thu, Jun 03, 2021 at 12:01:12PM +0300, Kamal Heib wrote:
> > To avoid the following failure when trying to load the rdma_rxe module
> > while IPv6 is disabled, add a check for EAFNOSUPPORT to ignore the
> > failure, also delete the needless debug print from rxe_setup_udp_tunnel().
> > 
> > $ modprobe rdma_rxe
> > modprobe: ERROR: could not insert 'rdma_rxe': Operation not permitted
> > 
> > Fixes: dfdd6158ca2c ("IB/rxe: Fix kernel panic in udp_setup_tunnel")
> > Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
> > --
> >  drivers/infiniband/sw/rxe/rxe_net.c | 10 +++++++---
> >  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> I tidied the pr_warn english and put this to for-next
> 
> It has been broken for so long, and in such a small way, I can't see
> this as a -rc fix.
> 
> Thanks,
> Jason

Thanks a lot Jason.

Could you please add the reported-by tag to this patch? - I've missed
it, Sorry :-(.

Reported-by: Yi Zhang <yi.zhang@redhat.com>

Thanks,
Kamal

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

end of thread, other threads:[~2021-06-06  7:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-03  9:01 [PATCH for-rc v1] RDMA/rxe: Fix failure during driver load Kamal Heib
2021-06-03  9:51 ` yanjun.zhu
2021-06-03 19:51 ` Jason Gunthorpe
2021-06-06  7:13   ` Kamal Heib

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.