From 6e4d4a3684914d071a9b9249217bb6222aeb1d24 Mon Sep 17 00:00:00 2001 From: Marco Varlese Date: Mon, 12 Mar 2018 12:36:59 +0100 Subject: SCTP: cumulative SACK fix A bug was found affecting the cumulative sending of SACK messages. Because the next0 was never assigned to the next_output the SACK message was never leaving the peer. Further, two new flags have been added to distinguish when a peer is AWAITING a SACK message (e.g. DATA is inflight and waiting to be acknowledged). Change-Id: Ibb5a98f7e5fed15cdc76710b74195cac031d59ed Signed-off-by: Marco Varlese --- src/vnet/sctp/sctp.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/vnet/sctp/sctp.h') diff --git a/src/vnet/sctp/sctp.h b/src/vnet/sctp/sctp.h index 32d3ab96862..f0ce5949285 100644 --- a/src/vnet/sctp/sctp.h +++ b/src/vnet/sctp/sctp.h @@ -93,7 +93,9 @@ enum _sctp_subconn_state { SCTP_SUBCONN_STATE_DOWN = 0, SCTP_SUBCONN_STATE_UP, - SCTP_SUBCONN_STATE_ALLOW_HB + SCTP_SUBCONN_STATE_ALLOW_HB, + SCTP_SUBCONN_AWAITING_SACK, + SCTP_SUBCONN_SACK_RECEIVED }; #define SCTP_INITIAL_SSHTRESH 65535 @@ -920,6 +922,8 @@ sctp_in_cong_recovery (sctp_connection_t * sctp_conn, u8 idx) always_inline u8 cwnd_fully_utilized (sctp_connection_t * sctp_conn, u8 idx) { + if (sctp_conn->sub_conn[idx].cwnd == 0) + return 1; return 0; } @@ -928,6 +932,7 @@ always_inline void update_cwnd (sctp_connection_t * sctp_conn) { u8 i; + u32 inflight = sctp_conn->next_tsn - sctp_conn->last_unacked_tsn; for (i = 0; i < MAX_SCTP_CONNECTIONS; i++) { @@ -960,6 +965,12 @@ update_cwnd (sctp_connection_t * sctp_conn) sctp_conn->sub_conn[i].cwnd = clib_min (sctp_conn->sub_conn[i].PMTU, 1); } + + /* Section 6.1; point (D) */ + if ((inflight + SCTP_RTO_BURST * sctp_conn->sub_conn[i].PMTU) < + sctp_conn->sub_conn[i].cwnd) + sctp_conn->sub_conn[i].cwnd = + inflight + SCTP_RTO_BURST * sctp_conn->sub_conn[i].PMTU; } } -- cgit 1.2.3-korg