Page MenuHomeFreeBSD

D49047.id151299.diff
No OneTemporary

D49047.id151299.diff

diff --git a/sys/netinet/cc/cc.c b/sys/netinet/cc/cc.c
--- a/sys/netinet/cc/cc.c
+++ b/sys/netinet/cc/cc.c
@@ -401,13 +401,8 @@
* approximately snd_ssthresh outstanding data. But in case we
* would be inclined to send a burst, better to do it via the
* slow start mechanism.
- *
- * XXXLAS: Find a way to do this without needing curack
*/
- if (V_tcp_do_newsack)
- pipe = tcp_compute_pipe(ccv->tp);
- else
- pipe = CCV(ccv, snd_max) - ccv->curack;
+ pipe = tcp_compute_pipe(ccv->tp);
if (pipe < CCV(ccv, snd_ssthresh))
/*
* Ensure that cwnd does not collapse to 1 MSS under
@@ -500,13 +495,7 @@
break;
case CC_RTO:
if (CCV(ccv, t_rxtshift) == 1) {
- if (V_tcp_do_newsack) {
- pipe = tcp_compute_pipe(ccv->tp);
- } else {
- pipe = CCV(ccv, snd_max) -
- CCV(ccv, snd_fack) +
- CCV(ccv, sackhint.sack_bytes_rexmit);
- }
+ pipe = tcp_compute_pipe(ccv->tp);
CCV(ccv, snd_ssthresh) = max(2,
min(CCV(ccv, snd_wnd), pipe) / 2 / mss) * mss;
}
diff --git a/sys/netinet/cc/cc_cubic.c b/sys/netinet/cc/cc_cubic.c
--- a/sys/netinet/cc/cc_cubic.c
+++ b/sys/netinet/cc/cc_cubic.c
@@ -470,13 +470,7 @@
cubic_data->undo_cwnd_epoch = cubic_data->cwnd_epoch;
cubic_data->undo_W_max = cubic_data->W_max;
cubic_data->undo_K = cubic_data->K;
- if (V_tcp_do_newsack) {
- pipe = tcp_compute_pipe(ccv->tp);
- } else {
- pipe = CCV(ccv, snd_max) -
- CCV(ccv, snd_fack) +
- CCV(ccv, sackhint.sack_bytes_rexmit);
- }
+ pipe = tcp_compute_pipe(ccv->tp);
CCV(ccv, snd_ssthresh) = max(2,
(((uint64_t)min(CCV(ccv, snd_wnd), pipe) *
CUBIC_BETA) >> CUBIC_SHIFT) / mss) * mss;
@@ -536,14 +530,8 @@
* If inflight data is less than ssthresh, set cwnd
* conservatively to avoid a burst of data, as suggested in
* the NewReno RFC. Otherwise, use the CUBIC method.
- *
- * XXXLAS: Find a way to do this without needing curack
*/
- if (V_tcp_do_newsack)
- pipe = tcp_compute_pipe(ccv->tp);
- else
- pipe = CCV(ccv, snd_max) - ccv->curack;
-
+ pipe = tcp_compute_pipe(ccv->tp);
if (pipe < CCV(ccv, snd_ssthresh))
/*
* Ensure that cwnd does not collapse to 1 MSS under
diff --git a/sys/netinet/cc/cc_dctcp.c b/sys/netinet/cc/cc_dctcp.c
--- a/sys/netinet/cc/cc_dctcp.c
+++ b/sys/netinet/cc/cc_dctcp.c
@@ -294,13 +294,7 @@
break;
case CC_RTO:
if (CCV(ccv, t_rxtshift) == 1) {
- if (V_tcp_do_newsack) {
- pipe = tcp_compute_pipe(ccv->tp);
- } else {
- pipe = CCV(ccv, snd_max) -
- CCV(ccv, snd_fack) +
- CCV(ccv, sackhint.sack_bytes_rexmit);
- }
+ pipe = tcp_compute_pipe(ccv->tp);
CCV(ccv, snd_ssthresh) = max(2,
min(CCV(ccv, snd_wnd), pipe) / 2 / mss) * mss;
}
diff --git a/sys/netinet/cc/cc_htcp.c b/sys/netinet/cc/cc_htcp.c
--- a/sys/netinet/cc/cc_htcp.c
+++ b/sys/netinet/cc/cc_htcp.c
@@ -325,13 +325,7 @@
case CC_RTO:
if (CCV(ccv, t_rxtshift) == 1) {
- if (V_tcp_do_newsack) {
- pipe = tcp_compute_pipe(ccv->tp);
- } else {
- pipe = CCV(ccv, snd_max) -
- CCV(ccv, snd_fack) +
- CCV(ccv, sackhint.sack_bytes_rexmit);
- }
+ pipe = tcp_compute_pipe(ccv->tp);
CCV(ccv, snd_ssthresh) = max(2,
min(CCV(ccv, snd_wnd), pipe) / 2 / mss) * mss;
}
@@ -381,14 +375,8 @@
* If inflight data is less than ssthresh, set cwnd
* conservatively to avoid a burst of data, as suggested in the
* NewReno RFC. Otherwise, use the HTCP method.
- *
- * XXXLAS: Find a way to do this without needing curack
*/
- if (V_tcp_do_newsack)
- pipe = tcp_compute_pipe(ccv->tp);
- else
- pipe = CCV(ccv, snd_max) - ccv->curack;
-
+ pipe = tcp_compute_pipe(ccv->tp);
if (pipe < CCV(ccv, snd_ssthresh))
/*
* Ensure that cwnd down not collape to 1 MSS under
diff --git a/sys/netinet/cc/cc_newreno.c b/sys/netinet/cc/cc_newreno.c
--- a/sys/netinet/cc/cc_newreno.c
+++ b/sys/netinet/cc/cc_newreno.c
@@ -428,13 +428,7 @@
break;
case CC_RTO:
if (CCV(ccv, t_rxtshift) == 1) {
- if (V_tcp_do_newsack) {
- pipe = tcp_compute_pipe(ccv->tp);
- } else {
- pipe = CCV(ccv, snd_max) -
- CCV(ccv, snd_fack) +
- CCV(ccv, sackhint.sack_bytes_rexmit);
- }
+ pipe = tcp_compute_pipe(ccv->tp);
CCV(ccv, snd_ssthresh) = max(2,
((uint64_t)min(CCV(ccv, snd_wnd), pipe) *
(uint64_t)factor) /
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -2660,12 +2660,7 @@
* we have less than ssthresh
* worth of data in flight.
*/
- if (V_tcp_do_newsack) {
- awnd = tcp_compute_pipe(tp);
- } else {
- awnd = (tp->snd_nxt - tp->snd_fack) +
- tp->sackhint.sack_bytes_rexmit;
- }
+ awnd = tcp_compute_pipe(tp);
if (awnd < tp->snd_ssthresh) {
tp->snd_cwnd += imax(maxseg,
imin(2 * maxseg,
@@ -4098,11 +4093,7 @@
(IN_CONGRECOVERY(tp->t_flags) &&
!IN_FASTRECOVERY(tp->t_flags))) {
del_data = tp->sackhint.delivered_data;
- if (V_tcp_do_newsack)
- pipe = tcp_compute_pipe(tp);
- else
- pipe = (tp->snd_nxt - tp->snd_fack) +
- tp->sackhint.sack_bytes_rexmit;
+ pipe = tcp_compute_pipe(tp);
} else {
if (tp->sackhint.prr_delivered < (tcprexmtthresh * maxseg +
tp->snd_recover - tp->snd_una)) {
@@ -4206,14 +4197,19 @@
int
tcp_compute_pipe(struct tcpcb *tp)
{
- if (tp->t_fb->tfb_compute_pipe == NULL) {
- return (tp->snd_max - tp->snd_una +
+ int pipe;
+
+ if (tp->t_fb->tfb_compute_pipe != NULL) {
+ pipe = (*tp->t_fb->tfb_compute_pipe)(tp);
+ } else if (V_tcp_do_newsack) {
+ pipe = tp->snd_max - tp->snd_una +
tp->sackhint.sack_bytes_rexmit -
tp->sackhint.sacked_bytes -
- tp->sackhint.lost_bytes);
+ tp->sackhint.lost_bytes;
} else {
- return((*tp->t_fb->tfb_compute_pipe)(tp));
+ pipe = tp->snd_nxt - tp->snd_fack + tp->sackhint.sack_bytes_rexmit;
}
+ return (imax(pipe, 0));
}
uint32_t

File Metadata

Mime Type
text/plain
Expires
Fri, Oct 17, 12:34 AM (2 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
23810507
Default Alt Text
D49047.id151299.diff (5 KB)

Event Timeline