Skip to content

Commit 5144678

Browse files
marceloleitnerdavem330
authored andcommitted
sctp: fix identification of new acks for SFR-CACC
It's currently written as: if (!tchunk->tsn_gap_acked) { [1] tchunk->tsn_gap_acked = 1; ... } if (TSN_lte(tsn, sack_ctsn)) { if (!tchunk->tsn_gap_acked) { /* SFR-CACC processing */ ... } } Which causes the SFR-CACC processing on ack reception to never process, as tchunk->tsn_gap_acked is always true by then. Block [1] was moved to that position by the commit marked below. This patch fixes it by doing SFR-CACC processing earlier, before tsn_gap_acked is set to true. Fixes: 31b02e1 ("sctp: Failover transmitted list on transport delete") Signed-off-by: Marcelo Ricardo Leitner <[email protected]> Reviewed-by: Xin Long <[email protected]> Acked-by: Neil Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 47b3ba5 commit 5144678

File tree

1 file changed

+23
-25
lines changed

1 file changed

+23
-25
lines changed

net/sctp/outqueue.c

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,7 +1457,7 @@ static void sctp_check_transmitted(struct sctp_outq *q,
14571457
* the outstanding bytes for this chunk, so only
14581458
* count bytes associated with a transport.
14591459
*/
1460-
if (transport) {
1460+
if (transport && !tchunk->tsn_gap_acked) {
14611461
/* If this chunk is being used for RTT
14621462
* measurement, calculate the RTT and update
14631463
* the RTO using this value.
@@ -1469,14 +1469,34 @@ static void sctp_check_transmitted(struct sctp_outq *q,
14691469
* first instance of the packet or a later
14701470
* instance).
14711471
*/
1472-
if (!tchunk->tsn_gap_acked &&
1473-
!sctp_chunk_retransmitted(tchunk) &&
1472+
if (!sctp_chunk_retransmitted(tchunk) &&
14741473
tchunk->rtt_in_progress) {
14751474
tchunk->rtt_in_progress = 0;
14761475
rtt = jiffies - tchunk->sent_at;
14771476
sctp_transport_update_rto(transport,
14781477
rtt);
14791478
}
1479+
1480+
if (TSN_lte(tsn, sack_ctsn)) {
1481+
/*
1482+
* SFR-CACC algorithm:
1483+
* 2) If the SACK contains gap acks
1484+
* and the flag CHANGEOVER_ACTIVE is
1485+
* set the receiver of the SACK MUST
1486+
* take the following action:
1487+
*
1488+
* B) For each TSN t being acked that
1489+
* has not been acked in any SACK so
1490+
* far, set cacc_saw_newack to 1 for
1491+
* the destination that the TSN was
1492+
* sent to.
1493+
*/
1494+
if (sack->num_gap_ack_blocks &&
1495+
q->asoc->peer.primary_path->cacc.
1496+
changeover_active)
1497+
transport->cacc.cacc_saw_newack
1498+
= 1;
1499+
}
14801500
}
14811501

14821502
/* If the chunk hasn't been marked as ACKED,
@@ -1508,28 +1528,6 @@ static void sctp_check_transmitted(struct sctp_outq *q,
15081528
restart_timer = 1;
15091529
forward_progress = true;
15101530

1511-
if (!tchunk->tsn_gap_acked) {
1512-
/*
1513-
* SFR-CACC algorithm:
1514-
* 2) If the SACK contains gap acks
1515-
* and the flag CHANGEOVER_ACTIVE is
1516-
* set the receiver of the SACK MUST
1517-
* take the following action:
1518-
*
1519-
* B) For each TSN t being acked that
1520-
* has not been acked in any SACK so
1521-
* far, set cacc_saw_newack to 1 for
1522-
* the destination that the TSN was
1523-
* sent to.
1524-
*/
1525-
if (transport &&
1526-
sack->num_gap_ack_blocks &&
1527-
q->asoc->peer.primary_path->cacc.
1528-
changeover_active)
1529-
transport->cacc.cacc_saw_newack
1530-
= 1;
1531-
}
1532-
15331531
list_add_tail(&tchunk->transmitted_list,
15341532
&q->sacked);
15351533
} else {

0 commit comments

Comments
 (0)