[PATCH net] tcp: fix keepalive when data remain undelivered

2021-02-19 Thread Enke Chen
From: Enke Chen TCP keepalive does not timeout under the condition that network connection is lost and data remain undelivered (incl. retransmit). A very simple scenarios of the failure is to write data to a tcp socket after the network connection is lost. Under the specified condition the

Re: [PATCH net] tcp: make TCP_USER_TIMEOUT accurate for zero window probes

2021-01-23 Thread Enke Chen
Hi, Neal: What you described is more accurate, and is correct. Thanks. -- Enke On Sat, Jan 23, 2021 at 07:19:13PM -0500, Neal Cardwell wrote: > On Fri, Jan 22, 2021 at 9:45 PM Enke Chen wrote: > > > > Hi, Jakub: > > > > On Fri, Jan 22, 2021 at 06:34:24PM -0800, Jak

Re: [PATCH net] tcp: make TCP_USER_TIMEOUT accurate for zero window probes

2021-01-22 Thread Enke Chen
Hi, Jakub: On Fri, Jan 22, 2021 at 06:34:24PM -0800, Jakub Kicinski wrote: > On Fri, 22 Jan 2021 18:28:23 -0800 Enke Chen wrote: > > Hi, Jakub: > > > > In terms of backporting, this patch should go together with: > > > > 9d9b1ee0b2d1 tcp: fix TCP_USER_TIMEO

Re: [PATCH net] tcp: make TCP_USER_TIMEOUT accurate for zero window probes

2021-01-22 Thread Enke Chen
Hi, Jakub: In terms of backporting, this patch should go together with: 9d9b1ee0b2d1 tcp: fix TCP_USER_TIMEOUT with zero window Thanks. -- Enke On Fri, Jan 22, 2021 at 05:43:25PM -0800, Jakub Kicinski wrote: > On Fri, 22 Jan 2021 11:13:06 -0800 Enke Chen wrote: > > From:

Re: [PATCH] tcp: keepalive fixes

2021-01-22 Thread Enke Chen
Hi, Folks: Please ignore this patch. I will split it into separate ones as suggested off-list by Neal Cardwell . Thanks. -- Enke On Tue, Jan 12, 2021 at 11:25:44AM -0800, Enke Chen wrote: > From: Enke Chen > > In this patch two issues with TCP keepalives are fixed: > > 1) TCP

[PATCH net] tcp: make TCP_USER_TIMEOUT accurate for zero window probes

2021-01-22 Thread Enke Chen
From: Enke Chen The TCP_USER_TIMEOUT is checked by the 0-window probe timer. As the timer has backoff with a max interval of about two minutes, the actual timeout for TCP_USER_TIMEOUT can be off by up to two minutes. In this patch the TCP_USER_TIMEOUT is made more accurate by taking it into

Re: [PATCH net v2] tcp: fix TCP_USER_TIMEOUT with zero window

2021-01-18 Thread Enke Chen
On Mon, Jan 18, 2021 at 08:02:21PM -0800, Jakub Kicinski wrote: > On Fri, 15 Jan 2021 14:30:58 -0800 Enke Chen wrote: > > From: Enke Chen > > > > The TCP session does not terminate with TCP_USER_TIMEOUT when data > > remain untransmitted due to zero window. > >

[PATCH net v2] tcp: fix TCP_USER_TIMEOUT with zero window

2021-01-15 Thread Enke Chen
From: Enke Chen The TCP session does not terminate with TCP_USER_TIMEOUT when data remain untransmitted due to zero window. The number of unanswered zero-window probes (tcp_probes_out) is reset to zero with incoming acks irrespective of the window size, as described in tcp_probe_timer

Re: [PATCH] tcp: fix TCP_USER_TIMEOUT with zero window

2021-01-13 Thread Enke Chen
Hi, Eric: Yes, that is a good point! I have been discussing with Neal and Yuchung also and will work on revising the patch. Thanks. -- Enke On Wed, Jan 13, 2021 at 09:44:11PM +0100, Eric Dumazet wrote: > On Wed, Jan 13, 2021 at 9:12 PM Enke Chen wrote: > > > > From: Enke Ch

Re: [PATCH] tcp: fix TCP_USER_TIMEOUT with zero window

2021-01-13 Thread Enke Chen
Yes, I am convinced :-) Thanks to Eric, Neal and Yuchung for their help. -- Enke On Wed, Jan 13, 2021 at 01:20:55PM -0800, Yuchung Cheng wrote: > On Wed, Jan 13, 2021 at 12:49 PM Eric Dumazet wrote: > > > > On Wed, Jan 13, 2021 at 9:12 PM Enke Chen wrote: > > &g

Re: [PATCH] tcp: fix TCP_USER_TIMEOUT with zero window

2021-01-13 Thread Enke Chen
e is that the probes_nzw > patch relies on tcp_model_timeout(), which assumes exponential backoff, and > exponential backoff does not happen in the tcp_send_probe0() code path that > sets timeout = TCP_RESOURCE_PROBE_INTERVAL. > > best, > neal > > > On Wed, Jan 1

Re: [PATCH] tcp: keepalive fixes

2021-01-13 Thread Enke Chen
On Wed, Jan 13, 2021 at 12:06:27PM -0800, Enke Chen wrote: > Hi, Eric: > > Just to clarify: the issues for tcp keepalive and TCP_USER_TIMEOUT are > separate isues, and the fixes would not conflict afaik. > > Thanks. -- Enke I have posted patches for both issues, and th

[PATCH] tcp: fix TCP_USER_TIMEOUT with zero window

2021-01-13 Thread Enke Chen
From: Enke Chen The TCP session does not terminate with TCP_USER_TIMEOUT when data remain untransmitted due to zero window. The number of unanswered zero-window probes (tcp_probes_out) is reset to zero with incoming acks irrespective of the window size, as described in tcp_probe_timer

Re: [PATCH] tcp: keepalive fixes

2021-01-13 Thread Enke Chen
On Tue, Jan 12, 2021 at 2:31 PM Enke Chen wrote: > > > > > > From: Enke Chen > > > > > > In this patch two issues with TCP keepalives are fixed: > > > > > > 1) TCP keepalive does not timeout when there are data waiting to be >

Re: [PATCH] tcp: keepalive fixes

2021-01-12 Thread Enke Chen
is configured, and not the user timeout. Thanks. -- Enke On Tue, Jan 12, 2021 at 02:48:01PM -0800, Yuchung Cheng wrote: > On Tue, Jan 12, 2021 at 2:31 PM Enke Chen wrote: > > > > From: Enke Chen > > > > In this patch two issues with TCP keepalives are fixed: > &

[PATCH] tcp: keepalive fixes

2021-01-12 Thread Enke Chen
From: Enke Chen In this patch two issues with TCP keepalives are fixed: 1) TCP keepalive does not timeout when there are data waiting to be delivered and then the connection got broken. The TCP keepalive timeout is not evaluated in that condition. The fix is to remove the code that

Re: [PATCH] Revert "tcp: simplify window probe aborting on USER_TIMEOUT"

2021-01-11 Thread Enke Chen
Cardwell wrote: > On Fri, Jan 8, 2021 at 11:38 PM Enke Chen wrote: > > > > From: Enke Chen > > > > This reverts commit 9721e709fa68ef9b860c322b474cfbd1f8285b0f. > > > > With the commit 9721e709fa68 ("tcp: simplify window probe aborting > > on USER_

[PATCH] Revert "tcp: simplify window probe aborting on USER_TIMEOUT"

2021-01-08 Thread Enke Chen
From: Enke Chen This reverts commit 9721e709fa68ef9b860c322b474cfbd1f8285b0f. With the commit 9721e709fa68 ("tcp: simplify window probe aborting on USER_TIMEOUT"), the TCP session does not terminate with TCP_USER_TIMEOUT when data remain untransmitted due to zero window. The