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 3D8085A026B for ; Wed, 4 Jan 2023 06:44:35 +0100 (CET) Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4Nmz7d2ZyBz4y0Q; Wed, 4 Jan 2023 16:44:29 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1672811069; bh=wpC7/ydMSEMQxAYGjLoIZI9X0BhkGQMn7LJin6a779M=; h=From:To:Cc:Subject:Date:From; b=UvzreFM8VFau2XYLGLdsR34bObCxKBvSmpfoL9p9UpKv2TH20Q9kzMUTdcRolDgFU 1/w5sGHm9WlPA3XM/Q4EA0NbXDLfHJs+kbMytkNryAvx55pViC5bpbdcbsSA+9S1Os DKzIjLt6R+C1y4cJig1wYxsoCNihmkHeuGIktSR8= From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH v3 0/8] Don't use additional sockets for receiving "spliced" UDP communications Date: Wed, 4 Jan 2023 16:44:18 +1100 Message-Id: <20230104054426.120668-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: UNRJ2CJT57MEX6LNKFGAF67NQGD7ZIMP X-Message-ID-Hash: UNRJ2CJT57MEX6LNKFGAF67NQGD7ZIMP 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: At present, the UDP "splice" and "tap" paths are quite separate. We have separate sockets to receive packets bound for the tap and splice paths. This leads to some code duplication, and extra open sockets. This series partially unifies the two paths, allowing us to use a single (host side) socket, bound to 0.0.0.0 or :: to receive packets for both cases. Changes since v2: * Don't receive multiple packets at once for pasta mode - seems to hurt throughput on balance. * Add some comments clarifying reasoning here. Changes since v1: * Renamed udp_localname[46] to udp[46]_localname * Allow handling of UDP port 0 * Fix a bug which could misidentify certain v6 packets as v4-spliceable * Some minor cosmetic fixes to code and commit messages David Gibson (8): udp: Move sending pasta tap frames to the end of udp_sock_handler() udp: Split sending to passt tap interface into separate function udp: Split receive from preparation and send in udp_sock_handler() udp: Don't handle tap receive batch size calculation within a #define udp: Pre-populate msg_names with local address udp: Unify udp_sock_handler_splice() with udp_sock_handler() udp: Decide whether to "splice" per datagram rather than per socket udp: Don't use separate sockets to listen for spliced packets udp.c | 389 ++++++++++++++++++++++++++++++--------------------------- udp.h | 2 +- util.h | 7 ++ 3 files changed, 214 insertions(+), 184 deletions(-) -- 2.39.0