Re: [PATCH 4/4] IB/rxe: exchange the 2 udp ports

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/12/2018 9:54 AM, Zhu Yanjun wrote:
When udp port 4791 is blocked, the udp port 4891 is used and vice versa.

Port 4891 is currently unassigned in the IANA registry. Do you intend
to request this? Strongly suggest that this not merge without such a
standard.

https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.txt



CC: Srinivas Eeda <srinivas.eeda@xxxxxxxxxx>
CC: Junxiao Bi <junxiao.bi@xxxxxxxxxx>
Reviewed-by: Yuval Shaia <yuval.shaia@xxxxxxxxxx>
Signed-off-by: Zhu Yanjun <yanjun.zhu@xxxxxxxxxx>
---
  drivers/infiniband/sw/rxe/rxe_net.c | 13 +++++++++++--
  1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c
index 29f6937..d61f2c5 100644
--- a/drivers/infiniband/sw/rxe/rxe_net.c
+++ b/drivers/infiniband/sw/rxe/rxe_net.c
@@ -276,6 +276,16 @@ static inline void prepare_udp_ports_spin(__be16 dport, __be16 sport)
  	src_port = sport;
  	spin_unlock(&port_lock);
  }
+
+static inline void exchange_udp_port(void)
+{
+	if (dst_port == htons(ROCE_V2_UDP_DPORT))
+		prepare_udp_ports_spin(htons(ROCE_V2_UDP_DUAL_DPORT),
+				       htons(RXE_ROCE_V2_DUAL_SPORT));
+	else
+		prepare_udp_ports_spin(htons(ROCE_V2_UDP_DPORT),
+				       htons(RXE_ROCE_V2_SPORT));
+}
  #endif
static int rxe_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
@@ -549,8 +559,7 @@ int rxe_send(struct rxe_pkt_info *pkt, struct sk_buff *skb)
#ifdef CONFIG_RDMA_RXE_DUAL_PORT_MODULE
  	if (unlikely(err != NET_XMIT_SUCCESS))
-		prepare_udp_ports_spin(htons(ROCE_V2_UDP_DUAL_DPORT),
-				       htons(RXE_ROCE_V2_DUAL_SPORT));
+		exchange_udp_port();
  #endif
if (unlikely(net_xmit_eval(err))) {

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux