File tree Expand file tree Collapse file tree 3 files changed +29
-2
lines changed
include/ylt/coro_io/ibverbs
src/coro_io/tests/ibverbs Expand file tree Collapse file tree 3 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,30 @@ struct ib_deleter {
109
109
}
110
110
};
111
111
112
+ inline std::string mtu_str (ibv_mtu mtu) {
113
+ std::string str;
114
+ switch (mtu) {
115
+ case IBV_MTU_256:
116
+ str = " IBV_MTU_256" ;
117
+ break ;
118
+ case IBV_MTU_512:
119
+ str = " IBV_MTU_512" ;
120
+ break ;
121
+ case IBV_MTU_1024:
122
+ str = " IBV_MTU_1024" ;
123
+ break ;
124
+ case IBV_MTU_2048:
125
+ str = " IBV_MTU_2048" ;
126
+ break ;
127
+ case IBV_MTU_4096:
128
+ str = " IBV_MTU_4096" ;
129
+ break ;
130
+ default :
131
+ break ;
132
+ }
133
+ return str;
134
+ }
135
+
112
136
class ib_device_t {
113
137
public:
114
138
ib_device_t (const ib_config_t & conf) {
@@ -126,6 +150,9 @@ class ib_device_t {
126
150
throw std::system_error (ec);
127
151
}
128
152
153
+ ELOG_INFO << " Active MTU: " << mtu_str (attr_.active_mtu ) << " , "
154
+ << " Max MTU: " << mtu_str (attr_.max_mtu );
155
+
129
156
find_best_gid_index ();
130
157
131
158
ELOG_INFO << " IBDevice " << name_ << " , best gid index " << gid_index_;
Original file line number Diff line number Diff line change @@ -582,7 +582,7 @@ class ib_socket_t {
582
582
void modify_qp_to_rtr (uint32_t remote_qpn, uint16_t dlid, uint8_t * dgid) {
583
583
ibv_qp_attr attr{};
584
584
attr.qp_state = IBV_QPS_RTR;
585
- attr.path_mtu = IBV_MTU_4096 ;
585
+ attr.path_mtu = state_-> device_ -> attr (). active_mtu ;
586
586
attr.dest_qp_num = remote_qpn;
587
587
attr.rq_psn = 0 ;
588
588
attr.max_dest_rd_atomic = 1 ;
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ TEST_CASE("test device") {
32
32
auto pd = dev.pd ();
33
33
CHECK (pd);
34
34
CHECK (dev.port () == 1 );
35
- CHECK (dev.gid_index () == 1 );
35
+ CHECK (dev.gid_index () >= 0 );
36
36
auto & attr = dev.attr ();
37
37
}
38
38
You can’t perform that action at this time.
0 commit comments