public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
* [PATCH] tcp_splice: Fix side in OUT_WAIT flag setting
@ 2024-08-06 12:12 Stefano Brivio
  2024-08-06 12:28 ` David Gibson
  2024-08-06 12:33 ` Paul Holzinger
  0 siblings, 2 replies; 3+ messages in thread
From: Stefano Brivio @ 2024-08-06 12:12 UTC (permalink / raw)
  To: passt-dev; +Cc: David Gibson, Paul Holzinger

If the "from" (input) side for a given transfer is 0, and we can't
complete the write right away, what we need to be waiting for is for
output readiness on side 1, not 0, and the other way around as well.

This causes random transfer failures for local TCP connections,
depending if we ever need to wait for output readiness.

Reported-by: Paul Holzinger <pholzing@redhat.com>
Link: https://github.com/containers/podman/issues/23517
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
---
 tcp_splice.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tcp_splice.c b/tcp_splice.c
index 473562b..483e45d 100644
--- a/tcp_splice.c
+++ b/tcp_splice.c
@@ -577,7 +577,7 @@ eintr:
 			if (conn->read[fromsidei] == conn->written[fromsidei])
 				break;
 
-			conn_event(c, conn, OUT_WAIT(fromsidei));
+			conn_event(c, conn, OUT_WAIT(!fromsidei));
 			break;
 		}
 
-- 
@@ -577,7 +577,7 @@ eintr:
 			if (conn->read[fromsidei] == conn->written[fromsidei])
 				break;
 
-			conn_event(c, conn, OUT_WAIT(fromsidei));
+			conn_event(c, conn, OUT_WAIT(!fromsidei));
 			break;
 		}
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-07  1:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-06 12:12 [PATCH] tcp_splice: Fix side in OUT_WAIT flag setting Stefano Brivio
2024-08-06 12:28 ` David Gibson
2024-08-06 12:33 ` Paul Holzinger

Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).