wwbmmm commented on code in PR #3569:
URL: https://github.com/apache/brpc/pull/3569#discussion_r4176320016
##########
src/brpc/rdma/rdma_endpoint.cpp:
##########
@@ -1137,8 +1186,22 @@ static ibv_qp* AllocateQp(ibv_cq* send_cq, ibv_cq*
recv_cq, uint32_t sq_size, ui
attr.cap.max_recv_wr = rq_size;
attr.cap.max_send_sge = GetRdmaMaxSge();
attr.cap.max_recv_sge = 1;
+ attr.cap.max_inline_data = inline_size;
attr.qp_type = IBV_QPT_RC;
- return IbvCreateQp(GetRdmaPd(), &attr);
+ ibv_qp* qp = IbvCreateQp(GetRdmaPd(), &attr);
+ while (qp == nullptr && inline_size > 0) {
Review Comment:
[replied by brpc-oncall robot] This loop steps down and retries on *any*
`IbvCreateQp` failure, not only on failures caused by the requested inline
size. On a device that rejects every inline size (or that fails for an
unrelated reason such as ENOMEM or reaching the device QP limit),
`AllocateQpCq` now performs up to 16 failed `ibv_create_qp` calls per resource,
and the `PLOG(WARNING) << "Fail to create QP"` in the caller reports the errno
of the last (0-inline) attempt rather than the root cause. Consider logging
each step-down (e.g. `LOG_IF(INFO, FLAGS_rdma_trace_verbose)`, following the
convention used elsewhere in this file) and stepping down only when the failure
can plausibly come from the inline request (e.g. `errno == EINVAL`).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]