When the guest sends data on a TCP connection, it's possible that we run out of buffer space on the socket side. If that happens we'll advertise a zero window to the guest stopping it from sending. When the socket side buffer clears again, which is signalled by an EPOLLOUT, we recalculate the ack and window with tcp_update_seqack_wnd(). tcp_update_seqack_wnd() only calculates the new values, it doesn't actually send out the ack - that will typically happen some milliseconds later on the ACK_TO_TAP_DUE timer. AFAICT, there's not really any point delaying this ack though, we might as well send it and get the guest sending again ASAP. So, instead of calling tcp_update_seqack_wnd() call tcp_send_flag() to send an immediate ACK if needed. Signed-off-by: David Gibson <david(a)gibson.dropbear.id.au> --- tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcp.c b/tcp.c index ee894c5c..32e45e09 100644 --- a/tcp.c +++ b/tcp.c @@ -2240,7 +2240,7 @@ void tcp_sock_handler(const struct ctx *c, union epoll_ref ref, tcp_data_from_sock(c, conn); if (events & EPOLLOUT) - tcp_update_seqack_wnd(c, conn, false, NULL); + tcp_send_flag(c, conn, ACK_IF_NEEDED); return; } -- 2.46.0