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 9A4D15A026B for ; Mon, 9 Jan 2023 01:50:34 +0100 (CET) Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4NqwN50ChGz4xwt; Mon, 9 Jan 2023 11:50:29 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1673225429; bh=yuoGX6q+IaGRrA4P5uJ2M7H9QP/SvCJBU0TAPcbSR6E=; h=From:To:Cc:Subject:Date:From; b=L5OYiux7TDxpKGq7XMXWubyhBodQpbBQIvrkN8hcdvRfpyztuIk5pWL9M0poBd0lB 6PrS5qjB+893bo3gZ8WmMzMfitGvr5e/WDSDr7r+OSpIIpsGEiA1MAt9Tk+/Fufe+b Xubd+LwHHO7DowJyRqFb7H6a0C6HwSGQQ5bPa39w= From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH 0/5] Cleanups to tcp socket pool handling Date: Mon, 9 Jan 2023 11:50:21 +1100 Message-Id: <20230109005026.24512-1-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.39.0 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: HGQCISIQBW4CQRD7HZHXHP2K7DN3NK5X X-Message-ID-Hash: HGQCISIQBW4CQRD7HZHXHP2K7DN3NK5X 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: David Gibson 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: This is a bit of a diversion from what I'm notionally working on at the moment. While thinking about what we'd need to use the IP_TRANSPARENT socket option to broaden the cases where we can "splice", I noticed some inelegancies in how we handle the pool of pre-opened sockets in the TCP code, and well, here we are. This makes a number of cleanups to the handling of these pools. Most notably, tcp_splice_connect() now has simpler semantics: it now always runs in the init namespace, and is always given a pre-opened socket (which could be in the guest ns). David Gibson (5): tcp: Make a helper to refill each socket pool tcp: Split init and ns cases for tcp_sock_refill() tcp: Move socket pool declarations around tcp: Split pool lookup from creating new sockets in tcp_conn_new_sock() tcp: Improve handling of fallback if socket pool is empty on new splice tcp.c | 138 ++++++++++++++++++------------------------------- tcp.h | 2 - tcp_conn.h | 12 ++++- tcp_splice.c | 141 ++++++++++++++++++++++++++------------------------- 4 files changed, 132 insertions(+), 161 deletions(-) -- 2.39.0