From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 80D875A026A for ; Tue, 14 Feb 2023 00:48:28 +0100 (CET) Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4PG1Hr6JrKz4x5W; Tue, 14 Feb 2023 10:48:24 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1676332104; bh=DmrKfGPSpHBxfUDdIKD9lhNq07YtnAmrqGYdzqr3OJA=; h=From:To:Cc:Subject:Date:From; b=KRZwQ6L57ZWJd8g7UJI5RlqC6ccqTlJxbSykAtuzQL+Scc+yJ3eV/a4iBL29y57uG KxBwu9D9VbD6A1rfvFr/rKvMyVv1qbbMRhnQ/7gJyz/fFk0N8IEHEHa0cz9kVs035/ WCD9cT1TB8lx+ECvymtNGalyXW1WErXfJCe/Qemg= From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH v2 0/5] Cleanups to tcp socket pool handling Date: Tue, 14 Feb 2023 10:48:18 +1100 Message-Id: <20230213234823.749379-1-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.39.1 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: SMDJI6TMQAYCWDJ3YL4RZRNILCCGQWUI X-Message-ID-Hash: SMDJI6TMQAYCWDJ3YL4RZRNILCCGQWUI 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). Changes since v1: * Rebased * Improved wording of some commit messages 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.1