On 2024-04-23 20:48, David Gibson wrote:On Tue, Apr 23, 2024 at 07:50:10PM +0200, Stefano Brivio wrote:Yes. Although I moved it to tcp_conn_from_tap() in the next version, to make it more symmetric with the one in tcp_tap_conn_from_sock()On Sat, 20 Apr 2024 15:19:19 -0400 Jon Maloy <jmaloy(a)redhat.com> wrote:[snip] >> + set_peek_offset(s, 0); > Do we really need to initialise it to zero on a new connection? Extra > system calls on this path matter for latency of connection > establishment.Sort of, yes: we need to enable the SO_PEEK_OFF behaviour by setting it to 0, rather than the default -1. We could lazily enable it, but we'd need either to a) do it later in the handshake (maybe when we set ESTABLISHED), but we'd need to be careful it is always set before the first MSG_PEEK or b) keep track of whether it's set on a per-socket basis (this would have the advantage of robustness if we ever encountered a kernel that weirdly allows it for some but not all TCP sockets).