You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2022/11/17 05:51:36 UTC

[GitHub] [incubator-brpc] wwbmmm commented on a diff in pull request #1999: allow IOBuf::append_user_data specifying any valid address in registered rdma memory region

wwbmmm commented on code in PR #1999:
URL: https://github.com/apache/incubator-brpc/pull/1999#discussion_r1024737322


##########
src/brpc/rdma/rdma_helper.cpp:
##########
@@ -99,37 +99,41 @@ static ibv_device** g_devices = NULL;
 static ibv_context* g_context = NULL;
 static SocketId g_async_socket;
 static ibv_pd* g_pd = NULL;
-static std::vector<ibv_mr*>* g_mrs = NULL;
+static std::vector<ibv_mr*>* g_mrs = NULL; // mr registered by brpc

Review Comment:
   可以按照地址排列成有序集合,用二分法查找更快



##########
test/brpc_rdma_unittest.cpp:
##########
@@ -1061,7 +1068,10 @@ TEST_F(RdmaTest, server_miss_after_ack) {
     usleep(100000);
     ASSERT_EQ(rdma::RdmaEndpoint::ESTABLISHED, s->_rdma_ep->_state);
     ASSERT_EQ(4, read(acc_fd, data, 4));
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstrict-aliasing"

Review Comment:
   (uint32_t*)data改成(uint32_t*)(void*)data应该就不会报错了



-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org