From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 64C165A0277 for ; Fri, 14 Jun 2024 08:14:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1718345632; bh=Fs1RQkf60E7CQOh1IPKP4LMeqw4dMalI2FJHIWTXEGo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rPhJKo0RcGtHxaAR3tusCaDEoTHJe43W+BgUZNnoDqSug8yDBiRTcdcYEbvNvD0cv PMZmidZKu8jaW5OuwbiSajHyV3n0vfX3lB327ykUvPcfblWH1Dd6iiFXoz2E4ylKww gXmAdfZEfC01UYiAy6mdmB8h5RPfcMRfi6qLRCFZiyx05Fq8Y1XxtLvtkqtMP1ci08 x4u0KtuNA3oueVr1J8Dtv5YcGbjNAhj4vUT3qUJ4HaJ6PJACNRlsKaEQBjWqFfU+vb yxP/ozG8Iy7gVBd8ujk4v8mmlZJRpf1PVD/wiQEZI7OpECAP5EJA/ykgK8POk23p0F df6cLmGQajAog== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4W0prJ3zwgz4x2P; Fri, 14 Jun 2024 16:13:52 +1000 (AEST) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH v6 26/26] udp: Eliminate 'splice' flag from epoll reference Date: Fri, 14 Jun 2024 16:13:48 +1000 Message-ID: <20240614061348.3814736-27-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240614061348.3814736-1-david@gibson.dropbear.id.au> References: <20240614061348.3814736-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: 4ZTHQ3MWUAAVJVBQMTMEUNXLP6ENMOYF X-Message-ID-Hash: 4ZTHQ3MWUAAVJVBQMTMEUNXLP6ENMOYF 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: jmaloy@redhat.com, David Gibson X-Mailman-Version: 3.3.8 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: We no longer check the 'splice' flag in the UDP epoll reference. Instead, we determine whether a datagram needs to be spliced from the pifs in the flow table. So, eliminate this field. Signed-off-by: David Gibson --- udp.c | 5 ++--- udp.h | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/udp.c b/udp.c index c170b0be..1789a572 100644 --- a/udp.c +++ b/udp.c @@ -350,7 +350,7 @@ int udp_splice_new(const struct ctx *c, int v6, in_port_t src, bool ns) { struct epoll_event ev = { .events = EPOLLIN | EPOLLRDHUP | EPOLLHUP }; union epoll_ref ref = { .type = EPOLL_TYPE_UDP, - .udp = { .splice = true, .v6 = v6, .port = src } + .udp = { .v6 = v6, .port = src } }; struct udp_bound_port *sp; int act, s; @@ -989,8 +989,7 @@ int udp_tap_handler(const struct ctx *c, uint8_t pif, int udp_sock_init(const struct ctx *c, int ns, sa_family_t af, const void *addr, const char *ifname, in_port_t port) { - union udp_epoll_ref uref = { .splice = (c->mode == MODE_PASTA), - .orig = true, .port = port }; + union udp_epoll_ref uref = { .orig = true, .port = port }; int s, r4 = FD_REF_MAX + 1, r6 = FD_REF_MAX + 1; if (ns) diff --git a/udp.h b/udp.h index 4ae65723..4b62b996 100644 --- a/udp.h +++ b/udp.h @@ -25,7 +25,6 @@ void udp_update_l2_buf(const unsigned char *eth_d, const unsigned char *eth_s); * @port: Source port for connected sockets, bound port otherwise * @pif: pif for this socket * @bound: Set if this file descriptor is a bound socket - * @splice: Set if descriptor packets to be "spliced" * @orig: Set if a spliced socket which can originate "connections" * @v6: Set for IPv6 sockets or connections * @u32: Opaque u32 value of reference @@ -34,8 +33,7 @@ union udp_epoll_ref { struct { in_port_t port; uint8_t pif; - bool splice:1, - orig:1, + bool orig:1, v6:1; }; uint32_t u32; -- 2.45.2