net: sctp: find the correct highest_new_tsn in sack
Subsystems (3)
PATCH 1/1 net: sctp: find the correct highest_new_tsn in sack
Function sctp_check_transmitted(transport t, ...) would iterate all of transport->transmitted queue and looking for the highest __newly__ acked tsn. The original algorithm would depend on the order of the assoc->transport_list (in function sctp_outq_sack line 1215 - 1226). The result might not be the expected due to the order of the tranport_list.
Solution: checking if the exising is smaller than the new one before assigning
--- net/sctp/outqueue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/sctp/outqueue.c +2 -1
@@ -1397,7 +1397,8 @@ static void sctp_check_transmitted(struct sctp_outq *q,*/ if (!tchunk->tsn_gap_acked) { tchunk->tsn_gap_acked =1 ; - *highest_new_tsn_in_sack = tsn; +if (TSN_lt (*highest_new_tsn_in_sack, tsn)) + *highest_new_tsn_in_sack = tsn; bytes_acked +=sctp_data_size (tchunk);if (!tchunk->transport) migrate_bytes +=sctp_data_size (tchunk);
Signature · 1 line
1.8.4.3
Quoted 9 lines · Chang Xiangzhong
Function
sctp_check_transmitted(transport t, ...)would iterate all oftransport->transmittedqueue and looking for the highest__newly__acked tsn. The original algorithm would depend on the order of theassoc->transport_list(in functionsctp_outq_sackline 1215 - 1226). The result might not be the expected due to the order of thetranport_list.Solution: checking if the exising is smaller than the new one before assigning
Signed-off-by Chang Xiangzhong <[email protected]>
Good find. This has been around for since day 1. It doesn't so much depend on the order of the transport list, but on the order the transports been used. I agree it is a problem if chunks have been distributed across multiple transports and a singe SACK acking them all.
-vlad
Quoted 19 lines
--- net/sctp/outqueue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)net/sctp/outqueue.c +2
-1@@ -1397,7 +1397,8 @@ static void sctp_check_transmitted(struct sctp_outq *q,*/ if (!tchunk->tsn_gap_acked) { tchunk->tsn_gap_acked =1 ; - *highest_new_tsn_in_sack = tsn; +if (TSN_lt (*highest_new_tsn_in_sack, tsn)) + *highest_new_tsn_in_sack = tsn; bytes_acked +=sctp_data_size (tchunk);if (!tchunk->transport) migrate_bytes +=sctp_data_size (tchunk);
From: Vlad Yasevich <[email protected]>
Date: Thu, 21 Nov 2013 17:14:01 -0500
Quoted 9 lines · Chang Xiangzhong
Quoted 8 lines
Function
sctp_check_transmitted(transport t, ...)would iterate all oftransport->transmittedqueue and looking for the highest__newly__acked tsn. The original algorithm would depend on the order of theassoc->transport_list(in functionsctp_outq_sackline 1215 - 1226). The result might not be the expected due to the order of thetranport_list.Solution: checking if the exising is smaller than the new one before assigning
Quoted 8 lines
Quoted 1 line
Signed-off-by Chang Xiangzhong <[email protected]>Good find. This has been around for since day 1. It doesn't so much depend on the order of the transport list, but on the order the transports been used. I agree it is a problem if chunks have been distributed across multiple transports and a singe SACK acking them all.
Acked-by Vlad Yasevich <[email protected]>
Applied, thanks.
Quoted 31 lines · Chang Xiangzhong
Function
sctp_check_transmitted(transport t, ...)would iterate all oftransport->transmittedqueue and looking for the highest__newly__acked tsn. The original algorithm would depend on the order of theassoc->transport_list(in functionsctp_outq_sackline 1215 - 1226). The result might not be the expected due to the order of thetranport_list.Solution: checking if the exising is smaller than the new one before assigning
Signed-off-by Chang Xiangzhong <[email protected]>--- net/sctp/outqueue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)net/sctp/outqueue.c +2
-1@@ -1397,7 +1397,8 @@ static void sctp_check_transmitted(struct sctp_outq *q,*/ if (!tchunk->tsn_gap_acked) { tchunk->tsn_gap_acked =1 ; - *highest_new_tsn_in_sack = tsn; +if (TSN_lt (*highest_new_tsn_in_sack, tsn)) + *highest_new_tsn_in_sack = tsn; bytes_acked +=sctp_data_size (tchunk);if (!tchunk->transport) migrate_bytes +=sctp_data_size (tchunk);Signature · 1 line
1.8.4.3