Skip to content

Commit ca7bbc8

Browse files
committed
Merge branch 'sctp-RFC-4960-Errata-fixes'
Marcelo Ricardo Leitner says: ==================== sctp: RFC 4960 Errata fixes This patchset contains fixes for 4 Errata topics from https://tools.ietf.org/html/draft-ietf-tsvwg-rfc4960-errata-01 Namely, sections: 3.12. Order of Adjustments of partial_bytes_acked and cwnd 3.22. Increase of partial_bytes_acked in Congestion Avoidance 3.26. CWND Increase in Congestion Avoidance Phase 3.27. Refresh of cwnd and ssthresh after Idle Period Tests performed with netperf using net namespaces, with drop rates at 0%, 0.5% and 1% by netem, IPv4 and IPv6, 10 runs for each combination. I couldn't spot differences on the stats. With and without these patches the results vary in a similar way in terms of throughput and retransmissions. Tests with 20ms delay and 20ms delay + drops at 0.5% and 1% also had results in a similar way, no noticeable difference. Looking at cwnd, it was possible to notice slightly lower values being used while still sustaining same throughput profile. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents f3ecab3 + a02d036 commit ca7bbc8

File tree

1 file changed

+33
-21
lines changed

1 file changed

+33
-21
lines changed

net/sctp/transport.c

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -405,14 +405,6 @@ void sctp_transport_raise_cwnd(struct sctp_transport *transport,
405405
TSN_lte(asoc->fast_recovery_exit, sack_ctsn))
406406
asoc->fast_recovery = 0;
407407

408-
/* The appropriate cwnd increase algorithm is performed if, and only
409-
* if the cumulative TSN whould advanced and the congestion window is
410-
* being fully utilized.
411-
*/
412-
if (TSN_lte(sack_ctsn, transport->asoc->ctsn_ack_point) ||
413-
(flight_size < cwnd))
414-
return;
415-
416408
ssthresh = transport->ssthresh;
417409
pba = transport->partial_bytes_acked;
418410
pmtu = transport->asoc->pathmtu;
@@ -435,6 +427,14 @@ void sctp_transport_raise_cwnd(struct sctp_transport *transport,
435427
if (asoc->fast_recovery)
436428
return;
437429

430+
/* The appropriate cwnd increase algorithm is performed
431+
* if, and only if the congestion window is being fully
432+
* utilized. Note that RFC4960 Errata 3.22 removed the
433+
* other condition on ctsn moving.
434+
*/
435+
if (flight_size < cwnd)
436+
return;
437+
438438
if (bytes_acked > pmtu)
439439
cwnd += pmtu;
440440
else
@@ -446,23 +446,33 @@ void sctp_transport_raise_cwnd(struct sctp_transport *transport,
446446
flight_size, pba);
447447
} else {
448448
/* RFC 2960 7.2.2 Whenever cwnd is greater than ssthresh,
449-
* upon each SACK arrival that advances the Cumulative TSN Ack
450-
* Point, increase partial_bytes_acked by the total number of
451-
* bytes of all new chunks acknowledged in that SACK including
452-
* chunks acknowledged by the new Cumulative TSN Ack and by
453-
* Gap Ack Blocks.
449+
* upon each SACK arrival, increase partial_bytes_acked
450+
* by the total number of bytes of all new chunks
451+
* acknowledged in that SACK including chunks
452+
* acknowledged by the new Cumulative TSN Ack and by Gap
453+
* Ack Blocks. (updated by RFC4960 Errata 3.22)
454+
*
455+
* When partial_bytes_acked is greater than cwnd and
456+
* before the arrival of the SACK the sender had less
457+
* bytes of data outstanding than cwnd (i.e., before
458+
* arrival of the SACK, flightsize was less than cwnd),
459+
* reset partial_bytes_acked to cwnd. (RFC 4960 Errata
460+
* 3.26)
454461
*
455-
* When partial_bytes_acked is equal to or greater than cwnd
456-
* and before the arrival of the SACK the sender had cwnd or
457-
* more bytes of data outstanding (i.e., before arrival of the
458-
* SACK, flightsize was greater than or equal to cwnd),
459-
* increase cwnd by MTU, and reset partial_bytes_acked to
460-
* (partial_bytes_acked - cwnd).
462+
* When partial_bytes_acked is equal to or greater than
463+
* cwnd and before the arrival of the SACK the sender
464+
* had cwnd or more bytes of data outstanding (i.e.,
465+
* before arrival of the SACK, flightsize was greater
466+
* than or equal to cwnd), partial_bytes_acked is reset
467+
* to (partial_bytes_acked - cwnd). Next, cwnd is
468+
* increased by MTU. (RFC 4960 Errata 3.12)
461469
*/
462470
pba += bytes_acked;
463-
if (pba >= cwnd) {
471+
if (pba > cwnd && flight_size < cwnd)
472+
pba = cwnd;
473+
if (pba >= cwnd && flight_size >= cwnd) {
474+
pba = pba - cwnd;
464475
cwnd += pmtu;
465-
pba = ((cwnd < pba) ? (pba - cwnd) : 0);
466476
}
467477

468478
pr_debug("%s: congestion avoidance: transport:%p, "
@@ -559,6 +569,8 @@ void sctp_transport_lower_cwnd(struct sctp_transport *transport,
559569
*/
560570
transport->cwnd = max(transport->cwnd/2,
561571
4*asoc->pathmtu);
572+
/* RFC 4960 Errata 3.27.2: also adjust sshthresh */
573+
transport->ssthresh = transport->cwnd;
562574
break;
563575
}
564576

0 commit comments

Comments
 (0)