Netdev List
 help / color / mirror / Atom feed
* [PATCH] tcp: TCP_USER_TIMEOUT can not work in tcp_probe_timer()
@ 2017-09-11  6:27 liujian56
  2017-09-11 14:49 ` Eric Dumazet
  0 siblings, 1 reply; 20+ messages in thread
From: liujian56 @ 2017-09-11  6:27 UTC (permalink / raw)
  To: davem, kuznet, yoshfuji, edumazet, ycheng, hkchu
  Cc: netdev, liujian56, weiyongjun1

From: liujian <liujian56@huawei.com>

After the tcp socket go to ESTABLISHED stat, change IP address (server
side),
then the tcp socket will go tcp_probe_timer process.

[root@localhost net]# netstat -toe
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode      Timer
tcp        0   1104 9.81.254:personal-agent 9.84.201.213:23597      ESTABLISHED root       12819      probe (4.36/0/7)
[root@localhost net]# cat /proc/net/tcp
  sl  local_address rem_address   st tx_queue rx_queue tr tm->when retrnsmt   uid  timeout inode                                                     
   3: B1FE5109:15B3 D5C95409:5C2D 01 00000495:00000000 04:0000005E 00000000     0        7 12819 2 ffff95cdcf45a000 20 4 1 10 -1 

In my test case, tcp_write_queue_head(sk) and tcp_send_head(sk) is  same
SKB.
And ((s32)(tcp_time_stamp(tp) - start_ts) >
jiffies_to_msecs(icsk->icsk_user_timeout))
 always is false.
 Here use keepalive_time_elapsed(tp) to do the compare as
tcp_keepalive_timer do.

Signed-off-by: liujian <liujian56@huawei.com>
---
 net/ipv4/tcp_timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index 655dd8d..2a28a03 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -325,7 +325,7 @@ static void tcp_probe_timer(struct sock *sk)
 	if (!start_ts)
 		tcp_send_head(sk)->skb_mstamp = tp->tcp_mstamp;
 	else if (icsk->icsk_user_timeout &&
-		 (s32)(tcp_time_stamp(tp) - start_ts) >
+		 keepalive_time_elapsed(tp) >=
 		 jiffies_to_msecs(icsk->icsk_user_timeout))
 		goto abort;
 
-- 
1.8.3.1

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

end of thread, other threads:[~2017-09-16 16:07 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-11  6:27 [PATCH] tcp: TCP_USER_TIMEOUT can not work in tcp_probe_timer() liujian56
2017-09-11 14:49 ` Eric Dumazet
2017-09-11 15:13   ` Eric Dumazet
2017-09-11 15:22     ` Eric Dumazet
2017-09-12  6:08       ` liujian
2017-09-12 15:05         ` Eric Dumazet
2017-09-12 15:38           ` Eric Dumazet
2017-09-13  6:56             ` liujian
2017-09-13  7:15               ` liujian
2017-09-13 14:40                 ` Eric Dumazet
2017-09-14  3:30                   ` [PATCH net] tcp: update skb->skb_mstamp more carefully Eric Dumazet
2017-09-14  8:17                     ` liujian
2017-09-14 13:57                     ` Neal Cardwell
2017-09-14 16:32                       ` Yuchung Cheng
2017-09-14 16:41                         ` Soheil Hassas Yeganeh
2017-09-15 21:37                     ` David Miller
2017-09-15 23:16                       ` Eric Dumazet
2017-09-15 23:47                         ` [PATCH net] tcp: fix data delivery rate Eric Dumazet
2017-09-16  1:33                           ` Soheil Hassas Yeganeh
2017-09-16 16:07                           ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox