diff options
author | Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> | 2018-04-24 17:17:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-04-25 13:22:07 -0400 |
commit | 51446780fc33e45cb790c05a7fa2c5bf7e8bc53b (patch) | |
tree | 7e19d85f9b7b9bf2aeb2f230e9e7a774b0896146 /net/sctp/outqueue.c | |
parent | 47b3ba5175e940c9be5fd6aec05d6e7e048ff823 (diff) |
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: 31b02e154940 ("sctp: Failover transmitted list on transport delete")
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Reviewed-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/outqueue.c')
-rw-r--r-- | net/sctp/outqueue.c | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c index f211b3db6a35..dee7cbd54831 100644 --- a/net/sctp/outqueue.c +++ b/net/sctp/outqueue.c | |||
@@ -1457,7 +1457,7 @@ static void sctp_check_transmitted(struct sctp_outq *q, | |||
1457 | * the outstanding bytes for this chunk, so only | 1457 | * the outstanding bytes for this chunk, so only |
1458 | * count bytes associated with a transport. | 1458 | * count bytes associated with a transport. |
1459 | */ | 1459 | */ |
1460 | if (transport) { | 1460 | if (transport && !tchunk->tsn_gap_acked) { |
1461 | /* If this chunk is being used for RTT | 1461 | /* If this chunk is being used for RTT |
1462 | * measurement, calculate the RTT and update | 1462 | * measurement, calculate the RTT and update |
1463 | * the RTO using this value. | 1463 | * the RTO using this value. |
@@ -1469,14 +1469,34 @@ static void sctp_check_transmitted(struct sctp_outq *q, | |||
1469 | * first instance of the packet or a later | 1469 | * first instance of the packet or a later |
1470 | * instance). | 1470 | * instance). |
1471 | */ | 1471 | */ |
1472 | if (!tchunk->tsn_gap_acked && | 1472 | if (!sctp_chunk_retransmitted(tchunk) && |
1473 | !sctp_chunk_retransmitted(tchunk) && | ||
1474 | tchunk->rtt_in_progress) { | 1473 | tchunk->rtt_in_progress) { |
1475 | tchunk->rtt_in_progress = 0; | 1474 | tchunk->rtt_in_progress = 0; |
1476 | rtt = jiffies - tchunk->sent_at; | 1475 | rtt = jiffies - tchunk->sent_at; |
1477 | sctp_transport_update_rto(transport, | 1476 | sctp_transport_update_rto(transport, |
1478 | rtt); | 1477 | rtt); |
1479 | } | 1478 | } |
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 | } | ||
1480 | } | 1500 | } |
1481 | 1501 | ||
1482 | /* If the chunk hasn't been marked as ACKED, | 1502 | /* If the chunk hasn't been marked as ACKED, |
@@ -1508,28 +1528,6 @@ static void sctp_check_transmitted(struct sctp_outq *q, | |||
1508 | restart_timer = 1; | 1528 | restart_timer = 1; |
1509 | forward_progress = true; | 1529 | forward_progress = true; |
1510 | 1530 | ||
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 | |||
1533 | list_add_tail(&tchunk->transmitted_list, | 1531 | list_add_tail(&tchunk->transmitted_list, |
1534 | &q->sacked); | 1532 | &q->sacked); |
1535 | } else { | 1533 | } else { |