|
|
|
@ -492,13 +492,9 @@ void osd_messenger_t::handle_rdma_events() |
|
|
|
|
if (!is_send) |
|
|
|
|
{ |
|
|
|
|
rc->cur_recv--; |
|
|
|
|
if (!handle_read_buffer(cl, rc->recv_buffers[rc->next_recv_buf], wc[i].byte_len)) |
|
|
|
|
{ |
|
|
|
|
// handle_read_buffer may stop the client
|
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
try_recv_rdma_wr(cl, rc->recv_buffers[rc->next_recv_buf]); |
|
|
|
|
rc->next_recv_buf = (rc->next_recv_buf+1) % rc->recv_buffers.size(); |
|
|
|
|
rdma_handle_buffers.push_back((rdma_hb_t){ .peer_fd = client_id, .buf = rc->recv_buffers[0], .len = wc[i].byte_len }); |
|
|
|
|
rc->recv_buffers.erase(rc->recv_buffers.begin(), rc->recv_buffers.begin()+1); |
|
|
|
|
try_recv_rdma(cl); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
@ -547,6 +543,16 @@ void osd_messenger_t::handle_rdma_events() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} while (event_count > 0); |
|
|
|
|
for (auto & hb: rdma_handle_buffers) |
|
|
|
|
{ |
|
|
|
|
auto cl_it = clients.find(hb.peer_fd); |
|
|
|
|
if (cl_it != clients.end()) |
|
|
|
|
{ |
|
|
|
|
handle_read_buffer(cl_it->second, hb.buf, hb.len); |
|
|
|
|
} |
|
|
|
|
free(hb.buf); |
|
|
|
|
} |
|
|
|
|
rdma_handle_buffers.clear(); |
|
|
|
|
for (auto cb: set_immediate) |
|
|
|
|
{ |
|
|
|
|
cb(); |
|
|
|
|