Tuvie commented on code in PR #2252:
URL: https://github.com/apache/brpc/pull/2252#discussion_r1197684025
##########
src/brpc/rdma/rdma_helper.cpp:
##########
@@ -397,53 +449,43 @@ static void GlobalRdmaInitializeOrDieImpl() {
}
// Find the first active port
- int available_devices = 0;
+ int available_devices = NumAvailableDevices();
g_port_num = FLAGS_rdma_port;
- auto context_deleter = [](ibv_context* p) { IbvCloseDevice(p); };
for (int i = 0; i < num; ++i) {
- std::unique_ptr<ibv_context, decltype(context_deleter)> context(
- IbvOpenDevice(g_devices[i]), context_deleter);
+ std::unique_ptr<ibv_context, IbvContextDeleter> context{
Review Comment:
These lines for OpenDevice are repeated. Maybe we can try to call these
functions only once.
--
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]