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=OheAdnfI; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id D49BE5A0265 for ; Thu, 21 May 2026 07:08:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1779340131; 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=wkSv8QpBC3ujNKbzNKEqSHjwcqAtrVQvCH7+a+53kCM=; b=OheAdnfIAXC3CaaFH7vg0HW14sbKR25I+r4uBNqG05LNIw9Qsg+XfUriydVSY7FojMY24f wZEz7mbTmZpxfqygV1ShZfNWvTlvd1uz8KhIlwxxJ+zmTa0q6qKlnlr9DgwqQBWCjTQRyS OaHjNh8tgMrVJaXQU0L+/IBFnSOXQag= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-191-zEbOtV__Mu2z6ggxBKATzg-1; Thu, 21 May 2026 01:08:50 -0400 X-MC-Unique: zEbOtV__Mu2z6ggxBKATzg-1 X-Mimecast-MFC-AGG-ID: zEbOtV__Mu2z6ggxBKATzg_1779340129 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-48fe40b61a3so37058595e9.3 for ; Wed, 20 May 2026 22:08:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779340129; x=1779944929; 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=wkSv8QpBC3ujNKbzNKEqSHjwcqAtrVQvCH7+a+53kCM=; b=ZMdEU/QNKk23FJh9H9Vfui/OJo9z5FfnVP9CThAcEvUP3Iz/GNbBVbDoesgySOvU5l iCjEZvEkpZJgNy6vPgePcdKeyvKzM0luWwOr7/3irbcuJ7cYtNvIMO0BT92/3WMuEnNX huqobonwgZMgr7MiIK2jeTTblWALw1y6JqVa8c0IhsOGatH0V1Nocp8avvmG7lownX9A oXYAe21WlkOQ46gYmeUWLoM2GZ40O5kNUW+Jdal/vUj0m0t+YUmAgfwO4Ycxr/sCsR6S APeDD2T9toZ9bfoXnf3G3Fwr80FNYteOSKiDIyRDj+Dg6d0HW+m8Xft8moaCkVB4pHxK tk2Q== X-Gm-Message-State: AOJu0Yx+WKenlqHJ4VbXTwuRklVSrvfrkhNSZ0XdMFoxNMbuG876cwhN 2gsBZ22Vt0rXz06zi50BFoH+zx+xgXQqsBte7jPKmHANa3mVayJldWMHHlgTP66LVNcy3ig4cNf AY90Ypdj0ZssATE9YMJ1b6HbrlfrVqgnVtW4pinQydwDxX6MtcSMvAz2MURVPow== X-Gm-Gg: Acq92OHab1lIxTnfbUkWPG2BRlp+BvnMAE0jYCshmbsT20dnxsTeu/B45Mi3JO5FRyv BJjgOzBSzLK54uO4AT3MaEPktxQYRGIjqsnf9HKS+dPren2cvUNngPaMNQ0tCyZkyEBrHI0em1X oUCK7e7rzDzqgLKZcQHWB9Cj7WccO/LKX3Vwyh04bIPGDmMb7fCxSuHy3ejfYwvbE3Z9x+j3nVS FbLEbUamaoB9+lJ+s30yX1jBkDLqRzhhGeFfu+4Tdx9xXlOMqNQ2YjqKU47qOa/n8gAG87OrAqc +CO9FsK5IhPc8buogFByjYz0o0jDjHXQp5SSUNusWcjAGun63gr1natA8IMJPA4+bM+925+MpDE D+uOEDdeEEX2CAczboXdE63Um5+6JwVqys3IIwvwqApk1g8u8Hg== X-Received: by 2002:a05:600c:1f8d:b0:490:327a:1b47 with SMTP id 5b1f17b1804b1-4903603af0bmr14234145e9.8.1779340128841; Wed, 20 May 2026 22:08:48 -0700 (PDT) X-Received: by 2002:a05:600c:1f8d:b0:490:327a:1b47 with SMTP id 5b1f17b1804b1-4903603af0bmr14233805e9.8.1779340128312; Wed, 20 May 2026 22:08:48 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49035e9fbadsm7580575e9.20.2026.05.20.22.08.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 May 2026 22:08:47 -0700 (PDT) From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 1/6] tcp_splice: Improve error reporting Message-ID: <20260521070844.5f840c72@elisabeth> In-Reply-To: References: <20260520130851.436931-1-david@gibson.dropbear.id.au> <20260520130851.436931-2-david@gibson.dropbear.id.au> <20260520163133.5b27d27c@elisabeth> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 Date: Thu, 21 May 2026 07:08:45 +0200 (CEST) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: YZmpA-T-fNZGABqovRueYyuCcASb83GLNhERIqAneBw_1779340129 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: PWPLLRN2F5YR66JTTHQP66NVP5NEMLIN X-Message-ID-Hash: PWPLLRN2F5YR66JTTHQP66NVP5NEMLIN 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 Thu, 21 May 2026 10:43:37 +1000 David Gibson wrote: > On Wed, May 20, 2026 at 04:31:34PM +0200, Stefano Brivio wrote: > > 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? > > I did think about that, I concluded it wasn't necessary here because > it indicates that something has gone unexpectedly wrong at the kernel > level, it's not guest triggerable. > > I can put in ratelimits if you still think they're necessary. I do, yes, because we're dangerously close to something the container can indirectly try to trigger, I think. > > 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])); > > Except for this one, which is debug level for that reason. > > > > goto reset; > > > + } > > > > > > return; > > > -- Stefano