Skip to content

Commit e08e54e

Browse files
shamoyarmlarsen
authored andcommitted
verbs: Configure IB/RoCE QPs MTU according to the port MTU (tensorflow#9667)
* verbs: Configure IB/RoCE QPs MTU according to the port MTU * fix indent for linting
1 parent 33a6e4f commit e08e54e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tensorflow/contrib/verbs/rdma.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,11 @@ void RdmaChannel::Connect(const RdmaAddress& remoteAddr) {
476476
struct ibv_qp_attr attr;
477477
memset(&attr, 0, sizeof(ibv_qp_attr));
478478
attr.qp_state = IBV_QPS_RTR;
479-
attr.path_mtu = IBV_MTU_4096;
479+
struct ibv_port_attr port_attr;
480+
CHECK(!ibv_query_port(adapter_->context_, (uint8_t)1, &port_attr))
481+
<< "Query port failed";
482+
// This assumes both QP's ports are configured with the same MTU
483+
attr.path_mtu = port_attr.active_mtu;
480484
attr.dest_qp_num = remoteAddr.qpn;
481485
attr.rq_psn = remoteAddr.psn;
482486
attr.max_dest_rd_atomic = 1;

0 commit comments

Comments
 (0)