View | Details | Raw Unified | Return to bug 191520 | Differences between
and this patch

Collapse All | Expand All

(-)sys/conf/files (+1 lines)
Lines 3383-3388 Link Here
3383
netinet/tcp_sack.c		optional inet | inet6
3383
netinet/tcp_sack.c		optional inet | inet6
3384
netinet/tcp_subr.c		optional inet | inet6
3384
netinet/tcp_subr.c		optional inet | inet6
3385
netinet/tcp_syncache.c		optional inet | inet6
3385
netinet/tcp_syncache.c		optional inet | inet6
3386
netinet/tcp_newcwv.c		optional inet | inet6
3386
netinet/tcp_timer.c		optional inet | inet6
3387
netinet/tcp_timer.c		optional inet | inet6
3387
netinet/tcp_timewait.c		optional inet | inet6
3388
netinet/tcp_timewait.c		optional inet | inet6
3388
netinet/tcp_usrreq.c		optional inet | inet6
3389
netinet/tcp_usrreq.c		optional inet | inet6
(-)sys/netinet/tcp_input.c (-2 / +35 lines)
Lines 105-110 Link Here
105
#include <netinet6/tcp6_var.h>
105
#include <netinet6/tcp6_var.h>
106
#include <netinet/tcpip.h>
106
#include <netinet/tcpip.h>
107
#include <netinet/tcp_syncache.h>
107
#include <netinet/tcp_syncache.h>
108
#include <netinet/tcp_newcwv.h>
108
#ifdef TCPDEBUG
109
#ifdef TCPDEBUG
109
#include <netinet/tcp_debug.h>
110
#include <netinet/tcp_debug.h>
110
#endif /* TCPDEBUG */
111
#endif /* TCPDEBUG */
Lines 174-179 Link Here
174
    &VNET_NAME(tcp_abc_l_var), 2,
175
    &VNET_NAME(tcp_abc_l_var), 2,
175
    "Cap the max cwnd increment during slow-start to this number of segments");
176
    "Cap the max cwnd increment during slow-start to this number of segments");
176
177
178
VNET_DEFINE(int, tcp_do_newcwv) = 0;
179
SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, newcwv, CTLFLAG_RW,
180
    &VNET_NAME(tcp_do_newcwv), 0,
181
    "Enable draft-ietf-tcpm-newcwv-06 (New Congestion Window Validation)");
182
177
static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, ecn, CTLFLAG_RW, 0, "TCP ECN");
183
static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, ecn, CTLFLAG_RW, 0, "TCP ECN");
178
184
179
VNET_DEFINE(int, tcp_do_ecn) = 0;
185
VNET_DEFINE(int, tcp_do_ecn) = 0;
Lines 285-293 Link Here
285
	INP_WLOCK_ASSERT(tp->t_inpcb);
291
	INP_WLOCK_ASSERT(tp->t_inpcb);
286
292
287
	tp->ccv->bytes_this_ack = BYTES_THIS_ACK(tp, th);
293
	tp->ccv->bytes_this_ack = BYTES_THIS_ACK(tp, th);
288
	if (tp->snd_cwnd <= tp->snd_wnd)
294
	/* draft-ietf-tcpm-newcwv relaxes conditions for growing cwnd */
295
	if (tp->snd_cwnd <= tp->snd_wnd || 
296
		(V_tcp_do_newcwv && tp->newcwv.pipeack >= (tp->snd_cwnd >> 1)) ) {
289
		tp->ccv->flags |= CCF_CWND_LIMITED;
297
		tp->ccv->flags |= CCF_CWND_LIMITED;
290
	else
298
		tp->newcwv.cwnd_valid_ts = ticks;
299
	} else
291
		tp->ccv->flags &= ~CCF_CWND_LIMITED;
300
		tp->ccv->flags &= ~CCF_CWND_LIMITED;
292
301
293
	if (type == CC_ACK) {
302
	if (type == CC_ACK) {
Lines 309-314 Link Here
309
		tp->ccv->curack = th->th_ack;
318
		tp->ccv->curack = th->th_ack;
310
		CC_ALGO(tp)->ack_received(tp->ccv, type);
319
		CC_ALGO(tp)->ack_received(tp->ccv, type);
311
	}
320
	}
321
322
	/*
323
	 * update draft-ietf-newcwv-06 pipeack
324
	 */
325
	if(V_tcp_do_newcwv && !IN_FASTRECOVERY(tp->t_flags))
326
		tcp_newcwv_update_pipeack(tp);
312
}
327
}
313
328
314
static void inline
329
static void inline
Lines 378-383 Link Here
378
			tp->snd_cwnd = 4 * tp->t_maxseg;
393
			tp->snd_cwnd = 4 * tp->t_maxseg;
379
	}
394
	}
380
395
396
	/* 
397
	 * Initialise NewCWV state
398
	 */
399
	tp->newcwv.init_cwnd = tp->snd_cwnd;
400
	tcp_newcwv_reset(tp);
401
381
	if (CC_ALGO(tp)->conn_init != NULL)
402
	if (CC_ALGO(tp)->conn_init != NULL)
382
		CC_ALGO(tp)->conn_init(tp->ccv);
403
		CC_ALGO(tp)->conn_init(tp->ccv);
383
}
404
}
Lines 426-431 Link Here
426
		tp->t_badrxtwin = 0;
447
		tp->t_badrxtwin = 0;
427
		break;
448
		break;
428
	}
449
	}
450
	
451
	if (V_tcp_do_newcwv && 
452
			(type == CC_NDUPACK || type == CC_ECN) &&
453
				tp->newcwv.pipeack <= (tp->snd_cwnd >> 1) )
454
		tcp_newcwv_enter_recovery(tp);
429
455
430
	if (CC_ALGO(tp)->cong_signal != NULL) {
456
	if (CC_ALGO(tp)->cong_signal != NULL) {
431
		if (th != NULL)
457
		if (th != NULL)
Lines 447-452 Link Here
447
	}
473
	}
448
	/* XXXLAS: EXIT_RECOVERY ? */
474
	/* XXXLAS: EXIT_RECOVERY ? */
449
	tp->t_bytes_acked = 0;
475
	tp->t_bytes_acked = 0;
476
477
	if(V_tcp_do_newcwv) {
478
		if(tp->newcwv.loss_flight_size)
479
			tcp_newcwv_end_recovery(tp);
480
		tcp_newcwv_reset(tp);	
481
	}
482
	tp->newcwv.loss_flight_size = 0;
450
}
483
}
451
484
452
#ifdef TCP_SIGNATURE
485
#ifdef TCP_SIGNATURE
(-)sys/netinet/tcp_output.c (+5 lines)
Lines 74-79 Link Here
74
#include <netinet/tcp_timer.h>
74
#include <netinet/tcp_timer.h>
75
#include <netinet/tcp_var.h>
75
#include <netinet/tcp_var.h>
76
#include <netinet/tcpip.h>
76
#include <netinet/tcpip.h>
77
#include <netinet/tcp_newcwv.h>
77
#ifdef TCPDEBUG
78
#ifdef TCPDEBUG
78
#include <netinet/tcp_debug.h>
79
#include <netinet/tcp_debug.h>
79
#endif
80
#endif
Lines 691-696 Link Here
691
#endif
692
#endif
692
		hdrlen = sizeof (struct tcpiphdr);
693
		hdrlen = sizeof (struct tcpiphdr);
693
694
695
	/* Trigger the newcwv timer */
696
	if(V_tcp_do_newcwv)
697
		tcp_newcwv_datalim_closedown(tp);
698
694
	/*
699
	/*
695
	 * Compute options for segment.
700
	 * Compute options for segment.
696
	 * We only have to care about SYN and established connection
701
	 * We only have to care about SYN and established connection
(-)sys/netinet/tcp_subr.c (+1 lines)
Lines 800-805 Link Here
800
		tp->t_flags = (TF_REQ_SCALE|TF_REQ_TSTMP);
800
		tp->t_flags = (TF_REQ_SCALE|TF_REQ_TSTMP);
801
	if (V_tcp_do_sack)
801
	if (V_tcp_do_sack)
802
		tp->t_flags |= TF_SACK_PERMIT;
802
		tp->t_flags |= TF_SACK_PERMIT;
803
803
	TAILQ_INIT(&tp->snd_holes);
804
	TAILQ_INIT(&tp->snd_holes);
804
	tp->t_inpcb = inp;	/* XXX */
805
	tp->t_inpcb = inp;	/* XXX */
805
	/*
806
	/*
(-)sys/netinet/tcp_var.h (+18 lines)
Lines 172-177 Link Here
172
	int	t_sndzerowin;		/* zero-window updates sent */
172
	int	t_sndzerowin;		/* zero-window updates sent */
173
	u_int	t_badrxtwin;		/* window for retransmit recovery */
173
	u_int	t_badrxtwin;		/* window for retransmit recovery */
174
	u_char	snd_limited;		/* segments limited transmitted */
174
	u_char	snd_limited;		/* segments limited transmitted */
175
/* NewCWV releated state */
176
	struct {
177
		u_int32_t pipeack;
178
		u_int32_t psp;			/* pipeack sampling period */
179
180
		u_int32_t head;
181
		u_int32_t psample[4];	/* pipe ack samples */
182
		u_int32_t time_stamp[4];	/* time stamp samples */
183
		u_int32_t prev_snd_una;		/* previous snd_una in this sampe */
184
		u_int32_t prev_snd_nxt;		/* previous snd_nxt in this sampe */
185
186
		u_int32_t loss_flight_size;	/* flightsize at loss detection */
187
		u_int32_t prior_retrans;	/* Retransmission before going into FR */
188
		u_int32_t cwnd_valid_ts;	/*last time cwnd was found valid */
189
		u_int32_t init_cwnd;	/* The inital cwnd */
190
	} newcwv;
175
/* SACK related state */
191
/* SACK related state */
176
	int	snd_numholes;		/* number of holes seen by sender */
192
	int	snd_numholes;		/* number of holes seen by sender */
177
	TAILQ_HEAD(sackhole_head, sackhole) snd_holes;
193
	TAILQ_HEAD(sackhole_head, sackhole) snd_holes;
Lines 605-610 Link Here
605
VNET_DECLARE(int, path_mtu_discovery);
621
VNET_DECLARE(int, path_mtu_discovery);
606
VNET_DECLARE(int, tcp_do_rfc3465);
622
VNET_DECLARE(int, tcp_do_rfc3465);
607
VNET_DECLARE(int, tcp_abc_l_var);
623
VNET_DECLARE(int, tcp_abc_l_var);
624
VNET_DECLARE(int, tcp_do_newcwv);
608
#define	V_tcb			VNET(tcb)
625
#define	V_tcb			VNET(tcb)
609
#define	V_tcbinfo		VNET(tcbinfo)
626
#define	V_tcbinfo		VNET(tcbinfo)
610
#define	V_tcp_mssdflt		VNET(tcp_mssdflt)
627
#define	V_tcp_mssdflt		VNET(tcp_mssdflt)
Lines 617-622 Link Here
617
#define	V_path_mtu_discovery	VNET(path_mtu_discovery)
634
#define	V_path_mtu_discovery	VNET(path_mtu_discovery)
618
#define	V_tcp_do_rfc3465	VNET(tcp_do_rfc3465)
635
#define	V_tcp_do_rfc3465	VNET(tcp_do_rfc3465)
619
#define	V_tcp_abc_l_var		VNET(tcp_abc_l_var)
636
#define	V_tcp_abc_l_var		VNET(tcp_abc_l_var)
637
#define	V_tcp_do_newcwv		VNET(tcp_do_newcwv)
620
638
621
VNET_DECLARE(int, tcp_do_sack);			/* SACK enabled/disabled */
639
VNET_DECLARE(int, tcp_do_sack);			/* SACK enabled/disabled */
622
VNET_DECLARE(int, tcp_sc_rst_sock_fail);	/* RST on sock alloc failure */
640
VNET_DECLARE(int, tcp_sc_rst_sock_fail);	/* RST on sock alloc failure */

Return to bug 191520