Correct formula for TCP RTO calculation. Also try to do a better job in
filling in a new PCB's rttvar (but this is not the last word on the subject). And get rid of `#ifdef RTV_RTT', it's been true for four years now...
This commit is contained in:
parent
503a85ae94
commit
6da5712b60
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=16141
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95
|
||||
* $Id: tcp_subr.c,v 1.27 1996/03/22 18:11:25 wollman Exp $
|
||||
* $Id: tcp_subr.c,v 1.28 1996/03/27 18:23:16 wollman Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -270,7 +270,7 @@ tcp_newtcpcb(inp)
|
||||
* reasonable initial retransmit time.
|
||||
*/
|
||||
tp->t_srtt = TCPTV_SRTTBASE;
|
||||
tp->t_rttvar = tcp_rttdflt * PR_SLOWHZ << 2;
|
||||
tp->t_rttvar = tcp_rttdflt * PR_SLOWHZ << TCP_RTTVAR_SHIFT;
|
||||
tp->t_rttmin = TCPTV_MIN;
|
||||
TCPT_RANGESET(tp->t_rxtcur,
|
||||
((TCPTV_SRTTBASE >> 2) + (TCPTV_SRTTDFLT << 2)) >> 1,
|
||||
@ -320,7 +320,6 @@ tcp_close(tp)
|
||||
struct inpcb *inp = tp->t_inpcb;
|
||||
struct socket *so = inp->inp_socket;
|
||||
register struct mbuf *m;
|
||||
#ifdef RTV_RTT
|
||||
register struct rtentry *rt;
|
||||
|
||||
/*
|
||||
@ -391,7 +390,6 @@ tcp_close(tp)
|
||||
tcpstat.tcps_cachedssthresh++;
|
||||
}
|
||||
}
|
||||
#endif /* RTV_RTT */
|
||||
/* free the reassembly queue, if any */
|
||||
t = tp->seg_next;
|
||||
while (t != (struct tcpiphdr *)tp) {
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95
|
||||
* $Id: tcp_subr.c,v 1.27 1996/03/22 18:11:25 wollman Exp $
|
||||
* $Id: tcp_subr.c,v 1.28 1996/03/27 18:23:16 wollman Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -270,7 +270,7 @@ tcp_newtcpcb(inp)
|
||||
* reasonable initial retransmit time.
|
||||
*/
|
||||
tp->t_srtt = TCPTV_SRTTBASE;
|
||||
tp->t_rttvar = tcp_rttdflt * PR_SLOWHZ << 2;
|
||||
tp->t_rttvar = tcp_rttdflt * PR_SLOWHZ << TCP_RTTVAR_SHIFT;
|
||||
tp->t_rttmin = TCPTV_MIN;
|
||||
TCPT_RANGESET(tp->t_rxtcur,
|
||||
((TCPTV_SRTTBASE >> 2) + (TCPTV_SRTTDFLT << 2)) >> 1,
|
||||
@ -320,7 +320,6 @@ tcp_close(tp)
|
||||
struct inpcb *inp = tp->t_inpcb;
|
||||
struct socket *so = inp->inp_socket;
|
||||
register struct mbuf *m;
|
||||
#ifdef RTV_RTT
|
||||
register struct rtentry *rt;
|
||||
|
||||
/*
|
||||
@ -391,7 +390,6 @@ tcp_close(tp)
|
||||
tcpstat.tcps_cachedssthresh++;
|
||||
}
|
||||
}
|
||||
#endif /* RTV_RTT */
|
||||
/* free the reassembly queue, if any */
|
||||
t = tp->seg_next;
|
||||
while (t != (struct tcpiphdr *)tp) {
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)tcp_var.h 8.4 (Berkeley) 5/24/95
|
||||
* $Id: tcp_var.h,v 1.31 1996/03/22 18:09:21 wollman Exp $
|
||||
* $Id: tcp_var.h,v 1.32 1996/04/26 18:32:58 wollman Exp $
|
||||
*/
|
||||
|
||||
#ifndef _NETINET_TCP_VAR_H_
|
||||
@ -214,8 +214,8 @@ struct rmxp_tao {
|
||||
* fast networks.
|
||||
*/
|
||||
#define TCP_REXMTVAL(tp) \
|
||||
((((tp)->t_srtt >> (TCP_RTT_SHIFT - TCP_RTTVAR_SHIFT)) \
|
||||
+ ((tp)->t_rttvar) >> TCP_RTTVAR_SHIFT))
|
||||
((((tp)->t_srtt >> (TCP_RTT_SHIFT - TCP_DELTA_SHIFT)) \
|
||||
+ (tp)->t_rttvar) >> TCP_DELTA_SHIFT)
|
||||
|
||||
/* XXX
|
||||
* We want to avoid doing m_pullup on incoming packets but that
|
||||
|
Loading…
Reference in New Issue
Block a user