Skip to content

Commit 731df43

Browse files
committed
src/usr/transport/tcp: Account for case where data arrives before we have buffer for it
Signed-off-by: Yan Burman <yanburman@users.noreply.github.com>
1 parent 1a69449 commit 731df43

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

src/usr/transport/tcp/xio_tcp_datapath.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3229,6 +3229,8 @@ int xio_tcp_rx_ctl_handler(struct xio_tcp_transport *tcp_hndl, int batch_nr)
32293229
int exit;
32303230
int count;
32313231

3232+
tcp_hndl->io_waiting_tasks = 0;
3233+
32323234
task = list_first_entry_or_null(&tcp_hndl->rx_list,
32333235
struct xio_task,
32343236
tasks_list_entry);
@@ -3355,6 +3357,10 @@ int xio_tcp_rx_ctl_handler(struct xio_tcp_transport *tcp_hndl, int batch_nr)
33553357
tcp_task->rxd.stage);
33563358
break;
33573359
}
3360+
3361+
if (tcp_task->rxd.tot_iov_byte_len)
3362+
tcp_hndl->io_waiting_tasks++;
3363+
33583364
task = list_first_entry(&task->tasks_list_entry,
33593365
struct xio_task, tasks_list_entry);
33603366
}

src/usr/transport/tcp/xio_tcp_management.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,9 @@ void xio_tcp_consume_ctl_rx(void *xio_tcp_hndl)
614614
} while (retval > 0 && count < RX_POLL_NR_MAX);
615615

616616
if (/*retval > 0 && */ tcp_hndl->tmp_rx_buf_len &&
617-
tcp_hndl->state == XIO_TRANSPORT_STATE_CONNECTED) {
617+
tcp_hndl->state == XIO_TRANSPORT_STATE_CONNECTED &&
618+
tcp_hndl->io_waiting_tasks) {
619+
tcp_hndl->io_waiting_tasks = 0;
618620
xio_context_add_event(tcp_hndl->base.ctx,
619621
&tcp_hndl->ctl_rx_event);
620622
}

src/usr/transport/tcp/xio_tcp_transport.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,8 @@ struct xio_tcp_transport {
366366
struct xio_ev_data disconnect_event;
367367
pid_t peer_pid;
368368
pid_t peer_tid;
369+
int io_waiting_tasks;
370+
uint32_t reserved;
369371
};
370372

371373
int xio_tcp_get_max_header_size(void);

0 commit comments

Comments
 (0)