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 1CDC55A005E for ; Mon, 5 Dec 2022 09:14:33 +0100 (CET) Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4NQbtY2yw6z4xQr; Mon, 5 Dec 2022 19:14:29 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1670228069; bh=G8ybpmP7fpcMD5Nzdp3EDU0lq5j5/sjST0wUS4CM6LE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hl9e7xBgm1aL910qeOzzTPzIf8gCxxnb3K5lB/dScUqYc3F0NnCLlBWFYlDVKSiWe cLcsSTiROCul8ESTdlxIpN1BiVUoVdAy1T5cVUc+IcRXj7kCAEYJx+xwAmKCvleHXp QRn2/MV/ex2cUZ5RoUOOpAs6NsIVj3C9S6mpZBy0= From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH 4/8] udp: Receive multiple datagrams at once on the pasta sock->tap path Date: Mon, 5 Dec 2022 19:14:21 +1100 Message-Id: <20221205081425.2614425-5-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221205081425.2614425-1-david@gibson.dropbear.id.au> References: <20221205081425.2614425-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: KGI6HUKQCSVAWL6S4LOYONQJBYZTSFB5 X-Message-ID-Hash: KGI6HUKQCSVAWL6S4LOYONQJBYZTSFB5 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: Usually udp_sock_handler() will receive and forward multiple (up to 32) datagrams in udp_sock_handler(), then forward them all to the tap interface. For unclear reasons, though, when in pasta mode we will only receive and forward a single datagram at a time. Change it to receive multiple datagrams at once, like the other paths. Signed-off-by: David Gibson --- udp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/udp.c b/udp.c index 64c9219..24fa984 100644 --- a/udp.c +++ b/udp.c @@ -119,7 +119,6 @@ #define UDP_CONN_TIMEOUT 180 /* s, timeout for ephemeral or local bind */ #define UDP_MAX_FRAMES 32 /* max # of frames to receive at once */ -#define UDP_TAP_FRAMES (c->mode == MODE_PASST ? UDP_MAX_FRAMES : 1) /** * struct udp_tap_port - Port tracking based on tap-facing source port @@ -968,7 +967,7 @@ void udp_sock_handler(const struct ctx *c, union epoll_ref ref, uint32_t events, else sock_mmh = udp4_l2_mh_sock; - n = recvmmsg(ref.r.s, sock_mmh, UDP_TAP_FRAMES, 0, NULL); + n = recvmmsg(ref.r.s, sock_mmh, UDP_MAX_FRAMES, 0, NULL); if (n <= 0) return; -- 2.38.1