From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202410 header.b=ici9B9FX; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 596925A061A for ; Fri, 25 Oct 2024 02:28:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202410; t=1729816079; bh=ySF6hra/nb1hIS0OwN8QqV/V4cxnUZ6frPgnviJCJTk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ici9B9FX4VoU6E9F60/GSKKP6TNKeuIzJFgh89IvZf1eesDEdC7I4yyMRT/+iw+1B k/apG/zOlf8+D38ov+r8K9eTbEQNOEl1KbGQGWG7I+KkONC0biY03zOpWIGs3EkT0G SkBzFdDGvUzbMha9yIrqPh1/gmEITCCkMUlq/VMRakUrhNPDuLBLoHAkQMD5OynD/q 3akR24Fc/G6jBgZKWbYE0+K1WWIzWo8ZpvWjAbApCqwIUR0G3EMyTt3w6io13EyYyo cyZoX4kO2tq7aHw+aS+sqM6IHGHwxWyczHFGk1OhtKJKpIRIoIrHlRmHjbj3yEMQqb rp8HUQXTeIaFQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4XZNsq6L69z4wyk; Fri, 25 Oct 2024 11:27:59 +1100 (AEDT) Date: Fri, 25 Oct 2024 11:21:59 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH] tcp_splice: fcntl(2) returns the size of the pipe, if F_SETPIPE_SZ succeeds Message-ID: References: <20241024230418.3192524-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LjalrYPyTKuPw+im" Content-Disposition: inline In-Reply-To: <20241024230418.3192524-1-sbrivio@redhat.com> Message-ID-Hash: RZLLIDZLNG5YQKZ6BZXZ74MUZKGNHDWK X-Message-ID-Hash: RZLLIDZLNG5YQKZ6BZXZ74MUZKGNHDWK 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: passt-dev@passt.top, Paul Holzinger 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: --LjalrYPyTKuPw+im Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 25, 2024 at 01:04:18AM +0200, Stefano Brivio wrote: > Don't report bogus failures (with --trace) just because the return > value is not zero. >=20 > Link: https://github.com/containers/podman/issues/24219 > Signed-off-by: Stefano Brivio I think this is technicall still not quite right, because F_SETPIPE_SZ can return a value larger than the one requested. AFAICT we don't get that just becauase the way we allocate pipe sizes and the way the kernel does are in alignment. But it suppresses a bogus error and doesn't do any harm so: Reviewed-by: David Gibson > --- > tcp_splice.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/tcp_splice.c b/tcp_splice.c > index f112cfe..93f8bce 100644 > --- a/tcp_splice.c > +++ b/tcp_splice.c > @@ -320,7 +320,7 @@ static int tcp_splice_connect_finish(const struct ctx= *c, > } > =20 > if (fcntl(conn->pipe[sidei][0], F_SETPIPE_SZ, > - c->tcp.pipe_size)) { > + c->tcp.pipe_size) !=3D (int)c->tcp.pipe_size) { > flow_trace(conn, > "cannot set %d->%d pipe size to %zu", > sidei, !sidei, c->tcp.pipe_size); > @@ -672,7 +672,7 @@ static void tcp_splice_pipe_refill(const struct ctx *= c) > continue; > =20 > if (fcntl(splice_pipe_pool[i][0], F_SETPIPE_SZ, > - c->tcp.pipe_size)) { > + c->tcp.pipe_size) !=3D (int)c->tcp.pipe_size) { > trace("TCP (spliced): cannot set pool pipe size to %zu", > c->tcp.pipe_size); > } --=20 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 --LjalrYPyTKuPw+im Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIyBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmca5KIACgkQzQJF27ox 2GeyhQ/4r0p+2/zX77LROZB0GGS4ex7DmYNxFdE5wpe8LAEvi+/W8JCIts4/ldG+ wXll2gj8mxun7JhRNXyH8oxGBZdGyWGPG7R40taTNfgYDYj5gOCZa0QMD/rw1uvs eKFaX9X5ogd86YEZpOfwvGz8LeeNhJDh+2pj6WcayU9WLJNgcERijysD/bUJ26hW 0F3LddfDJj7CReStVNoh+zQ5P3iv/8Dj5hwltU+eXrAG/lpHnhRVsQrlb0XQjeMe Yv+5+ZzA1XC6FKTwelJNa+tDOU4f4cRxN/yNhjo5AM/Th6+CdjH8Ydh9dK27uC08 s6bxNyGq9Autw9kQ+235pbW1ZtVvgnJWWSHH4M5CdflKo39x47tzH6l+IMA6DWOg tXsJqvQmH4iQqN/UxCCByHgjOS3I63nP4jvQRna6+00snn+7Ph4dbZPdJXlaF4bj BgmJ/KqPGxCl89SKxJjXlPJ+wngSSqVGAOF17zWhIdPWf9YrybOFybRV8fOkJnLs 0lU4QDSbuK0cbHKerhTyZ0ZFxMyZpV+NFtcLwSzKe7AfjfxTiOTClGXthI0pBZPQ ryL5vvOw0mTcHqvw+diehFrJWbJ7Z+a+mNkRx/S/aghVXFLDnSIZ566B4Z/vzLxf LmEl1FMG8lNo6GMvP0xdP+7Lkh+6b6ZFJ1R9pGk1Xc+JACcjUg== =hXHG -----END PGP SIGNATURE----- --LjalrYPyTKuPw+im--