From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=hexUOhya; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id 267285A0265 for ; Wed, 20 May 2026 16:31:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1779287498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nTPelVmqeBGSEaJQTcXDIjhP3U3Xn2MDUa639CqUrsI=; b=hexUOhyaJtBVIa3mmFiDx0TQDatUXfaVnIZ4x6MLVkElKcfxIuDjj5IAWJZZRdRXja8xwj DwNWda5hv/mxOtrhnxhhz+/8HSbIX3q1rLh6d7uU1AvxlolX9mej/UOdRLhitkd7wnVPZN xzrfDuQLSWmLZBEDPojX87G6o3GRLEQ= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-686-Yopw7ZEXP6aOehycGo7Hrw-1; Wed, 20 May 2026 10:31:37 -0400 X-MC-Unique: Yopw7ZEXP6aOehycGo7Hrw-1 X-Mimecast-MFC-AGG-ID: Yopw7ZEXP6aOehycGo7Hrw_1779287496 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-449b2a183d3so3262119f8f.0 for ; Wed, 20 May 2026 07:31:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779287496; x=1779892296; h=date:content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=nTPelVmqeBGSEaJQTcXDIjhP3U3Xn2MDUa639CqUrsI=; b=ITINU+ROv21VGSryqboTED4IKX7DgDfIC3XcPsr/9pw1/5c40BtQS+io5VNHLwtMdi f5Mz7meaJ1ZO7IqMt0nhgl+XRWIlnYJ0CtjXl9ro/9pI9ovOXLiC82pHzyhnaclwF0sn BFtYt+sMv/RNtMoCOUJBMif2ixQyzjeCM8d3J491QBKR4DX1DjSd2YZ/GFFBKk8/Wocw hOgnb4545ynkOUyMpIGicUB8wtZ7VV13pZFBbFZK+WgYwqITLpdkGWbx6qMmPZziMDaB itNBLtybILzkJeR4lQXkyUULPifVzVlkWzlrYkItjNwEHC5HyAmY0WC7SzUKxKh2ZNaz xrWw== X-Gm-Message-State: AOJu0YxuTGwWCOIPD1dLf4x6anPdZ1DO4uqJzwfwF21hzRZVin9uesFv P1y67qTdQj8L+TYp1lEQD0aymRRMYLPwmlJoNSNWbIBmsGF4HT6tlh14KKqe3rJYbljtthz3DuH 41hXC3ljw6jjcfTL2jMUbLZA4A3Vqg8GzkwQZWkUxSdE5NURgM0b+lw== X-Gm-Gg: Acq92OG0m6zu6KDv8Q4oBmYC5HMCcSC43mauaWR2qsECxFj8E7dBDrMMkUTZO7yC4aV EnLYDVDHgVrjGBJFEwDdQ7YSblq7X+ejBVc3dGDnDSfgmuy0TVEE356gjwSA6hGIhMsGoFxnR7c ATyqujki6usM1OZ8rn6RlWlGKETFUdepI0iCQiDrFo5CyymjzQ1xt+Kcxl96sHO9z54lyIz4NSu V2tt1y8gkevG3H6ukUg4Gq/K2iWlT3yNCSZWuey+7gOdPQLCfEs/GhrF2iFvjg8+wgcJmMGREP0 BQozLbC9XSnSNkUHhxyd8BganNlRdmFebvxCRNxspZG4XeHaL1hPObt9EiKU8I1CQyb2Wl8Xf4V JJE9ELLkYPgxOVupzYTo3m7fCZ5eSeqvXTfblwn+8aa6zCbJ4Kg== X-Received: by 2002:a05:6000:2a0e:b0:43e:a8d8:f3dc with SMTP id ffacd0b85a97d-45d916264b9mr29424202f8f.13.1779287495637; Wed, 20 May 2026 07:31:35 -0700 (PDT) X-Received: by 2002:a05:6000:2a0e:b0:43e:a8d8:f3dc with SMTP id ffacd0b85a97d-45d916264b9mr29424169f8f.13.1779287495080; Wed, 20 May 2026 07:31:35 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45d9e767ee0sm50955426f8f.1.2026.05.20.07.31.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 May 2026 07:31:34 -0700 (PDT) From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 1/6] tcp_splice: Improve error reporting Message-ID: <20260520163133.5b27d27c@elisabeth> In-Reply-To: <20260520130851.436931-2-david@gibson.dropbear.id.au> References: <20260520130851.436931-1-david@gibson.dropbear.id.au> <20260520130851.436931-2-david@gibson.dropbear.id.au> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 Date: Wed, 20 May 2026 16:31:34 +0200 (CEST) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 3DlUUirlI_U859VyVzi2rv-VuKy2APJklAgDlry_Mww_1779287496 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 5UYEPHTLKQY7RVFPSG5COD24TX3AKBL6 X-Message-ID-Hash: 5UYEPHTLKQY7RVFPSG5COD24TX3AKBL6 X-MailFrom: sbrivio@redhat.com 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: passt-dev@passt.top, Paul Holzinger , Anshu Kumari 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: On Wed, 20 May 2026 23:08:46 +1000 David Gibson wrote: > A number of things can, at least theoretically, go wrong when forwarding > data across a spliced connection. We generally handle this by resetting > the connection on both sides. However, in many cases we don't log any > message about why the connection was reset, which can make it hard to > debug why this is happening. > > Add a bunch of debug and error logging to make this easier to figure out. > > Signed-off-by: David Gibson > --- > tcp_splice.c | 31 +++++++++++++++++++++++-------- > 1 file changed, 23 insertions(+), 8 deletions(-) > > diff --git a/tcp_splice.c b/tcp_splice.c > index 42ee8abc..1359d6b8 100644 > --- a/tcp_splice.c > +++ b/tcp_splice.c > @@ -502,15 +502,18 @@ void tcp_splice_sock_handler(struct ctx *c, union epoll_ref ref, > if (rc) > flow_perror(conn, "Error retrieving SO_ERROR"); > else > - flow_trace(conn, "Error event on socket: %s", > - strerror_(err)); > - > + flow_dbg(conn, "Error event on %s socket: %s", > + pif_name(conn->f.pif[evsidei]), > + strerror_(err)); > goto reset; > } > > if (conn->events == SPLICE_CONNECT) { > - if (!(events & EPOLLOUT)) > + if (!(events & EPOLLOUT)) { > + flow_err(conn, "Unexpected events 0x%x during connect", > + events); Shouldn't all the flow_err() and flow_perror() calls here be ratelimited, that is, eventually calling the err_ratelimit() function Anshu introduced recently? We don't have helpers ready for flow_err() and flow_perror(), I was about to post a patch that would go before this series but I'm not sure if there's a specific reason to avoid those. > goto reset; > + } > if (tcp_splice_connect_finish(c, conn)) > goto reset; > } > @@ -545,8 +548,11 @@ retry: > SPLICE_F_MOVE | SPLICE_F_NONBLOCK); > while (readlen < 0 && errno == EINTR); > > - if (readlen < 0 && errno != EAGAIN) > + if (readlen < 0 && errno != EAGAIN) { > + flow_perror(conn, "Splicing from %s socket", > + pif_name(conn->f.pif[fromsidei])); > goto reset; > + } > > flow_trace(conn, "%zi from read-side call", readlen); > > @@ -569,8 +575,11 @@ retry: > SPLICE_F_MOVE | more | SPLICE_F_NONBLOCK); > while (written < 0 && errno == EINTR); > > - if (written < 0 && errno != EAGAIN) > + if (written < 0 && errno != EAGAIN) { > + flow_perror(conn, "Splicing to %s socket", > + pif_name(conn->f.pif[!fromsidei])); > goto reset; > + } > > flow_trace(conn, "%zi from write-side call (passed %zi)", > written, c->tcp.pipe_size); > @@ -627,8 +636,11 @@ retry: > flow_foreach_sidei(sidei) { > if ((conn->events & FIN_RCVD(sidei)) && > !(conn->events & FIN_SENT(!sidei))) { > - if (shutdown(conn->s[!sidei], SHUT_WR) < 0) > + if (shutdown(conn->s[!sidei], SHUT_WR) < 0) { > + flow_perror(conn, "shutdown() on %s", > + pif_name(conn->f.pif[!sidei])); > goto reset; > + } > conn_event(conn, FIN_SENT(!sidei)); > } > } > @@ -647,8 +659,11 @@ retry: > goto swap; > } > > - if (events & EPOLLHUP) > + if (events & EPOLLHUP) { > + flow_dbg(conn, "Hangup from %s socket", > + pif_name(conn->f.pif[evsidei])); > goto reset; > + } > > return; > -- Stefano