Skip to content

Commit 73dea19

Browse files
committed
[ibverbs] fix log & default config
1 parent bb9d661 commit 73dea19

2 files changed

Lines changed: 16 additions & 20 deletions

File tree

include/ylt/coro_io/ibverbs/ib_device.hpp

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,15 @@ inline void print_async_event(struct ibv_context* ctx,
122122
switch (event->event_type) {
123123
/* QP events */
124124
case IBV_EVENT_QP_FATAL:
125-
ELOG_ERROR << "QP fatal event for QP number:"
126-
<< event->element.qp->qp_num;
125+
ELOG_WARN << "QP fatal event for QP number:" << event->element.qp->qp_num;
127126
break;
128127
case IBV_EVENT_QP_REQ_ERR:
129-
ELOG_ERROR << "QP Requestor error for QP number:"
130-
<< event->element.qp->qp_num;
128+
ELOG_WARN << "QP Requestor error for QP number:"
129+
<< event->element.qp->qp_num;
131130
break;
132131
case IBV_EVENT_QP_ACCESS_ERR:
133-
ELOG_ERROR << "QP access error event for QP number:"
134-
<< event->element.qp->qp_num;
132+
ELOG_WARN << "QP access error event for QP number:"
133+
<< event->element.qp->qp_num;
135134
break;
136135
case IBV_EVENT_COMM_EST:
137136
ELOG_INFO << "QP communication established event for QP number:"
@@ -146,8 +145,8 @@ inline void print_async_event(struct ibv_context* ctx,
146145
<< event->element.qp->qp_num;
147146
break;
148147
case IBV_EVENT_PATH_MIG_ERR:
149-
ELOG_ERROR << "QP Path migration error event for QP number:"
150-
<< event->element.qp->qp_num;
148+
ELOG_WARN << "QP Path migration error event for QP number:"
149+
<< event->element.qp->qp_num;
151150
break;
152151
case IBV_EVENT_QP_LAST_WQE_REACHED:
153152
ELOG_INFO << "QP last WQE reached event for QP number:"
@@ -156,12 +155,12 @@ inline void print_async_event(struct ibv_context* ctx,
156155

157156
/* CQ events */
158157
case IBV_EVENT_CQ_ERR:
159-
ELOG_ERROR << "CQ error for CQ with handle " << event->element.cq;
158+
ELOG_WARN << "CQ error for CQ with handle " << event->element.cq;
160159
break;
161160

162161
/* SRQ events */
163162
case IBV_EVENT_SRQ_ERR:
164-
ELOG_ERROR << "SRQ error for SRQ with handle " << event->element.srq;
163+
ELOG_WARN << "SRQ error for SRQ with handle " << event->element.srq;
165164
break;
166165
case IBV_EVENT_SRQ_LIMIT_REACHED:
167166
ELOG_INFO << "SRQ limit reached event for SRQ with handle "
@@ -174,8 +173,8 @@ inline void print_async_event(struct ibv_context* ctx,
174173
<< event->element.port_num;
175174
break;
176175
case IBV_EVENT_PORT_ERR:
177-
ELOG_ERROR << "Port error event for port number "
178-
<< event->element.port_num;
176+
ELOG_WARN << "Port error event for port number "
177+
<< event->element.port_num;
179178
break;
180179
case IBV_EVENT_LID_CHANGE:
181180
ELOG_INFO << "LID change event for port number "
@@ -200,8 +199,8 @@ inline void print_async_event(struct ibv_context* ctx,
200199

201200
/* RDMA device events */
202201
case IBV_EVENT_DEVICE_FATAL:
203-
ELOG_ERROR << "Fatal error event for device "
204-
<< ibv_get_device_name(ctx->device);
202+
ELOG_WARN << "Fatal error event for device "
203+
<< ibv_get_device_name(ctx->device);
205204
break;
206205

207206
default:

include/ylt/coro_io/ibverbs/ib_socket.hpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -473,12 +473,12 @@ class ib_socket_t {
473473
// workaround for some compiler error if we put ib_socket_config_base_t as
474474
// nested struct
475475
struct config_t {
476-
uint32_t cq_size = 512;
476+
uint32_t cq_size = 128;
477477
uint16_t recv_buffer_cnt = 8;
478478
uint16_t send_buffer_cnt = 4;
479479
ibv_qp_type qp_type = IBV_QPT_RC;
480-
ibv_qp_cap cap = {.max_send_wr = 256,
481-
.max_recv_wr = 256,
480+
ibv_qp_cap cap = {.max_send_wr = 32,
481+
.max_recv_wr = 32,
482482
.max_send_sge = 3,
483483
.max_recv_sge = 1,
484484
.max_inline_data = 256};
@@ -970,7 +970,6 @@ class ib_socket_t {
970970
auto err_code = std::make_error_code(std::errc{ec});
971971
ELOG_ERROR << "modify qp to init failed: " << err_code.message()
972972
<< ", QP=" << state_->qp_->qp_num;
973-
;
974973
throw std::system_error(err_code);
975974
}
976975
}
@@ -1004,7 +1003,6 @@ class ib_socket_t {
10041003
auto err_code = std::make_error_code(std::errc{ec});
10051004
ELOG_ERROR << "modify qp to rtr failed: " << err_code.message()
10061005
<< ", QP=" << state_->qp_->qp_num;
1007-
;
10081006
throw std::system_error(err_code);
10091007
}
10101008
}
@@ -1023,7 +1021,6 @@ class ib_socket_t {
10231021
auto err_code = std::make_error_code(std::errc{ec});
10241022
ELOG_ERROR << "modify qp to rts failed: " << err_code.message()
10251023
<< ", QP=" << state_->qp_->qp_num;
1026-
;
10271024
throw std::system_error(err_code);
10281025
}
10291026
}

0 commit comments

Comments
 (0)