Lines Matching refs:qsm

19 static void shutdown_flush_done(QUIC_STREAM_MAP *qsm, QUIC_STREAM *qs);
90 int ossl_quic_stream_map_init(QUIC_STREAM_MAP *qsm, in ossl_quic_stream_map_init() argument
97 qsm->map = lh_QUIC_STREAM_new(hash_stream, cmp_stream); in ossl_quic_stream_map_init()
98 qsm->active_list.prev = qsm->active_list.next = &qsm->active_list; in ossl_quic_stream_map_init()
99 qsm->accept_list.prev = qsm->accept_list.next = &qsm->accept_list; in ossl_quic_stream_map_init()
100 qsm->ready_for_gc_list.prev = qsm->ready_for_gc_list.next in ossl_quic_stream_map_init()
101 = &qsm->ready_for_gc_list; in ossl_quic_stream_map_init()
102 qsm->rr_stepping = 1; in ossl_quic_stream_map_init()
103 qsm->rr_counter = 0; in ossl_quic_stream_map_init()
104 qsm->rr_cur = NULL; in ossl_quic_stream_map_init()
106 qsm->num_accept_bidi = 0; in ossl_quic_stream_map_init()
107 qsm->num_accept_uni = 0; in ossl_quic_stream_map_init()
108 qsm->num_shutdown_flush = 0; in ossl_quic_stream_map_init()
110 qsm->get_stream_limit_cb = get_stream_limit_cb; in ossl_quic_stream_map_init()
111 qsm->get_stream_limit_cb_arg = get_stream_limit_cb_arg; in ossl_quic_stream_map_init()
112 qsm->max_streams_bidi_rxfc = max_streams_bidi_rxfc; in ossl_quic_stream_map_init()
113 qsm->max_streams_uni_rxfc = max_streams_uni_rxfc; in ossl_quic_stream_map_init()
114 qsm->is_server = is_server; in ossl_quic_stream_map_init()
120 QUIC_STREAM_MAP *qsm = arg; in release_each() local
122 ossl_quic_stream_map_release(qsm, stream); in release_each()
125 void ossl_quic_stream_map_cleanup(QUIC_STREAM_MAP *qsm) in ossl_quic_stream_map_cleanup() argument
127 ossl_quic_stream_map_visit(qsm, release_each, qsm); in ossl_quic_stream_map_cleanup()
129 lh_QUIC_STREAM_free(qsm->map); in ossl_quic_stream_map_cleanup()
130 qsm->map = NULL; in ossl_quic_stream_map_cleanup()
133 void ossl_quic_stream_map_visit(QUIC_STREAM_MAP *qsm, in ossl_quic_stream_map_visit() argument
137 lh_QUIC_STREAM_doall_arg(qsm->map, visit_cb, visit_cb_arg); in ossl_quic_stream_map_visit()
140 QUIC_STREAM *ossl_quic_stream_map_alloc(QUIC_STREAM_MAP *qsm, in ossl_quic_stream_map_alloc() argument
149 s = lh_QUIC_STREAM_retrieve(qsm->map, &key); in ossl_quic_stream_map_alloc()
159 s->as_server = qsm->is_server; in ossl_quic_stream_map_alloc()
171 lh_QUIC_STREAM_insert(qsm->map, s); in ossl_quic_stream_map_alloc()
175 void ossl_quic_stream_map_release(QUIC_STREAM_MAP *qsm, QUIC_STREAM *stream) in ossl_quic_stream_map_release() argument
181 list_remove(&qsm->active_list, &stream->active_node); in ossl_quic_stream_map_release()
183 list_remove(&qsm->accept_list, &stream->accept_node); in ossl_quic_stream_map_release()
185 list_remove(&qsm->ready_for_gc_list, &stream->ready_for_gc_node); in ossl_quic_stream_map_release()
193 lh_QUIC_STREAM_delete(qsm->map, stream); in ossl_quic_stream_map_release()
197 QUIC_STREAM *ossl_quic_stream_map_get_by_id(QUIC_STREAM_MAP *qsm, in ossl_quic_stream_map_get_by_id() argument
204 return lh_QUIC_STREAM_retrieve(qsm->map, &key); in ossl_quic_stream_map_get_by_id()
207 static void stream_map_mark_active(QUIC_STREAM_MAP *qsm, QUIC_STREAM *s) in stream_map_mark_active() argument
212 list_insert_tail(&qsm->active_list, &s->active_node); in stream_map_mark_active()
214 if (qsm->rr_cur == NULL) in stream_map_mark_active()
215 qsm->rr_cur = s; in stream_map_mark_active()
220 static void stream_map_mark_inactive(QUIC_STREAM_MAP *qsm, QUIC_STREAM *s) in stream_map_mark_inactive() argument
225 if (qsm->rr_cur == s) in stream_map_mark_inactive()
226 qsm->rr_cur = active_next(&qsm->active_list, s); in stream_map_mark_inactive()
227 if (qsm->rr_cur == s) in stream_map_mark_inactive()
228 qsm->rr_cur = NULL; in stream_map_mark_inactive()
230 list_remove(&qsm->active_list, &s->active_node); in stream_map_mark_inactive()
235 void ossl_quic_stream_map_set_rr_stepping(QUIC_STREAM_MAP *qsm, size_t stepping) in ossl_quic_stream_map_set_rr_stepping() argument
237 qsm->rr_stepping = stepping; in ossl_quic_stream_map_set_rr_stepping()
238 qsm->rr_counter = 0; in ossl_quic_stream_map_set_rr_stepping()
292 static int qsm_ready_for_gc(QUIC_STREAM_MAP *qsm, QUIC_STREAM *qs) in qsm_ready_for_gc() argument
315 int ossl_quic_stream_map_is_local_allowed_by_stream_limit(QUIC_STREAM_MAP *qsm, in ossl_quic_stream_map_is_local_allowed_by_stream_limit() argument
321 if (qsm->get_stream_limit_cb == NULL) in ossl_quic_stream_map_is_local_allowed_by_stream_limit()
324 stream_limit = qsm->get_stream_limit_cb(is_uni, qsm->get_stream_limit_cb_arg); in ossl_quic_stream_map_is_local_allowed_by_stream_limit()
328 void ossl_quic_stream_map_update_state(QUIC_STREAM_MAP *qsm, QUIC_STREAM *s) in ossl_quic_stream_map_update_state() argument
332 if (ossl_quic_stream_is_server_init(s) == qsm->is_server) { in ossl_quic_stream_map_update_state()
337 = ossl_quic_stream_map_is_local_allowed_by_stream_limit(qsm, in ossl_quic_stream_map_update_state()
344 ossl_quic_stream_map_notify_totally_acked(qsm, s); in ossl_quic_stream_map_update_state()
348 shutdown_flush_done(qsm, s); in ossl_quic_stream_map_update_state()
351 s->ready_for_gc = qsm_ready_for_gc(qsm, s); in ossl_quic_stream_map_update_state()
353 list_insert_tail(&qsm->ready_for_gc_list, &s->ready_for_gc_node); in ossl_quic_stream_map_update_state()
369 stream_map_mark_active(qsm, s); in ossl_quic_stream_map_update_state()
371 stream_map_mark_inactive(qsm, s); in ossl_quic_stream_map_update_state()
379 int ossl_quic_stream_map_ensure_send_part_id(QUIC_STREAM_MAP *qsm, in ossl_quic_stream_map_ensure_send_part_id() argument
401 int ossl_quic_stream_map_notify_all_data_sent(QUIC_STREAM_MAP *qsm, in ossl_quic_stream_map_notify_all_data_sent() argument
420 static void shutdown_flush_done(QUIC_STREAM_MAP *qsm, QUIC_STREAM *qs) in shutdown_flush_done() argument
425 assert(qsm->num_shutdown_flush > 0); in shutdown_flush_done()
427 --qsm->num_shutdown_flush; in shutdown_flush_done()
430 int ossl_quic_stream_map_notify_totally_acked(QUIC_STREAM_MAP *qsm, in ossl_quic_stream_map_notify_totally_acked() argument
446 shutdown_flush_done(qsm, qs); in ossl_quic_stream_map_notify_totally_acked()
451 int ossl_quic_stream_map_reset_stream_send_part(QUIC_STREAM_MAP *qsm, in ossl_quic_stream_map_reset_stream_send_part() argument
471 if (!ossl_quic_stream_map_ensure_send_part_id(qsm, qs)) in ossl_quic_stream_map_reset_stream_send_part()
498 shutdown_flush_done(qsm, qs); in ossl_quic_stream_map_reset_stream_send_part()
499 ossl_quic_stream_map_update_state(qsm, qs); in ossl_quic_stream_map_reset_stream_send_part()
512 int ossl_quic_stream_map_notify_reset_stream_acked(QUIC_STREAM_MAP *qsm, in ossl_quic_stream_map_notify_reset_stream_acked() argument
537 int ossl_quic_stream_map_notify_size_known_recv_part(QUIC_STREAM_MAP *qsm, in ossl_quic_stream_map_notify_size_known_recv_part() argument
554 int ossl_quic_stream_map_notify_totally_received(QUIC_STREAM_MAP *qsm, in ossl_quic_stream_map_notify_totally_received() argument
571 int ossl_quic_stream_map_notify_totally_read(QUIC_STREAM_MAP *qsm, in ossl_quic_stream_map_notify_totally_read() argument
591 int ossl_quic_stream_map_notify_reset_recv_part(QUIC_STREAM_MAP *qsm, in ossl_quic_stream_map_notify_reset_recv_part() argument
622 ossl_quic_stream_map_update_state(qsm, qs); in ossl_quic_stream_map_notify_reset_recv_part()
637 int ossl_quic_stream_map_notify_app_read_reset_recv_part(QUIC_STREAM_MAP *qsm, in ossl_quic_stream_map_notify_app_read_reset_recv_part() argument
653 int ossl_quic_stream_map_stop_sending_recv_part(QUIC_STREAM_MAP *qsm, in ossl_quic_stream_map_stop_sending_recv_part() argument
695 return ossl_quic_stream_map_schedule_stop_sending(qsm, qs); in ossl_quic_stream_map_stop_sending_recv_part()
699 int ossl_quic_stream_map_schedule_stop_sending(QUIC_STREAM_MAP *qsm, QUIC_STREAM *qs) in ossl_quic_stream_map_schedule_stop_sending() argument
728 ossl_quic_stream_map_update_state(qsm, qs); in ossl_quic_stream_map_schedule_stop_sending()
732 QUIC_STREAM *ossl_quic_stream_map_peek_accept_queue(QUIC_STREAM_MAP *qsm) in ossl_quic_stream_map_peek_accept_queue() argument
734 return accept_head(&qsm->accept_list); in ossl_quic_stream_map_peek_accept_queue()
737 void ossl_quic_stream_map_push_accept_queue(QUIC_STREAM_MAP *qsm, in ossl_quic_stream_map_push_accept_queue() argument
740 list_insert_tail(&qsm->accept_list, &s->accept_node); in ossl_quic_stream_map_push_accept_queue()
742 ++qsm->num_accept_bidi; in ossl_quic_stream_map_push_accept_queue()
744 ++qsm->num_accept_uni; in ossl_quic_stream_map_push_accept_queue()
747 static QUIC_RXFC *qsm_get_max_streams_rxfc(QUIC_STREAM_MAP *qsm, QUIC_STREAM *s) in qsm_get_max_streams_rxfc() argument
750 ? qsm->max_streams_bidi_rxfc in qsm_get_max_streams_rxfc()
751 : qsm->max_streams_uni_rxfc; in qsm_get_max_streams_rxfc()
754 void ossl_quic_stream_map_remove_from_accept_queue(QUIC_STREAM_MAP *qsm, in ossl_quic_stream_map_remove_from_accept_queue() argument
760 list_remove(&qsm->accept_list, &s->accept_node); in ossl_quic_stream_map_remove_from_accept_queue()
762 --qsm->num_accept_bidi; in ossl_quic_stream_map_remove_from_accept_queue()
764 --qsm->num_accept_uni; in ossl_quic_stream_map_remove_from_accept_queue()
766 if ((max_streams_rxfc = qsm_get_max_streams_rxfc(qsm, s)) != NULL) in ossl_quic_stream_map_remove_from_accept_queue()
770 size_t ossl_quic_stream_map_get_accept_queue_len(QUIC_STREAM_MAP *qsm, int is_uni) in ossl_quic_stream_map_get_accept_queue_len() argument
772 return is_uni ? qsm->num_accept_uni : qsm->num_accept_bidi; in ossl_quic_stream_map_get_accept_queue_len()
775 size_t ossl_quic_stream_map_get_total_accept_queue_len(QUIC_STREAM_MAP *qsm) in ossl_quic_stream_map_get_total_accept_queue_len() argument
777 return ossl_quic_stream_map_get_accept_queue_len(qsm, /*is_uni=*/0) in ossl_quic_stream_map_get_total_accept_queue_len()
778 + ossl_quic_stream_map_get_accept_queue_len(qsm, /*is_uni=*/1); in ossl_quic_stream_map_get_total_accept_queue_len()
781 void ossl_quic_stream_map_gc(QUIC_STREAM_MAP *qsm) in ossl_quic_stream_map_gc() argument
785 for (qs = qs_head = ready_for_gc_head(&qsm->ready_for_gc_list); in ossl_quic_stream_map_gc()
789 qsn = ready_for_gc_next(&qsm->ready_for_gc_list, qs); in ossl_quic_stream_map_gc()
791 ossl_quic_stream_map_release(qsm, qs); in ossl_quic_stream_map_gc()
816 QUIC_STREAM_MAP *qsm = arg; in begin_shutdown_flush_each() local
822 ++qsm->num_shutdown_flush; in begin_shutdown_flush_each()
825 void ossl_quic_stream_map_begin_shutdown_flush(QUIC_STREAM_MAP *qsm) in ossl_quic_stream_map_begin_shutdown_flush() argument
827 qsm->num_shutdown_flush = 0; in ossl_quic_stream_map_begin_shutdown_flush()
829 ossl_quic_stream_map_visit(qsm, begin_shutdown_flush_each, qsm); in ossl_quic_stream_map_begin_shutdown_flush()
832 int ossl_quic_stream_map_is_shutdown_flush_finished(QUIC_STREAM_MAP *qsm) in ossl_quic_stream_map_is_shutdown_flush_finished() argument
834 return qsm->num_shutdown_flush == 0; in ossl_quic_stream_map_is_shutdown_flush_finished()
841 void ossl_quic_stream_iter_init(QUIC_STREAM_ITER *it, QUIC_STREAM_MAP *qsm, in ossl_quic_stream_iter_init() argument
844 it->qsm = qsm; in ossl_quic_stream_iter_init()
845 it->stream = it->first_stream = qsm->rr_cur; in ossl_quic_stream_iter_init()
847 && ++qsm->rr_counter >= qsm->rr_stepping) { in ossl_quic_stream_iter_init()
848 qsm->rr_counter = 0; in ossl_quic_stream_iter_init()
849 qsm->rr_cur = active_next(&qsm->active_list, qsm->rr_cur); in ossl_quic_stream_iter_init()
858 it->stream = active_next(&it->qsm->active_list, it->stream); in ossl_quic_stream_iter_next()