Message ID | 1526133268-23926-3-git-send-email-yanjun.zhu@oracle.com (mailing list archive) |
---|---|
State | Rejected |
Headers | show |
> -----Original Message----- > From: linux-rdma-owner@vger.kernel.org [mailto:linux-rdma- > owner@vger.kernel.org] On Behalf Of Zhu Yanjun > Sent: Saturday, May 12, 2018 8:54 AM > To: Moni Shoua <monis@mellanox.com>; dledford@redhat.com; jgg@ziepe.ca; > linux-rdma@vger.kernel.org > Subject: [PATCH 2/4] IB/rxe: create a new udp port for ipv4 and ipv6 > > A new port is created to listen to udp sockets for ipv4 and ipv6. > The new udp port is 4891. The original udp port is 4791. > Rxe driver opening udp port is incorrect currently and would not like to extend it further this way. Right thing to do is ib_core will be opening 4791 for offloaded and for rxe driver. This is long pending; However we need to wait for gid ref count series to finish first. Gid table will be providing socket fd that will can be used by rxe. This requires some rework in the rxe to make use of this socket fd. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 2018/5/14 8:26, Parav Pandit wrote: > >> -----Original Message----- >> From: linux-rdma-owner@vger.kernel.org [mailto:linux-rdma- >> owner@vger.kernel.org] On Behalf Of Zhu Yanjun >> Sent: Saturday, May 12, 2018 8:54 AM >> To: Moni Shoua <monis@mellanox.com>; dledford@redhat.com; jgg@ziepe.ca; >> linux-rdma@vger.kernel.org >> Subject: [PATCH 2/4] IB/rxe: create a new udp port for ipv4 and ipv6 >> >> A new port is created to listen to udp sockets for ipv4 and ipv6. >> The new udp port is 4891. The original udp port is 4791. >> > Rxe driver opening udp port is incorrect currently and would not like to extend it further this way. > Right thing to do is ib_core will be opening 4791 for offloaded and for rxe driver. > This is long pending; However we need to wait for gid ref count series to finish first. > Gid table will be providing socket fd that will can be used by rxe. > This requires some rework in the rxe to make use of this socket fd. Thanks. After rework, I will modify the source code based on the rework. Zhu Yanjun > -- > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c index 9da6e37..fb5c7ff 100644 --- a/drivers/infiniband/sw/rxe/rxe_net.c +++ b/drivers/infiniband/sw/rxe/rxe_net.c @@ -720,7 +720,15 @@ static int rxe_net_ipv4_init(void) pr_err("Failed to create IPv4 UDP tunnel\n"); return -1; } - +#ifdef CONFIG_RDMA_RXE_DUAL_PORT_MODULE + recv_sockets.dual_sk4 = rxe_setup_udp_tunnel(&init_net, + htons(ROCE_V2_UDP_DUAL_DPORT), false); + if (IS_ERR(recv_sockets.dual_sk4)) { + recv_sockets.dual_sk4 = NULL; + pr_err("Failed to create IPv4 secondary UDP tunnel\n"); + return -1; + } +#endif return 0; } @@ -735,6 +743,18 @@ static int rxe_net_ipv6_init(void) pr_err("Failed to create IPv6 UDP tunnel\n"); return -1; } +#ifdef CONFIG_RDMA_RXE_DUAL_PORT_MODULE +{ + __be16 dport = htons(ROCE_V2_UDP_DUAL_DPORT); + + recv_sockets.dual_sk6 = rxe_setup_udp_tunnel(&init_net, dport, true); + if (IS_ERR(recv_sockets.dual_sk6)) { + recv_sockets.dual_sk6 = NULL; + pr_err("Failed to create dual IPv6 UDP tunnel\n"); + return -1; + } +} +#endif #endif return 0; } diff --git a/drivers/infiniband/sw/rxe/rxe_net.h b/drivers/infiniband/sw/rxe/rxe_net.h index 728d8c7..ec33762 100644 --- a/drivers/infiniband/sw/rxe/rxe_net.h +++ b/drivers/infiniband/sw/rxe/rxe_net.h @@ -41,6 +41,10 @@ struct rxe_recv_sockets { struct socket *sk4; struct socket *sk6; +#ifdef CONFIG_RDMA_RXE_DUAL_PORT_MODULE + struct socket *dual_sk4; + struct socket *dual_sk6; +#endif }; extern struct notifier_block rxe_net_notifier; diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 9fc8a82..9a4332b 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -91,6 +91,9 @@ enum ib_gid_type { }; #define ROCE_V2_UDP_DPORT 4791 +#ifdef CONFIG_RDMA_RXE_DUAL_PORT_MODULE +#define ROCE_V2_UDP_DUAL_DPORT 4891 +#endif struct ib_gid_attr { struct net_device *ndev; struct ib_device *device;