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

* Re: [PATCH] tcp_splice: Fix side in OUT_WAIT flag setting
  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
  1 sibling, 0 replies; 3+ messages in thread
From: David Gibson @ 2024-08-06 12:28 UTC (permalink / raw)
  To: Stefano Brivio; +Cc: passt-dev, Paul Holzinger

[-- Attachment #1: Type: text/plain, Size: 1300 bytes --]

On Tue, Aug 06, 2024 at 02:12:49PM +0200, Stefano Brivio wrote:
> 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>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

And mea culpa.

> ---
>  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;
>  		}
>  

-- 
David Gibson (he or they)	| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you, not the other way
				| around.
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] tcp_splice: Fix side in OUT_WAIT flag setting
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Holzinger @ 2024-08-06 12:33 UTC (permalink / raw)
  To: Stefano Brivio, passt-dev; +Cc: David Gibson


On 06/08/2024 14:12, Stefano Brivio wrote:
> 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>
Tested-by: Paul Holzinger <pholzing@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;
>   		}
>   

-- 
Paul Holzinger


^ permalink raw reply	[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).