From 57c5115037b8ddf31e74440d13ce28ca097ae97a Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Tue, 28 Aug 2012 10:01:56 +0000 Subject: [PATCH] Fixed bug in RTT measurement git-svn-id: svn://kolibrios.org@2948 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/branches/net/network/tcp_input.inc | 10 ++++++---- kernel/branches/net/network/tcp_subr.inc | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/kernel/branches/net/network/tcp_input.inc b/kernel/branches/net/network/tcp_input.inc index f339d56fca..bcda6fe9ab 100644 --- a/kernel/branches/net/network/tcp_input.inc +++ b/kernel/branches/net/network/tcp_input.inc @@ -590,7 +590,7 @@ TCP_input: .no_excess_data: ;----------------- -; Record timestamp (737-746) TODO +; Record timestamp (737-746) ; If last ACK falls within this segments sequence numbers, record its timestamp test [ebx + TCP_SOCKET.temp_bits], TCP_BIT_TIMESTAMP @@ -605,7 +605,9 @@ TCP_input: sub eax, ecx jae .no_timestamp - mov eax, [esp + 4+4] ; tcp_now + DEBUGF 1,"Recording timestamp\n" + + mov eax, [esp + 4+4] ; tcp_now mov [ebx + TCP_SOCKET.ts_recent_age], eax mov eax, [ebx + TCP_SOCKET.ts_val] mov [ebx + TCP_SOCKET.ts_recent], eax @@ -736,7 +738,7 @@ TCP_input: DEBUGF 1,"TCP_input: Processing duplicate ACK\n" -; If we have outstanidn data, other than a window probe, this is a completely duplicate ACK +; If we have outstanding data, other than a window probe, this is a completely duplicate ACK ; (window info didnt change) The ACK is the biggest we've seen and we've seen exactly our rexmt threshold of them, ; assume a packet has been dropped and retransmit it. Kludge snd_nxt & the congestion window so we send only this one packet. @@ -853,7 +855,7 @@ TCP_input: ; If we have a timestamp, update smoothed RTT test [ebx + TCP_SOCKET.temp_bits], TCP_BIT_TIMESTAMP - jne .timestamp_not_present + jz .timestamp_not_present mov eax, [esp+4+4] sub eax, [ebx + TCP_SOCKET.ts_ecr] inc eax diff --git a/kernel/branches/net/network/tcp_subr.inc b/kernel/branches/net/network/tcp_subr.inc index be80a36009..208fa94b52 100644 --- a/kernel/branches/net/network/tcp_subr.inc +++ b/kernel/branches/net/network/tcp_subr.inc @@ -506,6 +506,8 @@ macro TCP_set_persist socket { align 4 TCP_xmit_timer: + DEBUGF 1,"TCP_xmit_timer: socket=%x rtt=%d0ms\n", ebx, eax + ;TODO: update stats cmp [ebx + TCP_SOCKET.t_rtt], 0