yanglimingcn commented on code in PR #3145:
URL: https://github.com/apache/brpc/pull/3145#discussion_r2509186439


##########
src/brpc/rdma/rdma_endpoint.cpp:
##########
@@ -938,8 +961,16 @@ ssize_t RdmaEndpoint::HandleCompletion(ibv_wc& wc) {
     bool zerocopy = FLAGS_rdma_recv_zerocopy;
     switch (wc.opcode) {
     case IBV_WC_SEND: {  // send completion
-        // Do nothing
-        break;
+        if (SEND_TYPE_RDMA_IMM == wc.wr_id) {
+            // Do nothing for imm.
+            return 0;
+        }
+        // Update window
+        uint16_t wnd_to_update = _local_window_capacity / 4;
+        _sq_window_size.fetch_add(wnd_to_update, butil::memory_order_relaxed);
+        // Wake up writing thread right after every signaled sending cqe.
+        _socket->WakeAsEpollOut();

Review Comment:
   `_socket->WakeAsEpollOut` is called in both `IBV_WC_SEND` and `IBV_WC_RECV`, 
but each branch only has one condition. Shouldn't it activate only when both 
conditions are met?



-- 
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]

Reply via email to