Lines Matching full:asoc

55 sctp_audit_retranmission_queue(struct sctp_association *asoc)  in sctp_audit_retranmission_queue()  argument
60 asoc->sent_queue_retran_cnt, in sctp_audit_retranmission_queue()
61 asoc->sent_queue_cnt); in sctp_audit_retranmission_queue()
62 asoc->sent_queue_retran_cnt = 0; in sctp_audit_retranmission_queue()
63 asoc->sent_queue_cnt = 0; in sctp_audit_retranmission_queue()
64 TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) { in sctp_audit_retranmission_queue()
66 sctp_ucount_incr(asoc->sent_queue_retran_cnt); in sctp_audit_retranmission_queue()
68 asoc->sent_queue_cnt++; in sctp_audit_retranmission_queue()
70 TAILQ_FOREACH(chk, &asoc->control_send_queue, sctp_next) { in sctp_audit_retranmission_queue()
72 sctp_ucount_incr(asoc->sent_queue_retran_cnt); in sctp_audit_retranmission_queue()
75 TAILQ_FOREACH(chk, &asoc->asconf_send_queue, sctp_next) { in sctp_audit_retranmission_queue()
77 sctp_ucount_incr(asoc->sent_queue_retran_cnt); in sctp_audit_retranmission_queue()
81 asoc->sent_queue_retran_cnt, in sctp_audit_retranmission_queue()
82 asoc->sent_queue_cnt); in sctp_audit_retranmission_queue()
122 stcb->asoc.overall_error_count, in sctp_threshold_management()
123 (stcb->asoc.overall_error_count + 1), in sctp_threshold_management()
127 stcb->asoc.overall_error_count++; in sctp_threshold_management()
132 stcb->asoc.overall_error_count, in sctp_threshold_management()
133 (stcb->asoc.overall_error_count + 1), in sctp_threshold_management()
137 stcb->asoc.overall_error_count++; in sctp_threshold_management()
140 (void *)&stcb->asoc, stcb->asoc.overall_error_count, in sctp_threshold_management()
147 if (stcb->asoc.overall_error_count > threshold) { in sctp_threshold_management()
177 if (stcb->asoc.numnets == 1) { in sctp_find_alternate_net()
179 return (TAILQ_FIRST(&stcb->asoc.nets)); in sctp_find_alternate_net()
190 TAILQ_FOREACH(mnet, &stcb->asoc.nets, sctp_next) { in sctp_find_alternate_net()
259 if (stcb->asoc.hb_random_idx > 3) { in sctp_find_alternate_net()
261 memcpy(stcb->asoc.hb_random_values, &rndval, sizeof(stcb->asoc.hb_random_values)); in sctp_find_alternate_net()
262 this_random = stcb->asoc.hb_random_values[0]; in sctp_find_alternate_net()
263 stcb->asoc.hb_random_idx++; in sctp_find_alternate_net()
264 stcb->asoc.hb_ect_randombit = 0; in sctp_find_alternate_net()
266 this_random = stcb->asoc.hb_random_values[stcb->asoc.hb_random_idx]; in sctp_find_alternate_net()
267 stcb->asoc.hb_random_idx++; in sctp_find_alternate_net()
268 stcb->asoc.hb_ect_randombit = 0; in sctp_find_alternate_net()
287 TAILQ_FOREACH(mnet, &stcb->asoc.nets, sctp_next) { in sctp_find_alternate_net()
303 if (stcb->asoc.hb_random_idx > 3) { in sctp_find_alternate_net()
305 memcpy(stcb->asoc.hb_random_values, &rndval, in sctp_find_alternate_net()
306 sizeof(stcb->asoc.hb_random_values)); in sctp_find_alternate_net()
307 this_random = stcb->asoc.hb_random_values[0]; in sctp_find_alternate_net()
308 stcb->asoc.hb_random_idx = 0; in sctp_find_alternate_net()
309 stcb->asoc.hb_ect_randombit = 0; in sctp_find_alternate_net()
311 this_random = stcb->asoc.hb_random_values[stcb->asoc.hb_random_idx]; in sctp_find_alternate_net()
312 stcb->asoc.hb_random_idx++; in sctp_find_alternate_net()
313 stcb->asoc.hb_ect_randombit = 0; in sctp_find_alternate_net()
329 alt = TAILQ_FIRST(&stcb->asoc.nets); in sctp_find_alternate_net()
335 alt = TAILQ_FIRST(&stcb->asoc.nets); in sctp_find_alternate_net()
368 alt = TAILQ_FIRST(&stcb->asoc.nets); in sctp_find_alternate_net()
374 alt = TAILQ_FIRST(&stcb->asoc.nets); in sctp_find_alternate_net()
403 alt = TAILQ_FIRST(&stcb->asoc.nets); in sctp_find_alternate_net()
417 net->RTO = stcb->asoc.minrto; in sctp_backoff_on_timeout()
419 net->RTO = stcb->asoc.initial_rto; in sctp_backoff_on_timeout()
423 if (net->RTO > stcb->asoc.maxrto) { in sctp_backoff_on_timeout()
424 net->RTO = stcb->asoc.maxrto; in sctp_backoff_on_timeout()
429 stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout(stcb, net); in sctp_backoff_on_timeout()
438 struct sctp_association *asoc; in sctp_recover_sent_list() local
440 asoc = &stcb->asoc; in sctp_recover_sent_list()
441 TAILQ_FOREACH_SAFE(chk, &asoc->sent_queue, sctp_next, nchk) { in sctp_recover_sent_list()
442 if (SCTP_TSN_GE(asoc->last_acked_seq, chk->rec.data.tsn)) { in sctp_recover_sent_list()
444 (void *)chk, chk->rec.data.tsn, asoc->last_acked_seq); in sctp_recover_sent_list()
446 if (asoc->strmout[chk->rec.data.sid].chunks_on_queues > 0) { in sctp_recover_sent_list()
447 asoc->strmout[chk->rec.data.sid].chunks_on_queues--; in sctp_recover_sent_list()
450 if ((asoc->strmout[chk->rec.data.sid].chunks_on_queues == 0) && in sctp_recover_sent_list()
451 (asoc->strmout[chk->rec.data.sid].state == SCTP_STREAM_RESET_PENDING) && in sctp_recover_sent_list()
452 TAILQ_EMPTY(&asoc->strmout[chk->rec.data.sid].outqueue)) { in sctp_recover_sent_list()
453 asoc->trigger_reset = 1; in sctp_recover_sent_list()
455 TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next); in sctp_recover_sent_list()
457 if (asoc->pr_sctp_cnt != 0) in sctp_recover_sent_list()
458 asoc->pr_sctp_cnt--; in sctp_recover_sent_list()
462 sctp_free_bufspace(stcb, asoc, chk, 1); in sctp_recover_sent_list()
465 if (asoc->prsctp_supported && PR_SCTP_BUF_ENABLED(chk->flags)) { in sctp_recover_sent_list()
466 asoc->sent_queue_cnt_removeable--; in sctp_recover_sent_list()
469 asoc->sent_queue_cnt--; in sctp_recover_sent_list()
474 TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) { in sctp_recover_sent_list()
521 stcb->asoc.peers_rwnd, in sctp_mark_all_for_resend()
525 sctp_log_fr(net->flight_size, net->cwnd, stcb->asoc.total_flight, SCTP_FR_CWND_REPORT); in sctp_mark_all_for_resend()
549 orig_tf = stcb->asoc.total_flight; in sctp_mark_all_for_resend()
559 TAILQ_FOREACH_SAFE(chk, &stcb->asoc.sent_queue, sctp_next, nchk) { in sctp_mark_all_for_resend()
560 if (SCTP_TSN_GE(stcb->asoc.last_acked_seq, chk->rec.data.tsn)) { in sctp_mark_all_for_resend()
563 (unsigned int)stcb->asoc.last_acked_seq, (unsigned int)chk->rec.data.tsn); in sctp_mark_all_for_resend()
620 if (stcb->asoc.prsctp_supported && PR_SCTP_TTL_ENABLED(chk->flags)) { in sctp_mark_all_for_resend()
634 if (stcb->asoc.prsctp_supported && PR_SCTP_RTX_ENABLED(chk->flags)) { in sctp_mark_all_for_resend()
648 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); in sctp_mark_all_for_resend()
666 stcb->asoc.marked_retrans++; in sctp_mark_all_for_resend()
676 stcb->asoc.peers_rwnd += chk->send_size; in sctp_mark_all_for_resend()
677 stcb->asoc.peers_rwnd += SCTP_BASE_SYSCTL(sctp_peer_chunk_oh); in sctp_mark_all_for_resend()
700 if (TAILQ_EMPTY(&stcb->asoc.send_queue)) { in sctp_mark_all_for_resend()
701 chk->rec.data.fast_retran_tsn = stcb->asoc.sending_seq; in sctp_mark_all_for_resend()
703 chk->rec.data.fast_retran_tsn = (TAILQ_FIRST(&stcb->asoc.send_queue))->rec.data.tsn; in sctp_mark_all_for_resend()
709 if (stcb->asoc.sctp_cmt_on_off > 0) { in sctp_mark_all_for_resend()
722 if ((orig_flight - net->flight_size) != (orig_tf - stcb->asoc.total_flight)) { in sctp_mark_all_for_resend()
736 stcb->asoc.peers_rwnd); in sctp_mark_all_for_resend()
745 TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) { in sctp_mark_all_for_resend()
756 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); in sctp_mark_all_for_resend()
763 if ((stcb->asoc.sent_queue_retran_cnt == 0) && (could_be_sent)) { in sctp_mark_all_for_resend()
765 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); in sctp_mark_all_for_resend()
770 if (stcb->asoc.sent_queue_retran_cnt != cnt_mk) { in sctp_mark_all_for_resend()
772 SCTP_PRINTF("Local Audit says there are %d for retran asoc cnt:%d we marked:%d this time\n", in sctp_mark_all_for_resend()
773 cnt_mk, stcb->asoc.sent_queue_retran_cnt, num_mk); in sctp_mark_all_for_resend()
776 stcb->asoc.sent_queue_retran_cnt = cnt_mk; in sctp_mark_all_for_resend()
783 stcb->asoc.total_flight = 0; in sctp_mark_all_for_resend()
784 stcb->asoc.total_flight_count = 0; in sctp_mark_all_for_resend()
786 TAILQ_FOREACH(lnets, &stcb->asoc.nets, sctp_next) { in sctp_mark_all_for_resend()
792 TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) { in sctp_mark_all_for_resend()
825 TAILQ_FOREACH(lnet, &stcb->asoc.nets, sctp_next) { in sctp_t3rxt_timer()
834 if ((stcb->asoc.peers_rwnd == 0) && in sctp_t3rxt_timer()
835 (stcb->asoc.total_flight < net->mtu)) { in sctp_t3rxt_timer()
845 stcb->asoc.max_send_times)) { in sctp_t3rxt_timer()
849 if (net != stcb->asoc.primary_destination) { in sctp_t3rxt_timer()
880 stcb->asoc.max_send_times)) { in sctp_t3rxt_timer()
885 if (stcb->asoc.sctp_cmt_on_off > 0) { in sctp_t3rxt_timer()
913 stcb->asoc.fast_retran_loss_recovery = 0; in sctp_t3rxt_timer()
917 if ((stcb->asoc.cc_functions.sctp_cwnd_new_transmission_begins) && in sctp_t3rxt_timer()
919 (*stcb->asoc.cc_functions.sctp_cwnd_new_transmission_begins) (stcb, net); in sctp_t3rxt_timer()
925 stcb->asoc.sat_t3_loss_recovery = 1; in sctp_t3rxt_timer()
926 stcb->asoc.sat_t3_recovery_tsn = stcb->asoc.sending_seq; in sctp_t3rxt_timer()
949 if ((stcb->asoc.primary_destination == net) && (alt != net)) { in sctp_t3rxt_timer()
957 if (stcb->asoc.alternate != NULL) { in sctp_t3rxt_timer()
958 sctp_free_remote_addr(stcb->asoc.alternate); in sctp_t3rxt_timer()
960 stcb->asoc.alternate = alt; in sctp_t3rxt_timer()
961 atomic_add_int(&stcb->asoc.alternate->ref_count, 1); in sctp_t3rxt_timer()
971 * have not established the asoc in sctp_t3rxt_timer()
976 if (stcb->asoc.prsctp_supported) { in sctp_t3rxt_timer()
979 lchk = sctp_try_advance_peer_ack_point(stcb, &stcb->asoc); in sctp_t3rxt_timer()
981 if (SCTP_TSN_GT(stcb->asoc.advanced_peer_ack_point, stcb->asoc.last_acked_seq)) { in sctp_t3rxt_timer()
982 send_forward_tsn(stcb, &stcb->asoc); in sctp_t3rxt_timer()
1006 if (stcb->asoc.delayed_connection) { in sctp_t1init_timer()
1011 stcb->asoc.delayed_connection = 0; in sctp_t1init_timer()
1019 stcb->asoc.max_init_times)) { in sctp_t1init_timer()
1023 stcb->asoc.dropped_special_cnt = 0; in sctp_t1init_timer()
1024 sctp_backoff_on_timeout(stcb, stcb->asoc.primary_destination, 1, 0, 0); in sctp_t1init_timer()
1025 if (stcb->asoc.initial_init_rto_max < net->RTO) { in sctp_t1init_timer()
1026 net->RTO = stcb->asoc.initial_init_rto_max; in sctp_t1init_timer()
1028 if (stcb->asoc.numnets > 1) { in sctp_t1init_timer()
1032 alt = sctp_find_alternate_net(stcb, stcb->asoc.primary_destination, 0); in sctp_t1init_timer()
1033 if (alt != stcb->asoc.primary_destination) { in sctp_t1init_timer()
1034 sctp_move_chunks_from_net(stcb, stcb->asoc.primary_destination); in sctp_t1init_timer()
1035 stcb->asoc.primary_destination = alt; in sctp_t1init_timer()
1057 TAILQ_FOREACH(cookie, &stcb->asoc.control_send_queue, sctp_next) { in sctp_cookie_timer()
1083 stcb->asoc.max_init_times)) { in sctp_cookie_timer()
1091 stcb->asoc.dropped_special_cnt = 0; in sctp_cookie_timer()
1101 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); in sctp_cookie_timer()
1119 if (stcb->asoc.stream_reset_outstanding == 0) { in sctp_strreset_timer()
1123 (void)sctp_find_stream_reset(stcb, stcb->asoc.str_reset_seq_out, &strrst); in sctp_strreset_timer()
1129 if (sctp_threshold_management(inp, stcb, net, stcb->asoc.max_send_times)) { in sctp_strreset_timer()
1143 TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) { in sctp_strreset_timer()
1150 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); in sctp_strreset_timer()
1167 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); in sctp_strreset_timer()
1184 if (TAILQ_EMPTY(&stcb->asoc.asconf_send_queue)) { in sctp_asconf_timer()
1193 asconf = TAILQ_FIRST(&stcb->asoc.asconf_send_queue); in sctp_asconf_timer()
1200 stcb->asoc.max_send_times)) { in sctp_asconf_timer()
1204 if (asconf->snd_count > stcb->asoc.max_send_times) { in sctp_asconf_timer()
1228 TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) { in sctp_asconf_timer()
1236 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); in sctp_asconf_timer()
1241 TAILQ_FOREACH(chk, &stcb->asoc.asconf_send_queue, sctp_next) { in sctp_asconf_timer()
1248 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); in sctp_asconf_timer()
1263 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); in sctp_asconf_timer()
1277 if (stcb->asoc.deleted_primary == NULL) { in sctp_delete_prim_timer()
1283 SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, &stcb->asoc.deleted_primary->ro._l_addr.sa); in sctp_delete_prim_timer()
1284 sctp_free_remote_addr(stcb->asoc.deleted_primary); in sctp_delete_prim_timer()
1285 stcb->asoc.deleted_primary = NULL; in sctp_delete_prim_timer()
1303 if (sctp_threshold_management(inp, stcb, net, stcb->asoc.max_send_times)) { in sctp_shutdown_timer()
1326 if (sctp_threshold_management(inp, stcb, net, stcb->asoc.max_send_times)) { in sctp_shutdownack_timer()
1352 KASSERT(TAILQ_EMPTY(&stcb->asoc.send_queue), ("send_queue not empty")); in sctp_audit_stream_queues_for_size()
1353 KASSERT(TAILQ_EMPTY(&stcb->asoc.sent_queue), ("sent_queue not empty")); in sctp_audit_stream_queues_for_size()
1355 if (stcb->asoc.sent_queue_retran_cnt) { in sctp_audit_stream_queues_for_size()
1357 stcb->asoc.sent_queue_retran_cnt); in sctp_audit_stream_queues_for_size()
1358 stcb->asoc.sent_queue_retran_cnt = 0; in sctp_audit_stream_queues_for_size()
1360 if (stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, &stcb->asoc)) { in sctp_audit_stream_queues_for_size()
1362 stcb->asoc.ss_functions.sctp_ss_init(stcb, &stcb->asoc); in sctp_audit_stream_queues_for_size()
1363 if (!stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, &stcb->asoc)) { in sctp_audit_stream_queues_for_size()
1368 stcb->asoc.total_output_queue_size = 0; in sctp_audit_stream_queues_for_size()
1372 for (i = 0; i < stcb->asoc.streamoutcnt; i++) { in sctp_audit_stream_queues_for_size()
1373 if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { in sctp_audit_stream_queues_for_size()
1374 TAILQ_FOREACH(sp, &stcb->asoc.strmout[i].outqueue, next) { in sctp_audit_stream_queues_for_size()
1381 if (chks_in_queue != stcb->asoc.stream_queue_cnt) { in sctp_audit_stream_queues_for_size()
1383 stcb->asoc.stream_queue_cnt, chks_in_queue); in sctp_audit_stream_queues_for_size()
1388 if ((TAILQ_EMPTY(&stcb->asoc.send_queue)) && in sctp_audit_stream_queues_for_size()
1389 (TAILQ_EMPTY(&stcb->asoc.sent_queue))) { in sctp_audit_stream_queues_for_size()
1401 (u_long)stcb->asoc.total_output_queue_size); in sctp_audit_stream_queues_for_size()
1402 stcb->asoc.total_output_queue_size = 0; in sctp_audit_stream_queues_for_size()
1424 if (sctp_threshold_management(inp, stcb, net, stcb->asoc.max_send_times)) { in sctp_heartbeat_timer()
1433 if ((stcb->asoc.total_output_queue_size > 0) && in sctp_heartbeat_timer()
1434 (TAILQ_EMPTY(&stcb->asoc.send_queue)) && in sctp_heartbeat_timer()
1435 (TAILQ_EMPTY(&stcb->asoc.sent_queue))) { in sctp_heartbeat_timer()
1497 net, 0, stcb->asoc.vrf_id); in sctp_pathmtu_timer()
1531 struct sctp_association *asoc; in sctp_autoclose_timer() local
1535 if (stcb->asoc.sctp_autoclose_ticks > 0 && in sctp_autoclose_timer()
1538 asoc = &stcb->asoc; in sctp_autoclose_timer()
1540 if (asoc->time_last_rcvd.tv_sec > in sctp_autoclose_timer()
1541 asoc->time_last_sent.tv_sec) { in sctp_autoclose_timer()
1542 tim_touse = &asoc->time_last_rcvd; in sctp_autoclose_timer()
1544 tim_touse = &asoc->time_last_sent; in sctp_autoclose_timer()
1548 if (ticks_gone_by >= asoc->sctp_autoclose_ticks) { in sctp_autoclose_timer()
1558 if (TAILQ_EMPTY(&asoc->send_queue) && in sctp_autoclose_timer()
1559 TAILQ_EMPTY(&asoc->sent_queue)) { in sctp_autoclose_timer()
1574 if (stcb->asoc.alternate) { in sctp_autoclose_timer()
1575 net = stcb->asoc.alternate; in sctp_autoclose_timer()
1577 net = stcb->asoc.primary_destination; in sctp_autoclose_timer()
1594 tmp = asoc->sctp_autoclose_ticks; in sctp_autoclose_timer()
1595 asoc->sctp_autoclose_ticks -= ticks_gone_by; in sctp_autoclose_timer()
1598 asoc->sctp_autoclose_ticks = tmp; in sctp_autoclose_timer()