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.129.124]) by passt.top (Postfix) with ESMTP id 2B1F65A005E for ; Thu, 12 Jan 2023 19:09:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673546966; 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=vJXGTsIsWRyf3rHT6O8GhWZrLxk6asRL5x7qypH8bpM=; b=WdIX5/0rZbreSPJMsf5C6UdUno0w8g5M859As9O8tTkLahAHBwSx4TaOcekYputU8ONQsI AeVUzLLpg4oiSpxThAv1f+CmjOdVPSFHWloBLA+P52wap7qbuurqOwzO5hZv4dVFqb2/uZ kn96IJUx4hjsemeHg+uzzkwGVio7v60= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-625-xYpQwrreMfarOOBpYBz2Gw-1; Thu, 12 Jan 2023 13:09:25 -0500 X-MC-Unique: xYpQwrreMfarOOBpYBz2Gw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BA6E11C0A595; Thu, 12 Jan 2023 18:09:24 +0000 (UTC) Received: from maya.cloud.tilaa.com (ovpn-208-4.brq.redhat.com [10.40.208.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 78EB5140EBF6; Thu, 12 Jan 2023 18:09:24 +0000 (UTC) Date: Thu, 12 Jan 2023 19:09:21 +0100 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 1/5] tcp: Make a helper to refill each socket pool Message-ID: <20230112190921.7a6bf18c@elisabeth> In-Reply-To: <20230109005026.24512-2-david@gibson.dropbear.id.au> References: <20230109005026.24512-1-david@gibson.dropbear.id.au> <20230109005026.24512-2-david@gibson.dropbear.id.au> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: NT5OUMZ6APIUMBRQM7GR4LRFQLSRW2QM X-Message-ID-Hash: NT5OUMZ6APIUMBRQM7GR4LRFQLSRW2QM 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.3 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, 9 Jan 2023 11:50:22 +1100 David Gibson wrote: > tcp_sock_refill() contains two near-identical loops to refill the IPv4 > and IPv6 socket pools. In addition, if we get an error on the IPv4 pool > we exit early and won't attempt to refill the IPv6 pool. That doesn't seem > sensible, since these are essentially completely independent, and there > may be value to filling up either one without the other. Well, for the purposes of the single error condition that's checked there, they're not independent, in practice: if we just had a socket number that's too high, the next one will be, too. This is not formally guaranteed, though. In any case, this is indeed more elegant, and also drops a 'return -EIO' which doesn't really match the "Return: 0" comment. -- Stefano