Copilot commented on code in PR #3137:
URL: https://github.com/apache/brpc/pull/3137#discussion_r2492591693
##########
src/brpc/rdma/rdma_endpoint.cpp:
##########
@@ -938,7 +971,9 @@ ssize_t RdmaEndpoint::HandleCompletion(ibv_wc& wc) {
bool zerocopy = FLAGS_rdma_recv_zerocopy;
switch (wc.opcode) {
case IBV_WC_SEND: { // send completion
- // Do nothing
+ if (wc.wr_id == 0) {
Review Comment:
The condition checks if `wc.wr_id == 0`, but `GenerateWrId()` explicitly
generates non-zero IDs (comment at line 930 states '0 is an invalid Id'). The
signaled WRs in `CutFromIOBufList` at line 880 don't set `wr.wr_id`, leaving it
as 0 after `memset` at line 808. This logic appears inverted - it should
decrement when `wc.wr_id != 0` (for SendImm) or the counter should be
incremented for signaled sends in `CutFromIOBufList` that have `wr_id == 0`.
```suggestion
if (wc.wr_id != 0) {
```
--
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]