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 7685C5A0268 for ; Thu, 5 Jan 2023 05:26:30 +0100 (CET) Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4NnYM8110gz4y0Q; Thu, 5 Jan 2023 15:26:28 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1672892788; bh=tHWc7tHDr/eCw+se3WTLUMYYbQ+/RkR7iw7lLb3qWGo=; h=From:To:Cc:Subject:Date:From; b=GDTjvRHUCvu9RI4cXHEuX5Rd234pIsoMVSYV0LNu9DSBNtmMt0ftMAtYyF8o3558l da+orK8ARVhV9LkHSiXZehA67jA7XjnpElhEvjRa76ze7/Ja6NfKr9EUzllxOx2TXC nEVtynGj2LpY3zLqpkR/WGNI/3PJN12MwPyCawvY= From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH v4 0/8] Don't use additional sockets for receiving "spliced" UDP communications Date: Thu, 5 Jan 2023 15:26:17 +1100 Message-Id: <20230105042625.1981812-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: UPOB57J2CNRDQY7AHITBX7J3TVHV5ZM7 X-Message-ID-Hash: UPOB57J2CNRDQY7AHITBX7J3TVHV5ZM7 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 v3: * Fixed really dumb compile error, and actually ran through the tests. Oops. 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 | 388 ++++++++++++++++++++++++++++++--------------------------- udp.h | 2 +- util.h | 7 ++ 3 files changed, 213 insertions(+), 184 deletions(-) -- 2.39.0