aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2025-12-03 20:13:05 +0100
committerStefano Brivio <sbrivio@redhat.com>2025-12-08 09:15:36 +0100
commit28f413d0332c923f1a4a7a05359d90116cbcb4a3 (patch)
tree4401185143d049938d4e2466783eba07f3642b49
parent000601ba86da0d876fc91e0813a1e752540666f1 (diff)
downloadpasst-28f413d0332c923f1a4a7a05359d90116cbcb4a3.tar
passt-28f413d0332c923f1a4a7a05359d90116cbcb4a3.tar.gz
passt-28f413d0332c923f1a4a7a05359d90116cbcb4a3.tar.bz2
passt-28f413d0332c923f1a4a7a05359d90116cbcb4a3.tar.lz
passt-28f413d0332c923f1a4a7a05359d90116cbcb4a3.tar.xz
passt-28f413d0332c923f1a4a7a05359d90116cbcb4a3.tar.zst
passt-28f413d0332c923f1a4a7a05359d90116cbcb4a3.zip
tcp: Don't clear ACK_TO_TAP_DUE if we're advertising a zero-sized window
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 <sbrivio@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r--tcp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tcp.c b/tcp.c
index 4a886ae..d91db22 100644
--- a/tcp.c
+++ b/tcp.c
@@ -1282,7 +1282,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);