From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 902935A027D for ; Wed, 21 Feb 2024 22:45:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1708551955; bh=2GhU/7CxQMddXYeh9r/GmufVrsTEqRKYbKvjG63UycQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZZrVOi+TKzOuYEyi9i5nZwkvrctTuJyrt+0IU++7yuhTiqV3vOWTwxI0zuAy/c4EZ WYOohzS33A2erKl8fef7vV7Ui3iWIkQRmkmjFDoAY8S9r5EhL/u5HN1ElmkUrqf5E3 uE8YQ8o1zCIKBHy7i1q09ulHHYoIQhkw3LY3nMOR2L4TRfjBSugoaIh9bniww40xLo LDRI1BKv2ahpRBLN2llSgSPjvQrRZvfeE0FAbb49nYrR2p7+abBJTPGVTKhjrddnd/ zA3VvG9+JJqfFqyK9Ur90Uzs769rcQfAaRitm5ka/6/Z7nNEJU8IIG1bKgxC9heqdn JqDE1F143t6kg== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4Tg8wM11ssz4wyj; Thu, 22 Feb 2024 08:45:55 +1100 (AEDT) Date: Thu, 22 Feb 2024 08:45:51 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH 6/6] tcp: Don't store errnos in socket pool Message-ID: References: <20240219075651.1360229-1-david@gibson.dropbear.id.au> <20240219075651.1360229-7-david@gibson.dropbear.id.au> <20240221220934.7e258e31@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="51tSyood7NQ72d2M" Content-Disposition: inline In-Reply-To: <20240221220934.7e258e31@elisabeth> Message-ID-Hash: R35G7L23ITPDUDLQWBBUKGTOEZUUNDZZ X-Message-ID-Hash: R35G7L23ITPDUDLQWBBUKGTOEZUUNDZZ 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 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: --51tSyood7NQ72d2M Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 21, 2024 at 10:09:34PM +0100, Stefano Brivio wrote: > On Mon, 19 Feb 2024 18:56:51 +1100 > David Gibson wrote: >=20 > > If tcp_sock_refill_pool() gets an error opening new sockets, it stores = the > > negative errno of that error in the socket pool. This isn't especially > > useful: > > * It's inconsistent with the initial state of the pool (all -1) > > * It's inconsistent with the state of an entry that was valid and was > > then consumed (also -1) > > * By the time we did anything with this error code, it's now far remo= ved > > from the situation in which the error occurred, making it difficult= to > > report usefully > >=20 > > We now have error reporting closer to when failures happen on the refill > > paths, so just leave a pool slot we can't fill as -1. > >=20 > > Signed-off-by: David Gibson > > --- > > tcp.c | 6 ++++-- > > 1 file changed, 4 insertions(+), 2 deletions(-) > >=20 > > diff --git a/tcp.c b/tcp.c > > index 34e32641..27865691 100644 > > --- a/tcp.c > > +++ b/tcp.c > > @@ -3039,11 +3039,13 @@ int tcp_sock_refill_pool(const struct ctx *c, i= nt pool[], sa_family_t af) > > int i; > > =20 > > for (i =3D 0; i < TCP_SOCK_POOL_SIZE; i++) { > > + int fd; >=20 > Usual newline between declaration and code. Rest of the series looks > good to me, same as 4/6, if you agree I can fix it up, or respin, you > choose. Oops. Go ahead and fix on merge, please. --=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 --51tSyood7NQ72d2M Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmXWbw4ACgkQzQJF27ox 2GdOIRAAorsO8pFzVB1ZoeZFB8ktBVhVokqe0hSFMeCajghnYVvBuok+F1fh8tFO sK04wpLEE03tYzIVeWVqy9rQSgOLF5Zl8vw7DGRJU6mKb4C2pf+YigWFvHx5COzh NtpLD/AyyuX6IdQLtl/EhQP470uwlC7dcgKEX48aFHA0hKkiaidMU+OlCM5wxGUA 6bIBFZV6LOe/a3wFT/a5GQe73rgtjL6I5gMBsQ58Lk1q8OmMh0qV5xQXWtwt9gvp /g0sfGfBcXdBYDbG0ttAz0z8XaK6o5q4UwidVUvk0n66fA1jJqdjFIER+dJ8lkdW 95z3XlmyELtfz9wd2qexWQaHGbOwiMC+8OgrtoAi6HAI4DakQIf/5HhNJGPq/rvh KG4WrnNhgH0HsuB9F4Q789hrg3TivIor2o66cVOQWeoDih0puQg4OG+DfGP9xNKx 3HzY1MoHoiS/M7bqwrPJSBfNSIdXnMVpQWsHMoJ9kxeVzp2H4SiXxdejVmT3jMt6 EqC85VSCQnuZ0JxRogP4z2yo2rlyAAoB0VJRNPORJX0bkWPO0PnoO9OGU3rMktUB iIGtC4RuzyHYTIRB3wjLZK0S1EWoAPY9MLrfNJ786sj7EExjtxqimE2f/rDR+YHH +RN0ipOrG/xE6Cpn/2ZfGSQsqqGi2GQFM7I/lx2uSws1X3CWa3c= =sg7+ -----END PGP SIGNATURE----- --51tSyood7NQ72d2M--