Lines Matching full:asoc
65 struct sctp_association *asoc,
69 sctp_set_rwnd(struct sctp_tcb *stcb, struct sctp_association *asoc) in sctp_set_rwnd() argument
71 asoc->my_rwnd = sctp_calc_rwnd(stcb, asoc); in sctp_set_rwnd()
76 sctp_calc_rwnd(struct sctp_tcb *stcb, struct sctp_association *asoc) in sctp_calc_rwnd() argument
90 KASSERT(asoc->cnt_on_reasm_queue > 0 || asoc->size_on_reasm_queue == 0, in sctp_calc_rwnd()
91 ("size_on_reasm_queue is %u", asoc->size_on_reasm_queue)); in sctp_calc_rwnd()
92 KASSERT(asoc->cnt_on_all_streams > 0 || asoc->size_on_all_streams == 0, in sctp_calc_rwnd()
93 ("size_on_all_streams is %u", asoc->size_on_all_streams)); in sctp_calc_rwnd()
94 if (stcb->asoc.sb_cc == 0 && in sctp_calc_rwnd()
95 asoc->cnt_on_reasm_queue == 0 && in sctp_calc_rwnd()
96 asoc->cnt_on_all_streams == 0) { in sctp_calc_rwnd()
102 calc = (uint32_t)sctp_sbspace(&stcb->asoc, &stcb->sctp_socket->so_rcv); in sctp_calc_rwnd()
107 calc = sctp_sbspace_sub(calc, (uint32_t)(asoc->size_on_reasm_queue + in sctp_calc_rwnd()
108 asoc->cnt_on_reasm_queue * MSIZE)); in sctp_calc_rwnd()
109 calc = sctp_sbspace_sub(calc, (uint32_t)(asoc->size_on_all_streams + in sctp_calc_rwnd()
110 asoc->cnt_on_all_streams * MSIZE)); in sctp_calc_rwnd()
117 calc = sctp_sbspace_sub(calc, stcb->asoc.my_rwnd_control_len); in sctp_calc_rwnd()
122 if (calc < stcb->asoc.my_rwnd_control_len) { in sctp_calc_rwnd()
161 if (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { in sctp_build_readq_entry()
283 sctp_mark_non_revokable(struct sctp_association *asoc, uint32_t tsn) in sctp_mark_non_revokable() argument
291 if (SCTP_TSN_GE(asoc->cumulative_tsn, tsn)) { in sctp_mark_non_revokable()
298 SCTP_CALC_TSN_TO_GAP(gap, tsn, asoc->mapping_array_base_tsn); in sctp_mark_non_revokable()
299 in_r = SCTP_IS_TSN_PRESENT(asoc->mapping_array, gap); in sctp_mark_non_revokable()
300 in_nr = SCTP_IS_TSN_PRESENT(asoc->nr_mapping_array, gap); in sctp_mark_non_revokable()
303 SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap); in sctp_mark_non_revokable()
304 if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) { in sctp_mark_non_revokable()
305 asoc->highest_tsn_inside_nr_map = tsn; in sctp_mark_non_revokable()
309 SCTP_UNSET_TSN_PRESENT(asoc->mapping_array, gap); in sctp_mark_non_revokable()
310 if (tsn == asoc->highest_tsn_inside_map) { in sctp_mark_non_revokable()
312 for (i = tsn - 1; SCTP_TSN_GE(i, asoc->mapping_array_base_tsn); i--) { in sctp_mark_non_revokable()
313 SCTP_CALC_TSN_TO_GAP(gap, i, asoc->mapping_array_base_tsn); in sctp_mark_non_revokable()
314 if (SCTP_IS_TSN_PRESENT(asoc->mapping_array, gap)) { in sctp_mark_non_revokable()
315 asoc->highest_tsn_inside_map = i; in sctp_mark_non_revokable()
319 if (!SCTP_TSN_GE(i, asoc->mapping_array_base_tsn)) { in sctp_mark_non_revokable()
320 asoc->highest_tsn_inside_map = asoc->mapping_array_base_tsn - 1; in sctp_mark_non_revokable()
328 struct sctp_association *asoc, in sctp_place_control_in_stream() argument
339 if (asoc->idata_supported == 0) { in sctp_place_control_in_stream()
370 if (SCTP_MID_GT(asoc->idata_supported, at->mid, control->mid)) { in sctp_place_control_in_stream()
382 } else if (SCTP_MID_EQ(asoc->idata_supported, at->mid, control->mid)) { in sctp_place_control_in_stream()
421 if (stcb->asoc.idata_supported) { in sctp_abort_in_reasm()
479 struct sctp_association *asoc, in sctp_queue_data_to_stream() argument
507 strm = &asoc->strmin[control->sinfo_stream]; in sctp_queue_data_to_stream()
511 if (SCTP_MID_GT((asoc->idata_supported), strm->last_mid_delivered, control->mid)) { in sctp_queue_data_to_stream()
520 if (asoc->idata_supported) { in sctp_queue_data_to_stream()
538 asoc->size_on_all_streams += control->length; in sctp_queue_data_to_stream()
539 sctp_ucount_incr(asoc->cnt_on_all_streams); in sctp_queue_data_to_stream()
541 if (SCTP_MID_EQ(asoc->idata_supported, nxt_todel, control->mid)) { in sctp_queue_data_to_stream()
548 if (asoc->size_on_all_streams >= control->length) { in sctp_queue_data_to_stream()
549 asoc->size_on_all_streams -= control->length; in sctp_queue_data_to_stream()
552 …panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, contro… in sctp_queue_data_to_stream()
554 asoc->size_on_all_streams = 0; in sctp_queue_data_to_stream()
557 sctp_ucount_decr(asoc->cnt_on_all_streams); in sctp_queue_data_to_stream()
559 sctp_mark_non_revokable(asoc, control->sinfo_tsn); in sctp_queue_data_to_stream()
567 if (SCTP_MID_EQ(asoc->idata_supported, nxt_todel, control->mid) && in sctp_queue_data_to_stream()
571 if (asoc->size_on_all_streams >= control->length) { in sctp_queue_data_to_stream()
572 asoc->size_on_all_streams -= control->length; in sctp_queue_data_to_stream()
575 …panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, contro… in sctp_queue_data_to_stream()
577 asoc->size_on_all_streams = 0; in sctp_queue_data_to_stream()
580 sctp_ucount_decr(asoc->cnt_on_all_streams); in sctp_queue_data_to_stream()
599 sctp_mark_non_revokable(asoc, control->sinfo_tsn); in sctp_queue_data_to_stream()
606 } else if (SCTP_MID_EQ(asoc->idata_supported, nxt_todel, control->mid)) { in sctp_queue_data_to_stream()
617 if (sctp_place_control_in_stream(strm, asoc, control)) { in sctp_queue_data_to_stream()
751 struct sctp_association *asoc, in sctp_handle_old_unordered_data() argument
788 sctp_add_chk_to_control(control, strm, stcb, asoc, chk, inp_read_lock_held); in sctp_handle_old_unordered_data()
804 if (asoc->size_on_reasm_queue >= tchk->send_size) { in sctp_handle_old_unordered_data()
805 asoc->size_on_reasm_queue -= tchk->send_size; in sctp_handle_old_unordered_data()
808 …panic("size_on_reasm_queue = %u smaller than chunk length %u", asoc->size_on_reasm_queue, tchk->se… in sctp_handle_old_unordered_data()
810 asoc->size_on_reasm_queue = 0; in sctp_handle_old_unordered_data()
813 sctp_ucount_decr(asoc->cnt_on_reasm_queue); in sctp_handle_old_unordered_data()
819 sctp_mark_non_revokable(asoc, tchk->rec.data.tsn); in sctp_handle_old_unordered_data()
896 struct sctp_association *asoc, in sctp_inject_old_unordered_data() argument
993 sctp_mark_non_revokable(asoc, chk->rec.data.tsn); in sctp_inject_old_unordered_data()
1007 asoc->size_on_reasm_queue += chk->send_size; in sctp_inject_old_unordered_data()
1008 sctp_ucount_incr(asoc->cnt_on_reasm_queue); in sctp_inject_old_unordered_data()
1026 asoc->size_on_reasm_queue += chk->send_size; in sctp_inject_old_unordered_data()
1027 sctp_ucount_incr(asoc->cnt_on_reasm_queue); in sctp_inject_old_unordered_data()
1034 sctp_deliver_reasm_check(struct sctp_tcb *stcb, struct sctp_association *asoc, in sctp_deliver_reasm_check() argument
1057 (asoc->idata_supported == 0)) { in sctp_deliver_reasm_check()
1059 if (sctp_handle_old_unordered_data(stcb, asoc, strm, control, pd_point, inp_read_lock_held)) { in sctp_deliver_reasm_check()
1082 if (asoc->size_on_all_streams >= control->length) { in sctp_deliver_reasm_check()
1083 asoc->size_on_all_streams -= control->length; in sctp_deliver_reasm_check()
1086 …panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, contro… in sctp_deliver_reasm_check()
1088 asoc->size_on_all_streams = 0; in sctp_deliver_reasm_check()
1091 sctp_ucount_decr(asoc->cnt_on_all_streams); in sctp_deliver_reasm_check()
1124 if (SCTP_MID_EQ(asoc->idata_supported, strm->last_mid_delivered, control->mid)) { in sctp_deliver_reasm_check()
1147 if (asoc->size_on_all_streams >= control->length) { in sctp_deliver_reasm_check()
1148 asoc->size_on_all_streams -= control->length; in sctp_deliver_reasm_check()
1151 …panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, contro… in sctp_deliver_reasm_check()
1153 asoc->size_on_all_streams = 0; in sctp_deliver_reasm_check()
1156 sctp_ucount_decr(asoc->cnt_on_all_streams); in sctp_deliver_reasm_check()
1187 if (SCTP_MID_EQ(asoc->idata_supported, control->mid, next_to_del) && in sctp_deliver_reasm_check()
1203 if (asoc->size_on_all_streams >= control->length) { in sctp_deliver_reasm_check()
1204 asoc->size_on_all_streams -= control->length; in sctp_deliver_reasm_check()
1207 …panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, contro… in sctp_deliver_reasm_check()
1209 asoc->size_on_all_streams = 0; in sctp_deliver_reasm_check()
1212 sctp_ucount_decr(asoc->cnt_on_all_streams); in sctp_deliver_reasm_check()
1222 sctp_mark_non_revokable(asoc, control->sinfo_tsn); in sctp_deliver_reasm_check()
1239 if (asoc->size_on_all_streams >= control->length) { in sctp_deliver_reasm_check()
1240 asoc->size_on_all_streams -= control->length; in sctp_deliver_reasm_check()
1243 …panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, contro… in sctp_deliver_reasm_check()
1245 asoc->size_on_all_streams = 0; in sctp_deliver_reasm_check()
1270 struct sctp_tcb *stcb, struct sctp_association *asoc, in sctp_add_chk_to_control() argument
1297 asoc->size_on_reasm_queue -= chk->send_size; in sctp_add_chk_to_control()
1298 sctp_ucount_decr(asoc->cnt_on_reasm_queue); in sctp_add_chk_to_control()
1299 sctp_mark_non_revokable(asoc, chk->rec.data.tsn); in sctp_add_chk_to_control()
1325 sctp_ucount_decr(asoc->cnt_on_all_streams); in sctp_add_chk_to_control()
1352 sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc, in sctp_queue_data_for_reasm() argument
1364 strm = &asoc->strmin[control->sinfo_stream]; in sctp_queue_data_for_reasm()
1375 if ((unordered == 0) || (asoc->idata_supported)) { in sctp_queue_data_for_reasm()
1376 sctp_ucount_incr(asoc->cnt_on_all_streams); in sctp_queue_data_for_reasm()
1378 if (sctp_place_control_in_stream(strm, asoc, control)) { in sctp_queue_data_for_reasm()
1386 if ((tsn == (asoc->cumulative_tsn + 1) && (asoc->idata_supported == 0))) { in sctp_queue_data_for_reasm()
1400 if ((asoc->idata_supported == 0) && (unordered == 1)) { in sctp_queue_data_for_reasm()
1401 sctp_inject_old_unordered_data(stcb, asoc, control, chk, abort_flag); in sctp_queue_data_for_reasm()
1433 sctp_mark_non_revokable(asoc, chk->rec.data.tsn); in sctp_queue_data_for_reasm()
1437 asoc->size_on_all_streams += control->length; in sctp_queue_data_for_reasm()
1466 if (asoc->idata_supported || control->first_frag_seen) { in sctp_queue_data_for_reasm()
1495 if (asoc->idata_supported || control->first_frag_seen) { in sctp_queue_data_for_reasm()
1557 asoc->size_on_reasm_queue += chk->send_size; in sctp_queue_data_for_reasm()
1558 sctp_ucount_incr(asoc->cnt_on_reasm_queue); in sctp_queue_data_for_reasm()
1588 asoc->size_on_reasm_queue += chk->send_size; in sctp_queue_data_for_reasm()
1589 sctp_ucount_incr(asoc->cnt_on_reasm_queue); in sctp_queue_data_for_reasm()
1613 lenadded = sctp_add_chk_to_control(control, strm, stcb, asoc, at, SCTP_READ_LOCK_NOT_HELD); in sctp_queue_data_for_reasm()
1624 asoc->size_on_all_streams += lenadded; in sctp_queue_data_for_reasm()
1677 sctp_process_a_data_chunk(struct sctp_tcb *stcb, struct sctp_association *asoc, in sctp_process_a_data_chunk() argument
1740 asoc->send_sack = 1; in sctp_process_a_data_chunk()
1744 sctp_log_map(tsn, asoc->cumulative_tsn, asoc->highest_tsn_inside_map, SCTP_MAP_TSN_ENTERS); in sctp_process_a_data_chunk()
1750 if (SCTP_TSN_GE(asoc->cumulative_tsn, tsn)) { in sctp_process_a_data_chunk()
1753 if (asoc->numduptsns < SCTP_MAX_DUP_TSNS) { in sctp_process_a_data_chunk()
1755 asoc->dup_tsns[asoc->numduptsns] = tsn; in sctp_process_a_data_chunk()
1756 asoc->numduptsns++; in sctp_process_a_data_chunk()
1758 asoc->send_sack = 1; in sctp_process_a_data_chunk()
1762 SCTP_CALC_TSN_TO_GAP(gap, tsn, asoc->mapping_array_base_tsn); in sctp_process_a_data_chunk()
1767 if (gap >= (uint32_t)(asoc->mapping_array_size << 3)) { in sctp_process_a_data_chunk()
1769 if (sctp_expand_mapping_array(asoc, gap)) { in sctp_process_a_data_chunk()
1778 if (SCTP_IS_TSN_PRESENT(asoc->mapping_array, gap) || in sctp_process_a_data_chunk()
1779 SCTP_IS_TSN_PRESENT(asoc->nr_mapping_array, gap)) { in sctp_process_a_data_chunk()
1781 if (asoc->numduptsns < SCTP_MAX_DUP_TSNS) { in sctp_process_a_data_chunk()
1783 asoc->dup_tsns[asoc->numduptsns] = tsn; in sctp_process_a_data_chunk()
1784 asoc->numduptsns++; in sctp_process_a_data_chunk()
1786 asoc->send_sack = 1; in sctp_process_a_data_chunk()
1795 (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET))) { in sctp_process_a_data_chunk()
1812 if (sid >= asoc->streamincnt) { in sctp_process_a_data_chunk()
1835 SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap); in sctp_process_a_data_chunk()
1836 if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) { in sctp_process_a_data_chunk()
1837 asoc->highest_tsn_inside_nr_map = tsn; in sctp_process_a_data_chunk()
1839 if (tsn == (asoc->cumulative_tsn + 1)) { in sctp_process_a_data_chunk()
1841 asoc->cumulative_tsn = tsn; in sctp_process_a_data_chunk()
1860 control = sctp_find_reasm_entry(&asoc->strmin[sid], mid, ordered, asoc->idata_supported); in sctp_process_a_data_chunk()
1904 if (ordered || asoc->idata_supported) { in sctp_process_a_data_chunk()
1924 if (((asoc->cnt_on_all_streams + in sctp_process_a_data_chunk()
1925 asoc->cnt_on_reasm_queue + in sctp_process_a_data_chunk()
1926 asoc->cnt_msg_on_sb) >= SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue)) || in sctp_process_a_data_chunk()
1927 (((int)asoc->my_rwnd) <= 0)) { in sctp_process_a_data_chunk()
1938 if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_map) && in sctp_process_a_data_chunk()
1939 SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) { in sctp_process_a_data_chunk()
1942 sctp_set_rwnd(stcb, asoc); in sctp_process_a_data_chunk()
1943 if ((asoc->cnt_on_all_streams + in sctp_process_a_data_chunk()
1944 asoc->cnt_on_reasm_queue + in sctp_process_a_data_chunk()
1945 asoc->cnt_msg_on_sb) >= SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue)) { in sctp_process_a_data_chunk()
1964 if (asoc->tsn_in_at >= SCTP_TSN_LOG_SIZE) { in sctp_process_a_data_chunk()
1965 asoc->tsn_in_at = 0; in sctp_process_a_data_chunk()
1966 asoc->tsn_in_wrapped = 1; in sctp_process_a_data_chunk()
1968 asoc->in_tsnlog[asoc->tsn_in_at].tsn = tsn; in sctp_process_a_data_chunk()
1969 asoc->in_tsnlog[asoc->tsn_in_at].strm = sid; in sctp_process_a_data_chunk()
1970 asoc->in_tsnlog[asoc->tsn_in_at].seq = mid; in sctp_process_a_data_chunk()
1971 asoc->in_tsnlog[asoc->tsn_in_at].sz = chk_length; in sctp_process_a_data_chunk()
1972 asoc->in_tsnlog[asoc->tsn_in_at].flgs = chunk_flags; in sctp_process_a_data_chunk()
1973 asoc->in_tsnlog[asoc->tsn_in_at].stcb = (void *)stcb; in sctp_process_a_data_chunk()
1974 asoc->in_tsnlog[asoc->tsn_in_at].in_pos = asoc->tsn_in_at; in sctp_process_a_data_chunk()
1975 asoc->in_tsnlog[asoc->tsn_in_at].in_out = 1; in sctp_process_a_data_chunk()
1976 asoc->tsn_in_at++; in sctp_process_a_data_chunk()
1986 (TAILQ_EMPTY(&asoc->resetHead)) && in sctp_process_a_data_chunk()
1988 SCTP_MID_GE(asoc->idata_supported, asoc->strmin[sid].last_mid_delivered, mid)) { in sctp_process_a_data_chunk()
1991 mid, asoc->strmin[sid].last_mid_delivered); in sctp_process_a_data_chunk()
1993 if (asoc->idata_supported) { in sctp_process_a_data_chunk()
1995 asoc->strmin[sid].last_mid_delivered, in sctp_process_a_data_chunk()
2001 (uint16_t)asoc->strmin[sid].last_mid_delivered, in sctp_process_a_data_chunk()
2073 sctp_build_readq_entry_mac(control, stcb, asoc->context, net, tsn, in sctp_process_a_data_chunk()
2104 TAILQ_EMPTY(&asoc->resetHead) && in sctp_process_a_data_chunk()
2106 (SCTP_MID_EQ(asoc->idata_supported, asoc->strmin[sid].last_mid_delivered + 1, mid) && in sctp_process_a_data_chunk()
2107 TAILQ_EMPTY(&asoc->strmin[sid].inqueue)))) { in sctp_process_a_data_chunk()
2116 SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap); in sctp_process_a_data_chunk()
2117 if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) { in sctp_process_a_data_chunk()
2118 asoc->highest_tsn_inside_nr_map = tsn; in sctp_process_a_data_chunk()
2129 asoc->strmin[sid].last_mid_delivered++; in sctp_process_a_data_chunk()
2158 chk->rec.data.context = stcb->asoc.context; in sctp_process_a_data_chunk()
2161 chk->asoc = asoc; in sctp_process_a_data_chunk()
2172 SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap); in sctp_process_a_data_chunk()
2173 if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) { in sctp_process_a_data_chunk()
2174 asoc->highest_tsn_inside_nr_map = tsn; in sctp_process_a_data_chunk()
2177 SCTP_SET_TSN_PRESENT(asoc->mapping_array, gap); in sctp_process_a_data_chunk()
2178 if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_map)) { in sctp_process_a_data_chunk()
2179 asoc->highest_tsn_inside_map = tsn; in sctp_process_a_data_chunk()
2192 if (((liste = TAILQ_FIRST(&asoc->resetHead)) != NULL) && in sctp_process_a_data_chunk()
2198 if (TAILQ_EMPTY(&asoc->pending_reply_queue)) { in sctp_process_a_data_chunk()
2200 TAILQ_INSERT_TAIL(&asoc->pending_reply_queue, control, next); in sctp_process_a_data_chunk()
2205 TAILQ_FOREACH_SAFE(lcontrol, &asoc->pending_reply_queue, next, nlcontrol) { in sctp_process_a_data_chunk()
2221 TAILQ_INSERT_TAIL(&asoc->pending_reply_queue, control, next); in sctp_process_a_data_chunk()
2230 sctp_mark_non_revokable(asoc, control->sinfo_tsn); in sctp_process_a_data_chunk()
2239 sctp_queue_data_to_stream(stcb, asoc, control, abort_flag, &need_reasm_check); in sctp_process_a_data_chunk()
2254 sctp_queue_data_for_reasm(stcb, asoc, control, chk, created_control, abort_flag, tsn); in sctp_process_a_data_chunk()
2267 if (tsn == (asoc->cumulative_tsn + 1)) { in sctp_process_a_data_chunk()
2269 asoc->cumulative_tsn = tsn; in sctp_process_a_data_chunk()
2285 sctp_log_map(asoc->mapping_array_base_tsn, asoc->cumulative_tsn, in sctp_process_a_data_chunk()
2286 asoc->highest_tsn_inside_map, SCTP_MAP_PREPARE_SLIDE); in sctp_process_a_data_chunk()
2289 (void)sctp_deliver_reasm_check(stcb, asoc, &asoc->strmin[sid], SCTP_READ_LOCK_NOT_HELD); in sctp_process_a_data_chunk()
2293 if (((liste = TAILQ_FIRST(&asoc->resetHead)) != NULL) && in sctp_process_a_data_chunk()
2294 SCTP_TSN_GE(asoc->cumulative_tsn, liste->tsn)) { in sctp_process_a_data_chunk()
2302 TAILQ_REMOVE(&asoc->resetHead, liste, next_resp); in sctp_process_a_data_chunk()
2306 liste = TAILQ_FIRST(&asoc->resetHead); in sctp_process_a_data_chunk()
2307 if (TAILQ_EMPTY(&asoc->resetHead)) { in sctp_process_a_data_chunk()
2309 TAILQ_FOREACH_SAFE(control, &asoc->pending_reply_queue, next, ncontrol) { in sctp_process_a_data_chunk()
2310 TAILQ_REMOVE(&asoc->pending_reply_queue, control, next); in sctp_process_a_data_chunk()
2311 strm = &asoc->strmin[control->sinfo_stream]; in sctp_process_a_data_chunk()
2312 sctp_queue_data_to_stream(stcb, asoc, control, abort_flag, &need_reasm_check); in sctp_process_a_data_chunk()
2317 (void)sctp_deliver_reasm_check(stcb, asoc, strm, SCTP_READ_LOCK_NOT_HELD); in sctp_process_a_data_chunk()
2322 TAILQ_FOREACH_SAFE(control, &asoc->pending_reply_queue, next, ncontrol) { in sctp_process_a_data_chunk()
2331 TAILQ_REMOVE(&asoc->pending_reply_queue, control, next); in sctp_process_a_data_chunk()
2332 strm = &asoc->strmin[control->sinfo_stream]; in sctp_process_a_data_chunk()
2333 sctp_queue_data_to_stream(stcb, asoc, control, abort_flag, &need_reasm_check); in sctp_process_a_data_chunk()
2338 (void)sctp_deliver_reasm_check(stcb, asoc, strm, SCTP_READ_LOCK_NOT_HELD); in sctp_process_a_data_chunk()
2397 struct sctp_association *asoc; in sctp_slide_mapping_arrays() local
2403 asoc = &stcb->asoc; in sctp_slide_mapping_arrays()
2405 old_cumack = asoc->cumulative_tsn; in sctp_slide_mapping_arrays()
2406 old_base = asoc->mapping_array_base_tsn; in sctp_slide_mapping_arrays()
2407 old_highest = asoc->highest_tsn_inside_map; in sctp_slide_mapping_arrays()
2413 for (slide_from = 0; slide_from < stcb->asoc.mapping_array_size; slide_from++) { in sctp_slide_mapping_arrays()
2414 val = asoc->nr_mapping_array[slide_from] | asoc->mapping_array[slide_from]; in sctp_slide_mapping_arrays()
2423 asoc->cumulative_tsn = asoc->mapping_array_base_tsn + (at - 1); in sctp_slide_mapping_arrays()
2425 if (SCTP_TSN_GT(asoc->cumulative_tsn, asoc->highest_tsn_inside_map) && in sctp_slide_mapping_arrays()
2426 SCTP_TSN_GT(asoc->cumulative_tsn, asoc->highest_tsn_inside_nr_map)) { in sctp_slide_mapping_arrays()
2429 asoc->cumulative_tsn, asoc->highest_tsn_inside_map); in sctp_slide_mapping_arrays()
2432 asoc->cumulative_tsn, asoc->highest_tsn_inside_map); in sctp_slide_mapping_arrays()
2433 sctp_print_mapping_array(asoc); in sctp_slide_mapping_arrays()
2435 sctp_log_map(0, 6, asoc->highest_tsn_inside_map, SCTP_MAP_SLIDE_RESULT); in sctp_slide_mapping_arrays()
2437 asoc->highest_tsn_inside_map = asoc->cumulative_tsn; in sctp_slide_mapping_arrays()
2438 asoc->highest_tsn_inside_nr_map = asoc->cumulative_tsn; in sctp_slide_mapping_arrays()
2441 if (SCTP_TSN_GT(asoc->highest_tsn_inside_nr_map, asoc->highest_tsn_inside_map)) { in sctp_slide_mapping_arrays()
2442 highest_tsn = asoc->highest_tsn_inside_nr_map; in sctp_slide_mapping_arrays()
2444 highest_tsn = asoc->highest_tsn_inside_map; in sctp_slide_mapping_arrays()
2446 if ((asoc->cumulative_tsn == highest_tsn) && (at >= 8)) { in sctp_slide_mapping_arrays()
2456 if (clr > asoc->mapping_array_size) { in sctp_slide_mapping_arrays()
2457 clr = asoc->mapping_array_size; in sctp_slide_mapping_arrays()
2459 memset(asoc->mapping_array, 0, clr); in sctp_slide_mapping_arrays()
2460 memset(asoc->nr_mapping_array, 0, clr); in sctp_slide_mapping_arrays()
2462 for (i = 0; i < asoc->mapping_array_size; i++) { in sctp_slide_mapping_arrays()
2463 if ((asoc->mapping_array[i]) || (asoc->nr_mapping_array[i])) { in sctp_slide_mapping_arrays()
2465 sctp_print_mapping_array(asoc); in sctp_slide_mapping_arrays()
2469 asoc->mapping_array_base_tsn = asoc->cumulative_tsn + 1; in sctp_slide_mapping_arrays()
2470 asoc->highest_tsn_inside_nr_map = asoc->highest_tsn_inside_map = asoc->cumulative_tsn; in sctp_slide_mapping_arrays()
2479 SCTP_CALC_TSN_TO_GAP(lgap, highest_tsn, asoc->mapping_array_base_tsn); in sctp_slide_mapping_arrays()
2482 sctp_print_mapping_array(asoc); in sctp_slide_mapping_arrays()
2491 if (slide_end > asoc->mapping_array_size) { in sctp_slide_mapping_arrays()
2496 asoc->mapping_array_size, slide_end); in sctp_slide_mapping_arrays()
2497 slide_end = asoc->mapping_array_size; in sctp_slide_mapping_arrays()
2507 if (distance + slide_from > asoc->mapping_array_size || in sctp_slide_mapping_arrays()
2517 (uint32_t)asoc->mapping_array_size, in sctp_slide_mapping_arrays()
2524 asoc->mapping_array[ii] = asoc->mapping_array[slide_from + ii]; in sctp_slide_mapping_arrays()
2525 asoc->nr_mapping_array[ii] = asoc->nr_mapping_array[slide_from + ii]; in sctp_slide_mapping_arrays()
2527 for (ii = distance; ii < asoc->mapping_array_size; ii++) { in sctp_slide_mapping_arrays()
2528 asoc->mapping_array[ii] = 0; in sctp_slide_mapping_arrays()
2529 asoc->nr_mapping_array[ii] = 0; in sctp_slide_mapping_arrays()
2531 if (asoc->highest_tsn_inside_map + 1 == asoc->mapping_array_base_tsn) { in sctp_slide_mapping_arrays()
2532 asoc->highest_tsn_inside_map += (slide_from << 3); in sctp_slide_mapping_arrays()
2534 if (asoc->highest_tsn_inside_nr_map + 1 == asoc->mapping_array_base_tsn) { in sctp_slide_mapping_arrays()
2535 asoc->highest_tsn_inside_nr_map += (slide_from << 3); in sctp_slide_mapping_arrays()
2537 asoc->mapping_array_base_tsn += (slide_from << 3); in sctp_slide_mapping_arrays()
2539 sctp_log_map(asoc->mapping_array_base_tsn, in sctp_slide_mapping_arrays()
2540 asoc->cumulative_tsn, asoc->highest_tsn_inside_map, in sctp_slide_mapping_arrays()
2550 struct sctp_association *asoc; in sctp_sack_check() local
2555 asoc = &stcb->asoc; in sctp_sack_check()
2556 if (SCTP_TSN_GT(asoc->highest_tsn_inside_nr_map, asoc->highest_tsn_inside_map)) { in sctp_sack_check()
2557 highest_tsn = asoc->highest_tsn_inside_nr_map; in sctp_sack_check()
2559 highest_tsn = asoc->highest_tsn_inside_map; in sctp_sack_check()
2562 is_a_gap = SCTP_TSN_GT(highest_tsn, stcb->asoc.cumulative_tsn); in sctp_sack_check()
2574 if (SCTP_OS_TIMER_PENDING(&stcb->asoc.dack_timer.timer)) { in sctp_sack_check()
2580 ((stcb->asoc.alternate) ? stcb->asoc.alternate : stcb->asoc.primary_destination)); in sctp_sack_check()
2589 stcb->asoc.cmt_dac_pkts_rcvd++; in sctp_sack_check()
2591 if ((stcb->asoc.send_sack == 1) || /* We need to send a in sctp_sack_check()
2595 (stcb->asoc.numduptsns) || /* we have dup's */ in sctp_sack_check()
2597 (stcb->asoc.delayed_ack == 0) || /* Delayed sack disabled */ in sctp_sack_check()
2598 (stcb->asoc.data_pkts_seen >= stcb->asoc.sack_freq)) { /* hit limit of pkts */ in sctp_sack_check()
2599 if ((stcb->asoc.sctp_cmt_on_off > 0) && in sctp_sack_check()
2601 (stcb->asoc.send_sack == 0) && in sctp_sack_check()
2602 (stcb->asoc.numduptsns == 0) && in sctp_sack_check()
2603 (stcb->asoc.delayed_ack) && in sctp_sack_check()
2604 (!SCTP_OS_TIMER_PENDING(&stcb->asoc.dack_timer.timer))) { in sctp_sack_check()
2628 if (!SCTP_OS_TIMER_PENDING(&stcb->asoc.dack_timer.timer)) { in sctp_sack_check()
2642 struct sctp_association *asoc; in sctp_process_data() local
2652 sctp_set_rwnd(stcb, &stcb->asoc); in sctp_process_data()
2656 asoc = &stcb->asoc; in sctp_process_data()
2657 if (SCTP_TSN_GT(asoc->highest_tsn_inside_nr_map, asoc->highest_tsn_inside_map)) { in sctp_process_data()
2658 highest_tsn = asoc->highest_tsn_inside_nr_map; in sctp_process_data()
2660 highest_tsn = asoc->highest_tsn_inside_map; in sctp_process_data()
2662 was_a_gap = SCTP_TSN_GT(highest_tsn, stcb->asoc.cumulative_tsn); in sctp_process_data()
2668 asoc->last_data_chunk_from = net; in sctp_process_data()
2708 *high_tsn = asoc->cumulative_tsn; in sctp_process_data()
2710 asoc->data_pkts_seen++; in sctp_process_data()
2719 if ((asoc->idata_supported == 1) && in sctp_process_data()
2730 if ((asoc->idata_supported == 0) && in sctp_process_data()
2774 if (sctp_process_a_data_chunk(stcb, asoc, mm, *offset, in sctp_process_data()
2911 stcb->asoc.overall_error_count, in sctp_process_data()
2916 stcb->asoc.overall_error_count = 0; in sctp_process_data()
2917 (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_last_rcvd); in sctp_process_data()
2922 stcb->asoc.send_sack = 1; in sctp_process_data()
2944 tp1 = TAILQ_FIRST(&stcb->asoc.sent_queue); in sctp_process_segment_range()
3059 if (stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) { in sctp_process_segment_range()
3060 (*stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) (tp1->whoTo, in sctp_process_segment_range()
3078 &stcb->asoc, in sctp_process_segment_range()
3093 stcb->asoc.this_sack_highest_gap)) { in sctp_process_segment_range()
3094 stcb->asoc.this_sack_highest_gap = in sctp_process_segment_range()
3098 sctp_ucount_decr(stcb->asoc.sent_queue_retran_cnt); in sctp_process_segment_range()
3101 (stcb->asoc.sent_queue_retran_cnt & 0x000000ff)); in sctp_process_segment_range()
3121 if (stcb->asoc.strmout[tp1->rec.data.sid].chunks_on_queues > 0) { in sctp_process_segment_range()
3122 stcb->asoc.strmout[tp1->rec.data.sid].chunks_on_queues--; in sctp_process_segment_range()
3128 if ((stcb->asoc.strmout[tp1->rec.data.sid].chunks_on_queues == 0) && in sctp_process_segment_range()
3129 (stcb->asoc.strmout[tp1->rec.data.sid].state == SCTP_STREAM_RESET_PENDING) && in sctp_process_segment_range()
3130 TAILQ_EMPTY(&stcb->asoc.strmout[tp1->rec.data.sid].outqueue)) { in sctp_process_segment_range()
3131 stcb->asoc.trigger_reset = 1; in sctp_process_segment_range()
3139 sctp_free_bufspace(stcb, &stcb->asoc, tp1, 1); in sctp_process_segment_range()
3154 tp1 = TAILQ_FIRST(&stcb->asoc.sent_queue); in sctp_process_segment_range()
3159 tp1 = TAILQ_FIRST(&stcb->asoc.sent_queue); in sctp_process_segment_range()
3168 …_handle_segments(struct mbuf *m, int *offset, struct sctp_tcb *stcb, struct sctp_association *asoc, in sctp_handle_segments() argument
3181 tp1 = TAILQ_FIRST(&asoc->sent_queue); in sctp_handle_segments()
3188 tp1 = TAILQ_FIRST(&asoc->sent_queue); in sctp_handle_segments()
3205 tp1 = TAILQ_FIRST(&asoc->sent_queue); in sctp_handle_segments()
3233 struct sctp_association *asoc, uint32_t cumack, in sctp_check_for_revoked() argument
3238 TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { in sctp_check_for_revoked()
3272 sctp_log_sack(asoc->last_acked_seq, in sctp_check_for_revoked()
3290 sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, struct sctp_association *asoc, in sctp_strike_gap_ack_chunks() argument
3304 tp1 = TAILQ_FIRST(&stcb->asoc.send_queue); in sctp_strike_gap_ack_chunks()
3306 sending_seq = asoc->sending_seq; in sctp_strike_gap_ack_chunks()
3312 if ((asoc->sctp_cmt_on_off > 0) && in sctp_strike_gap_ack_chunks()
3314 TAILQ_FOREACH(net, &asoc->nets, sctp_next) { in sctp_strike_gap_ack_chunks()
3319 if (stcb->asoc.prsctp_supported) { in sctp_strike_gap_ack_chunks()
3322 TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { in sctp_strike_gap_ack_chunks()
3340 if (stcb->asoc.prsctp_supported) { in sctp_strike_gap_ack_chunks()
3353 if (SCTP_TSN_GT(tp1->rec.data.tsn, asoc->this_sack_highest_gap) && in sctp_strike_gap_ack_chunks()
3354 !(accum_moved && asoc->fast_retran_loss_recovery)) { in sctp_strike_gap_ack_chunks()
3381 !(accum_moved && asoc->fast_retran_loss_recovery)) { in sctp_strike_gap_ack_chunks()
3400 * asoc->fast_retran_loss_recovery && (sctp_cmt_on_off == in sctp_strike_gap_ack_chunks()
3403 if (accum_moved && asoc->fast_retran_loss_recovery) { in sctp_strike_gap_ack_chunks()
3417 if ((asoc->sctp_cmt_on_off > 0) && in sctp_strike_gap_ack_chunks()
3443 (asoc->sctp_cmt_on_off == 0)) { in sctp_strike_gap_ack_chunks()
3454 * this for singly homed asoc's. However if the FR's in sctp_strike_gap_ack_chunks()
3458 (asoc->numnets < 2) in sctp_strike_gap_ack_chunks()
3480 if ((asoc->sctp_cmt_on_off > 0) && in sctp_strike_gap_ack_chunks()
3541 if ((asoc->sctp_cmt_on_off > 0) && in sctp_strike_gap_ack_chunks()
3581 if (stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) { in sctp_strike_gap_ack_chunks()
3582 (*stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) (tp1->whoTo, in sctp_strike_gap_ack_chunks()
3589 asoc->peers_rwnd, tp1->send_size, SCTP_BASE_SYSCTL(sctp_peer_chunk_oh)); in sctp_strike_gap_ack_chunks()
3592 asoc->peers_rwnd += (tp1->send_size + SCTP_BASE_SYSCTL(sctp_peer_chunk_oh)); in sctp_strike_gap_ack_chunks()
3597 if ((stcb->asoc.prsctp_supported) && in sctp_strike_gap_ack_chunks()
3628 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); in sctp_strike_gap_ack_chunks()
3629 if (asoc->sctp_cmt_on_off > 0) { in sctp_strike_gap_ack_chunks()
3638 if (asoc->sctp_cmt_pf > 0) { in sctp_strike_gap_ack_chunks()
3688 if (TAILQ_EMPTY(&asoc->send_queue)) { in sctp_strike_gap_ack_chunks()
3707 ttt = TAILQ_FIRST(&asoc->send_queue); in sctp_strike_gap_ack_chunks()
3736 struct sctp_association *asoc) in sctp_try_advance_peer_ack_point() argument
3742 if (asoc->prsctp_supported == 0) { in sctp_try_advance_peer_ack_point()
3745 TAILQ_FOREACH_SAFE(tp1, &asoc->sent_queue, sctp_next, tp2) { in sctp_try_advance_peer_ack_point()
3756 asoc->advanced_peer_ack_point, in sctp_try_advance_peer_ack_point()
3763 * retransmitted until the asoc fails. in sctp_try_advance_peer_ack_point()
3805 if (SCTP_TSN_GT(tp1->rec.data.tsn, asoc->advanced_peer_ack_point)) { in sctp_try_advance_peer_ack_point()
3806 asoc->advanced_peer_ack_point = tp1->rec.data.tsn; in sctp_try_advance_peer_ack_point()
3808 } else if (tp1->rec.data.tsn == asoc->advanced_peer_ack_point) { in sctp_try_advance_peer_ack_point()
3824 sctp_fs_audit(struct sctp_association *asoc) in sctp_fs_audit() argument
3835 entry_flight = asoc->total_flight; in sctp_fs_audit()
3836 entry_cnt = asoc->total_flight_count; in sctp_fs_audit()
3838 if (asoc->pr_sctp_cnt >= asoc->sent_queue_cnt) in sctp_fs_audit()
3841 TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) { in sctp_fs_audit()
3864 SCTP_PRINTF("asoc->total_flight: %d cnt: %d\n", in sctp_fs_audit()
3876 struct sctp_association *asoc, in sctp_window_probe_recovery() argument
3890 if (stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) { in sctp_window_probe_recovery()
3891 (*stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) (tp1->whoTo, in sctp_window_probe_recovery()
3898 sctp_ucount_incr(asoc->sent_queue_retran_cnt); in sctp_window_probe_recovery()
3914 struct sctp_association *asoc; in sctp_express_handle_sack() local
3925 rwnd, stcb->asoc.last_acked_seq, stcb->asoc.peers_rwnd); in sctp_express_handle_sack()
3929 stcb->asoc.cumack_log[stcb->asoc.cumack_log_at] = cumack; in sctp_express_handle_sack()
3930 stcb->asoc.cumack_log_at++; in sctp_express_handle_sack()
3931 if (stcb->asoc.cumack_log_at > SCTP_TSN_LOG_SIZE) { in sctp_express_handle_sack()
3932 stcb->asoc.cumack_log_at = 0; in sctp_express_handle_sack()
3935 asoc = &stcb->asoc; in sctp_express_handle_sack()
3936 old_rwnd = asoc->peers_rwnd; in sctp_express_handle_sack()
3937 if (SCTP_TSN_GT(asoc->last_acked_seq, cumack)) { in sctp_express_handle_sack()
3940 } else if (asoc->last_acked_seq == cumack) { in sctp_express_handle_sack()
3942 asoc->peers_rwnd = sctp_sbspace_sub(rwnd, in sctp_express_handle_sack()
3943 …(uint32_t)(asoc->total_flight + (asoc->total_flight_count * SCTP_BASE_SYSCTL(sctp_peer_chunk_oh)))… in sctp_express_handle_sack()
3944 if (asoc->peers_rwnd < stcb->sctp_ep->sctp_ep.sctp_sws_sender) { in sctp_express_handle_sack()
3946 asoc->peers_rwnd = 0; in sctp_express_handle_sack()
3948 if (asoc->peers_rwnd > old_rwnd) { in sctp_express_handle_sack()
3955 TAILQ_FOREACH(net, &asoc->nets, sctp_next) { in sctp_express_handle_sack()
3970 if (stcb->asoc.cc_functions.sctp_cwnd_prepare_net_for_sack) { in sctp_express_handle_sack()
3971 (*stcb->asoc.cc_functions.sctp_cwnd_prepare_net_for_sack) (stcb, net); in sctp_express_handle_sack()
3974 if (!TAILQ_EMPTY(&asoc->sent_queue)) { in sctp_express_handle_sack()
3975 tp1 = TAILQ_LAST(&asoc->sent_queue, in sctp_express_handle_sack()
3979 send_s = asoc->sending_seq; in sctp_express_handle_sack()
3995 asoc->this_sack_highest_gap = cumack; in sctp_express_handle_sack()
3998 stcb->asoc.overall_error_count, in sctp_express_handle_sack()
4003 stcb->asoc.overall_error_count = 0; in sctp_express_handle_sack()
4004 if (SCTP_TSN_GT(cumack, asoc->last_acked_seq)) { in sctp_express_handle_sack()
4006 TAILQ_FOREACH_SAFE(tp1, &asoc->sent_queue, sctp_next, tp2) { in sctp_express_handle_sack()
4026 if (stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) { in sctp_express_handle_sack()
4027 (*stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) (tp1->whoTo, in sctp_express_handle_sack()
4046 &stcb->asoc, in sctp_express_handle_sack()
4079 sctp_ucount_decr(asoc->sent_queue_retran_cnt); in sctp_express_handle_sack()
4087 if (asoc->strmout[tp1->rec.data.sid].chunks_on_queues > 0) { in sctp_express_handle_sack()
4088 asoc->strmout[tp1->rec.data.sid].chunks_on_queues--; in sctp_express_handle_sack()
4095 if ((asoc->strmout[tp1->rec.data.sid].chunks_on_queues == 0) && in sctp_express_handle_sack()
4096 (asoc->strmout[tp1->rec.data.sid].state == SCTP_STREAM_RESET_PENDING) && in sctp_express_handle_sack()
4097 TAILQ_EMPTY(&asoc->strmout[tp1->rec.data.sid].outqueue)) { in sctp_express_handle_sack()
4098 asoc->trigger_reset = 1; in sctp_express_handle_sack()
4100 TAILQ_REMOVE(&asoc->sent_queue, tp1, sctp_next); in sctp_express_handle_sack()
4103 sctp_free_bufspace(stcb, asoc, tp1, 1); in sctp_express_handle_sack()
4108 sctp_log_sack(asoc->last_acked_seq, in sctp_express_handle_sack()
4115 asoc->sent_queue_cnt--; in sctp_express_handle_sack()
4137 if ((asoc->last_acked_seq != cumack) && (ecne_seen == 0)) { in sctp_express_handle_sack()
4138 TAILQ_FOREACH(net, &asoc->nets, sctp_next) { in sctp_express_handle_sack()
4151 if (net == stcb->asoc.primary_destination) { in sctp_express_handle_sack()
4152 if (stcb->asoc.alternate) { in sctp_express_handle_sack()
4157 sctp_free_remote_addr(stcb->asoc.alternate); in sctp_express_handle_sack()
4158 stcb->asoc.alternate = NULL; in sctp_express_handle_sack()
4167 asoc->cc_functions.sctp_cwnd_update_exit_pf(stcb, net); in sctp_express_handle_sack()
4173 if (net->RTO < stcb->asoc.minrto) { in sctp_express_handle_sack()
4174 net->RTO = stcb->asoc.minrto; in sctp_express_handle_sack()
4176 if (net->RTO > stcb->asoc.maxrto) { in sctp_express_handle_sack()
4177 net->RTO = stcb->asoc.maxrto; in sctp_express_handle_sack()
4181 asoc->cc_functions.sctp_cwnd_update_after_sack(stcb, asoc, 1, 0, 0); in sctp_express_handle_sack()
4183 asoc->last_acked_seq = cumack; in sctp_express_handle_sack()
4185 if (TAILQ_EMPTY(&asoc->sent_queue)) { in sctp_express_handle_sack()
4187 TAILQ_FOREACH(net, &asoc->nets, sctp_next) { in sctp_express_handle_sack()
4191 asoc->total_flight = 0; in sctp_express_handle_sack()
4192 asoc->total_flight_count = 0; in sctp_express_handle_sack()
4196 asoc->peers_rwnd = sctp_sbspace_sub(rwnd, in sctp_express_handle_sack()
4197 …(uint32_t)(asoc->total_flight + (asoc->total_flight_count * SCTP_BASE_SYSCTL(sctp_peer_chunk_oh)))… in sctp_express_handle_sack()
4198 if (asoc->peers_rwnd < stcb->sctp_ep->sctp_ep.sctp_sws_sender) { in sctp_express_handle_sack()
4200 asoc->peers_rwnd = 0; in sctp_express_handle_sack()
4202 if (asoc->peers_rwnd > old_rwnd) { in sctp_express_handle_sack()
4208 TAILQ_FOREACH(net, &asoc->nets, sctp_next) { in sctp_express_handle_sack()
4216 TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { in sctp_express_handle_sack()
4219 sctp_window_probe_recovery(stcb, asoc, tp1); in sctp_express_handle_sack()
4248 (!TAILQ_EMPTY(&asoc->sent_queue)) && in sctp_express_handle_sack()
4249 (asoc->sent_queue_retran_cnt == 0) && in sctp_express_handle_sack()
4256 if (sctp_fs_audit(asoc)) { in sctp_express_handle_sack()
4257 TAILQ_FOREACH(net, &asoc->nets, sctp_next) { in sctp_express_handle_sack()
4260 asoc->total_flight = 0; in sctp_express_handle_sack()
4261 asoc->total_flight_count = 0; in sctp_express_handle_sack()
4262 asoc->sent_queue_retran_cnt = 0; in sctp_express_handle_sack()
4263 TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { in sctp_express_handle_sack()
4268 sctp_ucount_incr(asoc->sent_queue_retran_cnt); in sctp_express_handle_sack()
4278 if (TAILQ_EMPTY(&asoc->send_queue) && TAILQ_EMPTY(&asoc->sent_queue)) { in sctp_express_handle_sack()
4281 if ((asoc->stream_queue_cnt == 1) && in sctp_express_handle_sack()
4282 ((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || in sctp_express_handle_sack()
4284 ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc))) { in sctp_express_handle_sack()
4287 if (((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || in sctp_express_handle_sack()
4289 (asoc->stream_queue_cnt == 1) && in sctp_express_handle_sack()
4290 (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT)) { in sctp_express_handle_sack()
4300 if ((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) && in sctp_express_handle_sack()
4301 (asoc->stream_queue_cnt == 0)) { in sctp_express_handle_sack()
4310 if (asoc->alternate) { in sctp_express_handle_sack()
4311 netp = asoc->alternate; in sctp_express_handle_sack()
4313 netp = asoc->primary_destination; in sctp_express_handle_sack()
4321 (asoc->stream_queue_cnt == 0)) { in sctp_express_handle_sack()
4327 if (asoc->alternate) { in sctp_express_handle_sack()
4328 netp = asoc->alternate; in sctp_express_handle_sack()
4330 netp = asoc->primary_destination; in sctp_express_handle_sack()
4342 if (SCTP_TSN_GT(cumack, asoc->advanced_peer_ack_point)) { in sctp_express_handle_sack()
4343 asoc->advanced_peer_ack_point = cumack; in sctp_express_handle_sack()
4346 if ((asoc->prsctp_supported) && (asoc->pr_sctp_cnt > 0)) { in sctp_express_handle_sack()
4350 old_adv_peer_ack_point = asoc->advanced_peer_ack_point; in sctp_express_handle_sack()
4351 lchk = sctp_try_advance_peer_ack_point(stcb, asoc); in sctp_express_handle_sack()
4353 if (SCTP_TSN_GT(asoc->advanced_peer_ack_point, cumack)) { in sctp_express_handle_sack()
4357 if (SCTP_TSN_GT(asoc->advanced_peer_ack_point, old_adv_peer_ack_point)) { in sctp_express_handle_sack()
4358 send_forward_tsn(stcb, asoc); in sctp_express_handle_sack()
4362 send_forward_tsn(stcb, asoc); in sctp_express_handle_sack()
4380 stcb->asoc.peers_rwnd, in sctp_express_handle_sack()
4381 stcb->asoc.total_flight, in sctp_express_handle_sack()
4382 stcb->asoc.total_output_queue_size); in sctp_express_handle_sack()
4393 struct sctp_association *asoc; in sctp_handle_sack() local
4438 stcb->asoc.cumack_log[stcb->asoc.cumack_log_at] = cum_ack; in sctp_handle_sack()
4439 stcb->asoc.cumack_log_at++; in sctp_handle_sack()
4440 if (stcb->asoc.cumack_log_at > SCTP_TSN_LOG_SIZE) { in sctp_handle_sack()
4441 stcb->asoc.cumack_log_at = 0; in sctp_handle_sack()
4448 rwnd, stcb->asoc.last_acked_seq, stcb->asoc.peers_rwnd); in sctp_handle_sack()
4451 old_rwnd = stcb->asoc.peers_rwnd; in sctp_handle_sack()
4454 stcb->asoc.overall_error_count, in sctp_handle_sack()
4459 stcb->asoc.overall_error_count = 0; in sctp_handle_sack()
4460 asoc = &stcb->asoc; in sctp_handle_sack()
4462 sctp_log_sack(asoc->last_acked_seq, in sctp_handle_sack()
4483 if (!TAILQ_EMPTY(&asoc->sent_queue)) { in sctp_handle_sack()
4484 tp1 = TAILQ_LAST(&asoc->sent_queue, in sctp_handle_sack()
4489 send_s = asoc->sending_seq; in sctp_handle_sack()
4519 if (SCTP_TSN_GT(asoc->last_acked_seq, last_tsn)) { in sctp_handle_sack()
4525 if (TAILQ_EMPTY(&asoc->sent_queue) && in sctp_handle_sack()
4526 TAILQ_EMPTY(&asoc->send_queue) && in sctp_handle_sack()
4527 (asoc->stream_queue_cnt == 0)) { in sctp_handle_sack()
4531 asoc->peers_rwnd, 0, 0, a_rwnd); in sctp_handle_sack()
4533 asoc->peers_rwnd = a_rwnd; in sctp_handle_sack()
4534 if (asoc->sent_queue_retran_cnt) { in sctp_handle_sack()
4535 asoc->sent_queue_retran_cnt = 0; in sctp_handle_sack()
4537 if (asoc->peers_rwnd < stcb->sctp_ep->sctp_ep.sctp_sws_sender) { in sctp_handle_sack()
4539 asoc->peers_rwnd = 0; in sctp_handle_sack()
4542 TAILQ_FOREACH(net, &asoc->nets, sctp_next) { in sctp_handle_sack()
4548 asoc->total_flight = 0; in sctp_handle_sack()
4549 asoc->total_flight_count = 0; in sctp_handle_sack()
4559 TAILQ_FOREACH(net, &asoc->nets, sctp_next) { in sctp_handle_sack()
4574 if (stcb->asoc.cc_functions.sctp_cwnd_prepare_net_for_sack) { in sctp_handle_sack()
4575 (*stcb->asoc.cc_functions.sctp_cwnd_prepare_net_for_sack) (stcb, net); in sctp_handle_sack()
4587 TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { in sctp_handle_sack()
4621 if (stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) { in sctp_handle_sack()
4622 (*stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) (tp1->whoTo, in sctp_handle_sack()
4644 &stcb->asoc, in sctp_handle_sack()
4672 sctp_log_sack(asoc->last_acked_seq, in sctp_handle_sack()
4684 sctp_ucount_decr(asoc->sent_queue_retran_cnt); in sctp_handle_sack()
4687 (asoc->sent_queue_retran_cnt & 0x000000ff)); in sctp_handle_sack()
4705 asoc->this_sack_highest_gap = last_tsn; in sctp_handle_sack()
4714 if (sctp_handle_segments(m, &offset_seg, stcb, asoc, last_tsn, &biggest_tsn_acked, in sctp_handle_sack()
4736 if (asoc->sctp_cmt_on_off > 0) { in sctp_handle_sack()
4737 TAILQ_FOREACH(net, &asoc->nets, sctp_next) { in sctp_handle_sack()
4745 TAILQ_FOREACH(net, &asoc->nets, sctp_next) { in sctp_handle_sack()
4754 asoc->last_acked_seq = cum_ack; in sctp_handle_sack()
4756 TAILQ_FOREACH_SAFE(tp1, &asoc->sent_queue, sctp_next, tp2) { in sctp_handle_sack()
4761 if (asoc->strmout[tp1->rec.data.sid].chunks_on_queues > 0) { in sctp_handle_sack()
4762 asoc->strmout[tp1->rec.data.sid].chunks_on_queues--; in sctp_handle_sack()
4769 if ((asoc->strmout[tp1->rec.data.sid].chunks_on_queues == 0) && in sctp_handle_sack()
4770 (asoc->strmout[tp1->rec.data.sid].state == SCTP_STREAM_RESET_PENDING) && in sctp_handle_sack()
4771 TAILQ_EMPTY(&asoc->strmout[tp1->rec.data.sid].outqueue)) { in sctp_handle_sack()
4772 asoc->trigger_reset = 1; in sctp_handle_sack()
4774 TAILQ_REMOVE(&asoc->sent_queue, tp1, sctp_next); in sctp_handle_sack()
4776 if (asoc->pr_sctp_cnt != 0) in sctp_handle_sack()
4777 asoc->pr_sctp_cnt--; in sctp_handle_sack()
4779 asoc->sent_queue_cnt--; in sctp_handle_sack()
4782 sctp_free_bufspace(stcb, asoc, tp1, 1); in sctp_handle_sack()
4785 if (asoc->prsctp_supported && PR_SCTP_BUF_ENABLED(tp1->flags)) { in sctp_handle_sack()
4786 asoc->sent_queue_cnt_removeable--; in sctp_handle_sack()
4790 sctp_log_sack(asoc->last_acked_seq, in sctp_handle_sack()
4800 if (TAILQ_EMPTY(&asoc->sent_queue) && (asoc->total_flight > 0)) { in sctp_handle_sack()
4805 asoc->total_flight); in sctp_handle_sack()
4807 asoc->total_flight = 0; in sctp_handle_sack()
4823 if (asoc->fast_retran_loss_recovery && accum_moved) { in sctp_handle_sack()
4824 if (SCTP_TSN_GE(asoc->last_acked_seq, asoc->fast_recovery_tsn)) { in sctp_handle_sack()
4840 sctp_check_for_revoked(stcb, asoc, cum_ack, biggest_tsn_acked); in sctp_handle_sack()
4841 asoc->saw_sack_with_frags = 1; in sctp_handle_sack()
4842 } else if (asoc->saw_sack_with_frags) { in sctp_handle_sack()
4846 TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { in sctp_handle_sack()
4872 asoc->saw_sack_with_frags = 0; in sctp_handle_sack()
4875 asoc->saw_sack_with_nr_frags = 1; in sctp_handle_sack()
4877 asoc->saw_sack_with_nr_frags = 0; in sctp_handle_sack()
4881 TAILQ_FOREACH(net, &asoc->nets, sctp_next) { in sctp_handle_sack()
4895 if (net == stcb->asoc.primary_destination) { in sctp_handle_sack()
4896 if (stcb->asoc.alternate) { in sctp_handle_sack()
4901 sctp_free_remote_addr(stcb->asoc.alternate); in sctp_handle_sack()
4902 stcb->asoc.alternate = NULL; in sctp_handle_sack()
4912 asoc->cc_functions.sctp_cwnd_update_exit_pf(stcb, net); in sctp_handle_sack()
4918 if (net->RTO < stcb->asoc.minrto) { in sctp_handle_sack()
4919 net->RTO = stcb->asoc.minrto; in sctp_handle_sack()
4921 if (net->RTO > stcb->asoc.maxrto) { in sctp_handle_sack()
4922 net->RTO = stcb->asoc.maxrto; in sctp_handle_sack()
4926 …asoc->cc_functions.sctp_cwnd_update_after_sack(stcb, asoc, accum_moved, reneged_all, will_exit_fas… in sctp_handle_sack()
4929 if (TAILQ_EMPTY(&asoc->sent_queue)) { in sctp_handle_sack()
4931 TAILQ_FOREACH(net, &asoc->nets, sctp_next) { in sctp_handle_sack()
4939 asoc->total_flight = 0; in sctp_handle_sack()
4940 asoc->total_flight_count = 0; in sctp_handle_sack()
4946 if (TAILQ_EMPTY(&asoc->send_queue) && TAILQ_EMPTY(&asoc->sent_queue)) { in sctp_handle_sack()
4950 asoc->peers_rwnd, 0, 0, a_rwnd); in sctp_handle_sack()
4952 asoc->peers_rwnd = a_rwnd; in sctp_handle_sack()
4953 if (asoc->peers_rwnd < stcb->sctp_ep->sctp_ep.sctp_sws_sender) { in sctp_handle_sack()
4955 asoc->peers_rwnd = 0; in sctp_handle_sack()
4958 if ((asoc->stream_queue_cnt == 1) && in sctp_handle_sack()
4959 ((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || in sctp_handle_sack()
4961 ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc))) { in sctp_handle_sack()
4964 if (((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || in sctp_handle_sack()
4966 (asoc->stream_queue_cnt == 1) && in sctp_handle_sack()
4967 (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT)) { in sctp_handle_sack()
4977 if ((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) && in sctp_handle_sack()
4978 (asoc->stream_queue_cnt == 0)) { in sctp_handle_sack()
4987 if (asoc->alternate) { in sctp_handle_sack()
4988 netp = asoc->alternate; in sctp_handle_sack()
4990 netp = asoc->primary_destination; in sctp_handle_sack()
4999 (asoc->stream_queue_cnt == 0)) { in sctp_handle_sack()
5005 if (asoc->alternate) { in sctp_handle_sack()
5006 netp = asoc->alternate; in sctp_handle_sack()
5008 netp = asoc->primary_destination; in sctp_handle_sack()
5020 TAILQ_FOREACH(net, &asoc->nets, sctp_next) { in sctp_handle_sack()
5029 if ((asoc->sctp_cmt_on_off > 0) && in sctp_handle_sack()
5035 sctp_strike_gap_ack_chunks(stcb, asoc, biggest_tsn_acked, in sctp_handle_sack()
5039 asoc->cc_functions.sctp_cwnd_update_after_fr(stcb, asoc); in sctp_handle_sack()
5044 asoc->fast_retran_loss_recovery = 0; in sctp_handle_sack()
5046 if ((asoc->sat_t3_loss_recovery) && in sctp_handle_sack()
5047 SCTP_TSN_GE(asoc->last_acked_seq, asoc->sat_t3_recovery_tsn)) { in sctp_handle_sack()
5049 asoc->sat_t3_loss_recovery = 0; in sctp_handle_sack()
5054 TAILQ_FOREACH(net, &asoc->nets, sctp_next) { in sctp_handle_sack()
5064 …asoc->peers_rwnd, asoc->total_flight, (asoc->total_flight_count * SCTP_BASE_SYSCTL(sctp_peer_chunk… in sctp_handle_sack()
5066 asoc->peers_rwnd = sctp_sbspace_sub(a_rwnd, in sctp_handle_sack()
5067 …(uint32_t)(asoc->total_flight + (asoc->total_flight_count * SCTP_BASE_SYSCTL(sctp_peer_chunk_oh)))… in sctp_handle_sack()
5068 if (asoc->peers_rwnd < stcb->sctp_ep->sctp_ep.sctp_sws_sender) { in sctp_handle_sack()
5070 asoc->peers_rwnd = 0; in sctp_handle_sack()
5072 if (asoc->peers_rwnd > old_rwnd) { in sctp_handle_sack()
5083 TAILQ_FOREACH(net, &asoc->nets, sctp_next) { in sctp_handle_sack()
5092 TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { in sctp_handle_sack()
5094 sctp_window_probe_recovery(stcb, asoc, tp1); in sctp_handle_sack()
5126 (!TAILQ_EMPTY(&asoc->sent_queue)) && in sctp_handle_sack()
5127 (asoc->sent_queue_retran_cnt == 0) && in sctp_handle_sack()
5134 if (sctp_fs_audit(asoc)) { in sctp_handle_sack()
5135 TAILQ_FOREACH(net, &asoc->nets, sctp_next) { in sctp_handle_sack()
5138 asoc->total_flight = 0; in sctp_handle_sack()
5139 asoc->total_flight_count = 0; in sctp_handle_sack()
5140 asoc->sent_queue_retran_cnt = 0; in sctp_handle_sack()
5141 TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { in sctp_handle_sack()
5146 sctp_ucount_incr(asoc->sent_queue_retran_cnt); in sctp_handle_sack()
5158 if (SCTP_TSN_GT(cum_ack, asoc->advanced_peer_ack_point)) { in sctp_handle_sack()
5159 asoc->advanced_peer_ack_point = cum_ack; in sctp_handle_sack()
5162 if ((asoc->prsctp_supported) && (asoc->pr_sctp_cnt > 0)) { in sctp_handle_sack()
5166 old_adv_peer_ack_point = asoc->advanced_peer_ack_point; in sctp_handle_sack()
5167 lchk = sctp_try_advance_peer_ack_point(stcb, asoc); in sctp_handle_sack()
5169 if (SCTP_TSN_GT(asoc->advanced_peer_ack_point, cum_ack)) { in sctp_handle_sack()
5175 0xee, cum_ack, asoc->advanced_peer_ack_point, in sctp_handle_sack()
5178 if (SCTP_TSN_GT(asoc->advanced_peer_ack_point, old_adv_peer_ack_point)) { in sctp_handle_sack()
5179 send_forward_tsn(stcb, asoc); in sctp_handle_sack()
5183 send_forward_tsn(stcb, asoc); in sctp_handle_sack()
5201 stcb->asoc.peers_rwnd, in sctp_handle_sack()
5202 stcb->asoc.total_flight, in sctp_handle_sack()
5203 stcb->asoc.total_output_queue_size); in sctp_handle_sack()
5215 a_rwnd = stcb->asoc.peers_rwnd + stcb->asoc.total_flight; in sctp_update_acked()
5226 struct sctp_association *asoc; in sctp_kick_prsctp_reorder_queue() local
5234 asoc = &stcb->asoc; in sctp_kick_prsctp_reorder_queue()
5241 if (SCTP_MID_GE(asoc->idata_supported, mid, control->mid)) { in sctp_kick_prsctp_reorder_queue()
5258 if (asoc->size_on_all_streams >= control->length) { in sctp_kick_prsctp_reorder_queue()
5259 asoc->size_on_all_streams -= control->length; in sctp_kick_prsctp_reorder_queue()
5262 …panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, contro… in sctp_kick_prsctp_reorder_queue()
5264 asoc->size_on_all_streams = 0; in sctp_kick_prsctp_reorder_queue()
5267 sctp_ucount_decr(asoc->cnt_on_all_streams); in sctp_kick_prsctp_reorder_queue()
5270 sctp_mark_non_revokable(asoc, control->sinfo_tsn); in sctp_kick_prsctp_reorder_queue()
5295 ret = sctp_deliver_reasm_check(stcb, &stcb->asoc, strmin, SCTP_READ_LOCK_HELD); in sctp_kick_prsctp_reorder_queue()
5296 if (SCTP_MID_GT(asoc->idata_supported, mid, strmin->last_mid_delivered)) { in sctp_kick_prsctp_reorder_queue()
5312 if (SCTP_MID_EQ(asoc->idata_supported, mid, control->mid)) { in sctp_kick_prsctp_reorder_queue()
5329 if (asoc->size_on_all_streams >= control->length) { in sctp_kick_prsctp_reorder_queue()
5330 asoc->size_on_all_streams -= control->length; in sctp_kick_prsctp_reorder_queue()
5333 …panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, contro… in sctp_kick_prsctp_reorder_queue()
5335 asoc->size_on_all_streams = 0; in sctp_kick_prsctp_reorder_queue()
5338 sctp_ucount_decr(asoc->cnt_on_all_streams); in sctp_kick_prsctp_reorder_queue()
5342 sctp_mark_non_revokable(asoc, control->sinfo_tsn); in sctp_kick_prsctp_reorder_queue()
5365 (void)sctp_deliver_reasm_check(stcb, &stcb->asoc, strmin, SCTP_READ_LOCK_HELD); in sctp_kick_prsctp_reorder_queue()
5371 struct sctp_association *asoc, struct sctp_stream_in *strm, in sctp_flush_reassm_for_str_seq() argument
5389 if (!asoc->idata_supported && !ordered && in sctp_flush_reassm_for_str_seq()
5396 if (!asoc->idata_supported && !ordered) { in sctp_flush_reassm_for_str_seq()
5402 if (asoc->size_on_reasm_queue >= chk->send_size) { in sctp_flush_reassm_for_str_seq()
5403 asoc->size_on_reasm_queue -= chk->send_size; in sctp_flush_reassm_for_str_seq()
5406 …panic("size_on_reasm_queue = %u smaller than chunk length %u", asoc->size_on_reasm_queue, chk->sen… in sctp_flush_reassm_for_str_seq()
5408 asoc->size_on_reasm_queue = 0; in sctp_flush_reassm_for_str_seq()
5411 sctp_ucount_decr(asoc->cnt_on_reasm_queue); in sctp_flush_reassm_for_str_seq()
5419 KASSERT(!asoc->idata_supported, in sctp_flush_reassm_for_str_seq()
5441 sctp_add_chk_to_control(control, strm, stcb, asoc, in sctp_flush_reassm_for_str_seq()
5444 sctp_deliver_reasm_check(stcb, asoc, strm, SCTP_READ_LOCK_HELD); in sctp_flush_reassm_for_str_seq()
5449 if (asoc->size_on_all_streams >= control->length) { in sctp_flush_reassm_for_str_seq()
5450 asoc->size_on_all_streams -= control->length; in sctp_flush_reassm_for_str_seq()
5453 …panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, contro… in sctp_flush_reassm_for_str_seq()
5455 asoc->size_on_all_streams = 0; in sctp_flush_reassm_for_str_seq()
5458 sctp_ucount_decr(asoc->cnt_on_all_streams); in sctp_flush_reassm_for_str_seq()
5497 struct sctp_association *asoc; in sctp_handle_forward_tsn() local
5503 asoc = &stcb->asoc; in sctp_handle_forward_tsn()
5509 m_size = (stcb->asoc.mapping_array_size << 3); in sctp_handle_forward_tsn()
5515 if (SCTP_TSN_GE(asoc->cumulative_tsn, new_cum_tsn)) { in sctp_handle_forward_tsn()
5523 SCTP_CALC_TSN_TO_GAP(gap, new_cum_tsn, asoc->mapping_array_base_tsn); in sctp_handle_forward_tsn()
5524 asoc->cumulative_tsn = new_cum_tsn; in sctp_handle_forward_tsn()
5526 if ((long)gap > sctp_sbspace(&stcb->asoc, &stcb->sctp_socket->so_rcv)) { in sctp_handle_forward_tsn()
5537 new_cum_tsn, asoc->highest_tsn_inside_map); in sctp_handle_forward_tsn()
5545 memset(stcb->asoc.mapping_array, 0, stcb->asoc.mapping_array_size); in sctp_handle_forward_tsn()
5546 asoc->mapping_array_base_tsn = new_cum_tsn + 1; in sctp_handle_forward_tsn()
5547 asoc->highest_tsn_inside_map = new_cum_tsn; in sctp_handle_forward_tsn()
5549 memset(stcb->asoc.nr_mapping_array, 0, stcb->asoc.mapping_array_size); in sctp_handle_forward_tsn()
5550 asoc->highest_tsn_inside_nr_map = new_cum_tsn; in sctp_handle_forward_tsn()
5553 sctp_log_map(0, 3, asoc->highest_tsn_inside_map, SCTP_MAP_SLIDE_RESULT); in sctp_handle_forward_tsn()
5558 if (!SCTP_IS_TSN_PRESENT(asoc->mapping_array, i) && in sctp_handle_forward_tsn()
5559 !SCTP_IS_TSN_PRESENT(asoc->nr_mapping_array, i)) { in sctp_handle_forward_tsn()
5560 SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, i); in sctp_handle_forward_tsn()
5561 if (SCTP_TSN_GT(asoc->mapping_array_base_tsn + i, asoc->highest_tsn_inside_nr_map)) { in sctp_handle_forward_tsn()
5562 asoc->highest_tsn_inside_nr_map = asoc->mapping_array_base_tsn + i; in sctp_handle_forward_tsn()
5572 if (asoc->idata_supported == 0) { in sctp_handle_forward_tsn()
5577 for (sid = 0; sid < asoc->streamincnt; sid++) { in sctp_handle_forward_tsn()
5578 strm = &asoc->strmin[sid]; in sctp_handle_forward_tsn()
5580 … sctp_flush_reassm_for_str_seq(stcb, asoc, strm, TAILQ_FIRST(&strm->uno_inqueue), 0, new_cum_tsn); in sctp_handle_forward_tsn()
5602 if (asoc->idata_supported) { in sctp_handle_forward_tsn()
5608 if (asoc->idata_supported) { in sctp_handle_forward_tsn()
5645 if (sid >= asoc->streamincnt) { in sctp_handle_forward_tsn()
5649 if ((asoc->str_of_pdapi == sid) && in sctp_handle_forward_tsn()
5650 (asoc->ssn_of_pdapi == mid)) { in sctp_handle_forward_tsn()
5657 asoc->fragmented_delivery_inprogress = 0; in sctp_handle_forward_tsn()
5659 strm = &asoc->strmin[sid]; in sctp_handle_forward_tsn()
5662 if (SCTP_MID_GE(asoc->idata_supported, mid, control->mid)) { in sctp_handle_forward_tsn()
5663 sctp_flush_reassm_for_str_seq(stcb, asoc, strm, control, ordered, new_cum_tsn); in sctp_handle_forward_tsn()
5667 if (asoc->idata_supported) { in sctp_handle_forward_tsn()
5669 if (SCTP_MID_GE(asoc->idata_supported, mid, control->mid)) { in sctp_handle_forward_tsn()
5670 sctp_flush_reassm_for_str_seq(stcb, asoc, strm, control, ordered, new_cum_tsn); in sctp_handle_forward_tsn()
5675 …sctp_flush_reassm_for_str_seq(stcb, asoc, strm, TAILQ_FIRST(&strm->uno_inqueue), ordered, new_cum_… in sctp_handle_forward_tsn()
5681 (SCTP_MID_EQ(asoc->idata_supported, control->mid, mid))) { in sctp_handle_forward_tsn()
5686 if (asoc->size_on_all_streams >= control->length) { in sctp_handle_forward_tsn()
5687 asoc->size_on_all_streams -= control->length; in sctp_handle_forward_tsn()
5690 …panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, contro… in sctp_handle_forward_tsn()
5692 asoc->size_on_all_streams = 0; in sctp_handle_forward_tsn()
5695 sctp_ucount_decr(asoc->cnt_on_all_streams); in sctp_handle_forward_tsn()
5712 SCTP_MID_GT(asoc->idata_supported, control->mid, mid)) { in sctp_handle_forward_tsn()
5717 if (SCTP_MID_GT(asoc->idata_supported, mid, strm->last_mid_delivered)) { in sctp_handle_forward_tsn()