From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id D153C5A026E for ; Wed, 24 Apr 2024 02:48:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1713919691; bh=Hi4VFWeUXtAb5n7WBcVuwwtNhe8Q76e8bo86Ezmt+lE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Rlu5L1YnuRXWPzZretcgvAPelVvXeERpMPXHnTGoSUxStk055ES87lad3G/FYpGlq Yj1jY73LcNoBp3P4T/8PQyVr6pUXfz4iyXXRMsLmovOob9MspIn0EwLin6OHnJWvIs WEFnNijSsqZZVqllekOvhOXxVe0BaEIU9b5eHCNNOMtdYtWsdZxroudXDIKF3i1F4o 7XUCuxSRszgzlQ1Bmi84ab3CAGF0PatmDwWbcl2X/67L0+U1jWcScZQceVlWiAAk6t B7dvfjmd2YYJmbG+5AH+oDnaZ+wc8w/iOcMPMvJMkhjmAxk0Av56D6jPPWy4qXWVHe 8OFvy2MUTJSvA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4VPL234Xvgz4wyj; Wed, 24 Apr 2024 10:48:11 +1000 (AEST) Date: Wed, 24 Apr 2024 10:48:05 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH 1/2] tcp: leverage support of SO_PEEK_OFF socket option when available Message-ID: References: <20240420191920.104876-1-jmaloy@redhat.com> <20240420191920.104876-2-jmaloy@redhat.com> <20240423195010.2b4d5c13@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="W8ZZJY8rXtq+KUZO" Content-Disposition: inline In-Reply-To: <20240423195010.2b4d5c13@elisabeth> Message-ID-Hash: FJQJIZCV2DYN6YERDZ4WV6FCJ27YI76S X-Message-ID-Hash: FJQJIZCV2DYN6YERDZ4WV6FCJ27YI76S X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Jon Maloy , passt-dev@passt.top, lvivier@redhat.com, dgibson@redhat.com X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --W8ZZJY8rXtq+KUZO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 23, 2024 at 07:50:10PM +0200, Stefano Brivio wrote: > On Sat, 20 Apr 2024 15:19:19 -0400 > Jon Maloy wrote: [snip] > > + set_peek_offset(s, 0); >=20 > 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). --=20 David Gibson | 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 --W8ZZJY8rXtq+KUZO Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmYoVsQACgkQzQJF27ox 2GflgA//fi8Oycaw53u/udPnEtPcthZIgnfTeChZcXllrw12zpAALX5Ry6nTPx99 A7WWuQTuM8d0tSxRiip31WD2nkKfBDujl42bVAlEz9LKx/3LoKt42NKFqGI/ZkfN e27e5SaNYlCn3e+F0zZOaBag2LCqqBkY+7sw4WU+M7nPPpTecJY3c6EiHjhD2KaO NudveY5tgVPD7AdzPXreGkoTLW7Xoi0XvQVhwetihrzog9kg4HvkhvqLq3e0hWqs vZIHBQkirzTzABNEQR7aM/3C/r6oRjgpBJCXKsj4vu/uJo87o4Xzq239LHmKIFGl RdFsuYlgUXnIc7wgVf2e9J1qz+XtPrD7buqwR482jHWeNlPnDx9ApanBPPr3Yw6o 932UjreBAsAVjNobdrXTifAC0jRiAtxE0dB3bl1NGywF2vnIY4Sx+kJl4dei4zXe X625Ith7EeKZqyoYgQmK4kr0mt3okyz61jL1SvNBmeYyq7mAerMYfSfGt4OzERxU 9rcanfxDzwFp5TQBvHH5uIYUbqBJRK1GbR6Qbjz+17/X0OZyApFxvdkPyUtbr6Tg jm6h4XdgNFcvxMnQZojExifXzG9BuUJR+oYsa2oWP/g2qhyweVSW6IDCNMiWHyEK Smtpb0HJ5/8Suja7bfR71BnCgjaMWmc73/vral1Q7jdOQ1kjiFQ= =jjWR -----END PGP SIGNATURE----- --W8ZZJY8rXtq+KUZO--