Do not use too small end of the RDMA send buffer
This commit is contained in:
@@ -590,7 +590,36 @@ void osd_messenger_t::try_send_rdma(osd_client_t *cl)
|
|||||||
while (!rc->send_out_full && copied > 0 && rc->cur_send < rc->max_send)
|
while (!rc->send_out_full && copied > 0 && rc->cur_send < rc->max_send)
|
||||||
{
|
{
|
||||||
dst = (uint8_t*)rc->send_out.buf + rc->send_out_pos;
|
dst = (uint8_t*)rc->send_out.buf + rc->send_out_pos;
|
||||||
dst_len = (rc->send_out_pos < rc->send_out_size ? rc->send_out_size-rc->send_out_pos : rc->send_done_pos-rc->send_out_pos);
|
if (rc->send_out_pos >= rc->send_done_pos)
|
||||||
|
{
|
||||||
|
dst_len = rc->send_out_size-rc->send_out_pos;
|
||||||
|
if (dst_len < 4096)
|
||||||
|
{
|
||||||
|
// free end of the buffer is too small, skip
|
||||||
|
rc->send_out_pos = 0;
|
||||||
|
if (rc->send_out_pos >= rc->send_done_pos)
|
||||||
|
rc->send_out_full = true;
|
||||||
|
if (!rc->send_sizes.size())
|
||||||
|
{
|
||||||
|
rc->send_done_pos += dst_len;
|
||||||
|
rc->send_out_full = false;
|
||||||
|
if (rc->send_done_pos == rc->send_out_size)
|
||||||
|
rc->send_done_pos = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
rc->send_sizes.back() += dst_len;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dst_len = rc->send_done_pos-rc->send_out_pos;
|
||||||
|
if (dst_len < 4096)
|
||||||
|
{
|
||||||
|
// too small buffer, stop
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (dst_len > rc->max_msg)
|
if (dst_len > rc->max_msg)
|
||||||
dst_len = rc->max_msg;
|
dst_len = rc->max_msg;
|
||||||
copied = copy_ops_to(cl, dst, dst_len);
|
copied = copy_ops_to(cl, dst, dst_len);
|
||||||
|
|||||||
Reference in New Issue
Block a user