On Thu, Dec 04, 2025 at 08:45:36AM +0100, Stefano Brivio wrote: > We correctly avoid doing that at the beginning of tcp_prepare_flags(), > but we might clear the flag later on if we actually end up sending a > "flag" segment. > > Make sure we don't, otherwise we might delay window updates after a > zero-window condition significantly, and significantly affect > throughput. > > In some cases, we're forcing peers to send zero-window probes or > keep-alive segments. > > Signed-off-by: Stefano Brivio Reviewed-by: David Gibson > --- > tcp.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/tcp.c b/tcp.c > index b00b874..e4c5a5b 100644 > --- a/tcp.c > +++ b/tcp.c > @@ -1285,7 +1285,8 @@ int tcp_prepare_flags(const struct ctx *c, struct tcp_tap_conn *conn, > th->fin = !!(flags & FIN); > > if (th->ack) { > - if (SEQ_GE(conn->seq_ack_to_tap, conn->seq_from_tap)) > + if (SEQ_GE(conn->seq_ack_to_tap, conn->seq_from_tap) && > + conn->wnd_to_tap) > conn_flag(c, conn, ~ACK_TO_TAP_DUE); > else > conn_flag(c, conn, ACK_TO_TAP_DUE); > -- > 2.43.0 > -- David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson