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 373FD5A005E for ; Fri, 25 Nov 2022 10:23:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669368189; 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=f1tDAWTRw7XrlPt+0IGj6JZ7wSlzPZoBx19WsQZlpqc=; b=En8MLto/AwUKeCnPQgEJFG8fftCcIP7x4ExZAQJiWKus/lC2ScQAc8laWLyuDBjOEfH5GH qm5UD4RM0tNsf1peXTdyDtrx9x7i+c2NxV2z1TqGStbg2tvZj9JlRB7IEfpBygAkkL5qVd GcY0RjMgjBryKh4SfXaStWHf2lWWBjo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-21-vvnRUtzHN_-XqJl7wT_Y3Q-1; Fri, 25 Nov 2022 04:23:07 -0500 X-MC-Unique: vvnRUtzHN_-XqJl7wT_Y3Q-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EA1AA1871D97; Fri, 25 Nov 2022 09:23:06 +0000 (UTC) Received: from maya.cloud.tilaa.com (ovpn-208-30.brq.redhat.com [10.40.208.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 902EE2024CBE; Fri, 25 Nov 2022 09:23:06 +0000 (UTC) Date: Fri, 25 Nov 2022 10:22:57 +0100 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH v2 00/32] Use dual stack sockets to listen for inbound TCP connections Message-ID: <20221125102257.2df576c5@elisabeth> In-Reply-To: <20221117055908.2782981-1-david@gibson.dropbear.id.au> References: <20221117055908.2782981-1-david@gibson.dropbear.id.au> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: Y3FKGVDXTC4XWDO6Q7RW5XSQEXUPR3RS X-Message-ID-Hash: Y3FKGVDXTC4XWDO6Q7RW5XSQEXUPR3RS 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 Thu, 17 Nov 2022 16:58:36 +1100 David Gibson wrote: > When forwarding many ports, passt can consume a lot of kernel memory > because of the many listening sockets it opens. There are not a lot > of ways we can reduce that, but here's one. > > Currently we create separate listening sockets for each port for both > IPv4 and IPv6. However in Linux (and probably other platforms), it's > possible to listen for both IPv4 and IPv6 connections on an IPv6 > socket. This series uses such dual stack sockets to halve the number > of listening sockets needed for TCP. When forwarding all TCP and UDP > ports, this reduces the kernel memory used from around 677 MiB to > around 487 MiB (kernel 6.0.8 on an x86_64 Fedora 37 machine). Applied, thanks! -- Stefano