From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTP id BB2E75A027D for ; Wed, 21 Feb 2024 22:10:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708549813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eKSqsm5BM1aGypZgLL3sIw8bT32cIkuoM3kuOcXmM8c=; b=GO0Or34r03nFTHMYQvzIRLxlnjwQaI0SPmFgF2QDni226e7hFNduhU3dYwLV0Up2buQ40A D4TH7sNzGH3oubFBjnFwJy0vcAequjpwriaDMahU2Nvc1SrdBlp9Tlk1ZEsPK+4bpUwvV+ crvvMMZulb+SsZgM2QU4EJysIPGmjQ0= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-184-_TqWM1j7PQOnss9yix7NvA-1; Wed, 21 Feb 2024 16:10:11 -0500 X-MC-Unique: _TqWM1j7PQOnss9yix7NvA-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-a3f07bcba8cso65780566b.3 for ; Wed, 21 Feb 2024 13:10:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708549809; x=1709154609; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=eKSqsm5BM1aGypZgLL3sIw8bT32cIkuoM3kuOcXmM8c=; b=YNcRIyctnmNd45uJ4OmKICd1QJE2LDI/Fia6okRu/axpNILnxi6KlimTn0FWLUlMx1 5v0uDYRnsiq9+iYq5C7qoAI2ges/bA3+59QH42fES1/d96ZFTZ9cgdftsQuXeCVX5pYZ XPK6l6jwb9EJuhjdSQM3u5SA1jy3MO28/+gk3Z84CfN8zKWWzdbAgtB7lT7qMi2ZSPgF qCeKG/7MJIPXsWls1frYBOWBRW4msCkWi/YCFJ3KwhQ0ePVoEAyzhQzoz2EsSpmdG6mR gCrQ7PmepzWjTUXMGp7CtAD0PPb15mLOlUvf6RAcLUDI6pz8RCWKO+JjQ58h6w/PeCHb eOEw== X-Gm-Message-State: AOJu0Yw00qBtNjjXd0l4/+uoep4LVxoVSw+j4TkhR207iGL12yIIDAD+ YZrCgQc6TutiSaYyqXByL2kQOUa/8h7eIIoeIpnhedW40TgVkUwN9hPCQ6DPFsksZUEf0OAERBC /fxL2hYzri3FZIUZSSTzmvzS59s65h2js5z9vPagv9eJbT4spXD2UoO9RjVt/ X-Received: by 2002:a17:906:4a93:b0:a3e:5726:c12 with SMTP id x19-20020a1709064a9300b00a3e57260c12mr7191996eju.37.1708549809665; Wed, 21 Feb 2024 13:10:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IGwyzeuuUbRVhmmqohE6dMk2LuEXseCHss+sFDgHUp99qgfP4O4t6l6DRU+AzTAeDuLEeLOUg== X-Received: by 2002:a17:906:4a93:b0:a3e:5726:c12 with SMTP id x19-20020a1709064a9300b00a3e57260c12mr7191989eju.37.1708549809413; Wed, 21 Feb 2024 13:10:09 -0800 (PST) Received: from maya.cloud.tilaa.com (maya.cloud.tilaa.com. [164.138.29.33]) by smtp.gmail.com with ESMTPSA id hw18-20020a170907a0d200b00a3df0de677dsm5271517ejc.192.2024.02.21.13.10.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2024 13:10:08 -0800 (PST) Date: Wed, 21 Feb 2024 22:09:34 +0100 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 6/6] tcp: Don't store errnos in socket pool Message-ID: <20240221220934.7e258e31@elisabeth> In-Reply-To: <20240219075651.1360229-7-david@gibson.dropbear.id.au> References: <20240219075651.1360229-1-david@gibson.dropbear.id.au> <20240219075651.1360229-7-david@gibson.dropbear.id.au> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.36; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: NU5L4PTDHKHNEA3KYPEWEUTQWDSVM7EP X-Message-ID-Hash: NU5L4PTDHKHNEA3KYPEWEUTQWDSVM7EP X-MailFrom: sbrivio@redhat.com 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: On Mon, 19 Feb 2024 18:56:51 +1100 David Gibson wrote: > 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 removed > from the situation in which the error occurred, making it difficult to > report usefully > > 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. > > Signed-off-by: David Gibson > --- > tcp.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > 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, int pool[], sa_family_t af) > int i; > > for (i = 0; i < TCP_SOCK_POOL_SIZE; i++) { > + int fd; 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. -- Stefano