All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-rc] RDMA/rxe: Fix failure during driver load
@ 2021-06-01  5:56 Kamal Heib
  2021-06-01  7:45 ` Zhu Yanjun
  0 siblings, 1 reply; 11+ messages in thread
From: Kamal Heib @ 2021-06-01  5:56 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 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

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


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

end of thread, other threads:[~2021-06-02 23:32 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-01  5:56 [PATCH for-rc] RDMA/rxe: Fix failure during driver load Kamal Heib
2021-06-01  7:45 ` Zhu Yanjun
2021-06-01  7:56   ` kamal heib
2021-06-01  8:11     ` Zhu Yanjun
2021-06-01  9:09       ` Kamal Heib
2021-06-01 15:59         ` Zhu Yanjun
2021-06-01 17:01           ` Jason Gunthorpe
2021-06-02  7:22             ` Zhu Yanjun
2021-06-02 13:10             ` Kamal Heib
2021-06-02 14:04               ` Yanjun Zhu
2021-06-02 23:31               ` Jason Gunthorpe

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.