aboutgitcodebugslistschat
path: root/tcp_conn.h
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2023-11-09 20:54:00 +1100
committerStefano Brivio <sbrivio@redhat.com>2023-11-10 06:42:19 +0100
commitcf3eeba6c0d7c7b33824b6e1c53f14dcb90437ae (patch)
tree62a39b88ff24f392aab0c2a91f9a57c86426a9f1 /tcp_conn.h
parent930bc3b0f2d2078747172e960807c84a8cd97495 (diff)
downloadpasst-cf3eeba6c0d7c7b33824b6e1c53f14dcb90437ae.tar
passt-cf3eeba6c0d7c7b33824b6e1c53f14dcb90437ae.tar.gz
passt-cf3eeba6c0d7c7b33824b6e1c53f14dcb90437ae.tar.bz2
passt-cf3eeba6c0d7c7b33824b6e1c53f14dcb90437ae.tar.lz
passt-cf3eeba6c0d7c7b33824b6e1c53f14dcb90437ae.tar.xz
passt-cf3eeba6c0d7c7b33824b6e1c53f14dcb90437ae.tar.zst
passt-cf3eeba6c0d7c7b33824b6e1c53f14dcb90437ae.zip
tcp: Don't use TCP_WINDOW_CLAMP
On the L2 tap side, we see TCP headers and know the TCP window that the ultimate receiver is advertising. In order to avoid unnecessary buffering within passt/pasta (or by the kernel on passt/pasta's behalf) we attempt to advertise that window back to the original sock-side sender using TCP_WINDOW_CLAMP. However, TCP_WINDOW_CLAMP just doesn't work like this. Prior to kernel commit 3aa7857fe1d7 ("tcp: enable mid stream window clamp"), it simply had no effect on established sockets. After that commit, it does affect established sockets but doesn't behave the way we need: * It appears to be designed only to shrink the window, not to allow it to re-expand. * More importantly, that commit has a serious bug where if the setsockopt() is made when the existing kernel advertised window for the socket happens to be zero, it will now become locked at zero, stopping any further data from being received on the socket. Since this has never worked as intended, simply remove it. It might be possible to re-implement the intended behaviour by manipulating SO_RCVBUF, so we leave a comment to that effect. This kernel bug is the underlying cause of both the linked passt bug and the linked podman bug. We attempted to fix this before with passt commit d3192f67 ("tcp: Force TCP_WINDOW_CLAMP before resetting STALLED flag"). However while that commit masked the bug for some cases, it didn't really address the problem. Fixes: d3192f67c492 ("tcp: Force TCP_WINDOW_CLAMP before resetting STALLED flag") Link: https://github.com/containers/podman/issues/20170 Link: https://bugs.passt.top/show_bug.cgi?id=74 Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp_conn.h')
-rw-r--r--tcp_conn.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/tcp_conn.h b/tcp_conn.h
index 01d31d4..0c6a35b 100644
--- a/tcp_conn.h
+++ b/tcp_conn.h
@@ -85,10 +85,9 @@ struct tcp_tap_conn {
uint8_t flags;
#define STALLED BIT(0)
#define LOCAL BIT(1)
-#define WND_CLAMPED BIT(2)
-#define ACTIVE_CLOSE BIT(3)
-#define ACK_TO_TAP_DUE BIT(4)
-#define ACK_FROM_TAP_DUE BIT(5)
+#define ACTIVE_CLOSE BIT(2)
+#define ACK_TO_TAP_DUE BIT(3)
+#define ACK_FROM_TAP_DUE BIT(4)
#define TCP_MSS_BITS 14