Lines Matching refs:strq

79 		struct sctp_stream_out *strq;  in sctp_ss_default_clear()  local
81 strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); in sctp_ss_default_clear()
82 KASSERT(strq->ss_params.scheduled, ("strq %p not scheduled", (void *)strq)); in sctp_ss_default_clear()
83 TAILQ_REMOVE(&asoc->ss_data.out.wheel, strq, ss_params.ss.rr.next_spoke); in sctp_ss_default_clear()
84 strq->ss_params.scheduled = false; in sctp_ss_default_clear()
91 sctp_ss_default_init_stream(struct sctp_tcb *stcb, struct sctp_stream_out *strq, struct sctp_stream… in sctp_ss_default_init_stream() argument
97 stcb->asoc.ss_data.locked_on_sending = strq; in sctp_ss_default_init_stream()
100 stcb->asoc.ss_data.last_out_stream = strq; in sctp_ss_default_init_stream()
103 strq->ss_params.scheduled = false; in sctp_ss_default_init_stream()
109 struct sctp_stream_out *strq, in sctp_ss_default_add() argument
115 if (!TAILQ_EMPTY(&strq->outqueue) && !strq->ss_params.scheduled) { in sctp_ss_default_add()
117 strq, ss_params.ss.rr.next_spoke); in sctp_ss_default_add()
118 strq->ss_params.scheduled = true; in sctp_ss_default_add()
133 struct sctp_stream_out *strq, in sctp_ss_default_remove() argument
142 if (TAILQ_EMPTY(&strq->outqueue) && strq->ss_params.scheduled) { in sctp_ss_default_remove()
143 if (asoc->ss_data.last_out_stream == strq) { in sctp_ss_default_remove()
151 if (asoc->ss_data.last_out_stream == strq) { in sctp_ss_default_remove()
155 if (asoc->ss_data.locked_on_sending == strq) { in sctp_ss_default_remove()
158 TAILQ_REMOVE(&asoc->ss_data.out.wheel, strq, ss_params.ss.rr.next_spoke); in sctp_ss_default_remove()
159 strq->ss_params.scheduled = false; in sctp_ss_default_remove()
168 struct sctp_stream_out *strq, *strqt; in sctp_ss_default_select() local
184 strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); in sctp_ss_default_select()
186 strq = TAILQ_NEXT(strqt, ss_params.ss.rr.next_spoke); in sctp_ss_default_select()
187 if (strq == NULL) { in sctp_ss_default_select()
188 strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); in sctp_ss_default_select()
191 KASSERT(strq == NULL || strq->ss_params.scheduled, in sctp_ss_default_select()
192 ("strq %p not scheduled", (void *)strq)); in sctp_ss_default_select()
203 if (net != NULL && strq != NULL && in sctp_ss_default_select()
205 if (TAILQ_FIRST(&strq->outqueue) && in sctp_ss_default_select()
206 TAILQ_FIRST(&strq->outqueue)->net != NULL && in sctp_ss_default_select()
207 TAILQ_FIRST(&strq->outqueue)->net != net) { in sctp_ss_default_select()
208 if (strq == asoc->ss_data.last_out_stream) { in sctp_ss_default_select()
211 strqt = strq; in sctp_ss_default_select()
216 return (strq); in sctp_ss_default_select()
223 struct sctp_stream_out *strq, in sctp_ss_default_scheduled() argument
228 KASSERT(strq != NULL, ("strq is NULL")); in sctp_ss_default_scheduled()
229 KASSERT(strq->ss_params.scheduled, ("strq %p is not scheduled", (void *)strq)); in sctp_ss_default_scheduled()
232 asoc->ss_data.last_out_stream = strq; in sctp_ss_default_scheduled()
234 sp = TAILQ_FIRST(&strq->outqueue); in sctp_ss_default_scheduled()
236 asoc->ss_data.locked_on_sending = strq; in sctp_ss_default_scheduled()
258 struct sctp_stream_out *strq SCTP_UNUSED, uint16_t *value SCTP_UNUSED) in sctp_ss_default_get_value()
268 struct sctp_stream_out *strq SCTP_UNUSED, uint16_t value SCTP_UNUSED) in sctp_ss_default_set_value()
279 struct sctp_stream_out *strq; in sctp_ss_default_is_user_msgs_incomplete() local
287 strq = asoc->ss_data.locked_on_sending; in sctp_ss_default_is_user_msgs_incomplete()
288 if (strq == NULL) { in sctp_ss_default_is_user_msgs_incomplete()
291 sp = TAILQ_FIRST(&strq->outqueue); in sctp_ss_default_is_user_msgs_incomplete()
304 struct sctp_stream_out *strq, in sctp_ss_rr_add() argument
311 if (!TAILQ_EMPTY(&strq->outqueue) && !strq->ss_params.scheduled) { in sctp_ss_rr_add()
313 TAILQ_INSERT_HEAD(&asoc->ss_data.out.wheel, strq, ss_params.ss.rr.next_spoke); in sctp_ss_rr_add()
316 while (strqt != NULL && (strqt->sid < strq->sid)) { in sctp_ss_rr_add()
320 TAILQ_INSERT_BEFORE(strqt, strq, ss_params.ss.rr.next_spoke); in sctp_ss_rr_add()
322 TAILQ_INSERT_TAIL(&asoc->ss_data.out.wheel, strq, ss_params.ss.rr.next_spoke); in sctp_ss_rr_add()
325 strq->ss_params.scheduled = true; in sctp_ss_rr_add()
348 struct sctp_stream_out *strq, *strqt; in sctp_ss_rrp_packet_done() local
358 strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); in sctp_ss_rrp_packet_done()
360 strq = TAILQ_NEXT(strqt, ss_params.ss.rr.next_spoke); in sctp_ss_rrp_packet_done()
361 if (strq == NULL) { in sctp_ss_rrp_packet_done()
362 strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); in sctp_ss_rrp_packet_done()
365 KASSERT(strq == NULL || strq->ss_params.scheduled, in sctp_ss_rrp_packet_done()
366 ("strq %p not scheduled", (void *)strq)); in sctp_ss_rrp_packet_done()
377 if (net != NULL && strq != NULL && in sctp_ss_rrp_packet_done()
379 if (TAILQ_FIRST(&strq->outqueue) && in sctp_ss_rrp_packet_done()
380 TAILQ_FIRST(&strq->outqueue)->net != NULL && in sctp_ss_rrp_packet_done()
381 TAILQ_FIRST(&strq->outqueue)->net != net) { in sctp_ss_rrp_packet_done()
382 if (strq == asoc->ss_data.last_out_stream) { in sctp_ss_rrp_packet_done()
383 strq = NULL; in sctp_ss_rrp_packet_done()
385 strqt = strq; in sctp_ss_rrp_packet_done()
390 asoc->ss_data.last_out_stream = strq; in sctp_ss_rrp_packet_done()
405 struct sctp_stream_out *strq; in sctp_ss_prio_clear() local
407 strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); in sctp_ss_prio_clear()
408 KASSERT(strq->ss_params.scheduled, ("strq %p not scheduled", (void *)strq)); in sctp_ss_prio_clear()
410 strq->ss_params.ss.prio.priority = 0; in sctp_ss_prio_clear()
412 TAILQ_REMOVE(&asoc->ss_data.out.wheel, strq, ss_params.ss.prio.next_spoke); in sctp_ss_prio_clear()
413 strq->ss_params.scheduled = false; in sctp_ss_prio_clear()
420 sctp_ss_prio_init_stream(struct sctp_tcb *stcb, struct sctp_stream_out *strq, struct sctp_stream_ou… in sctp_ss_prio_init_stream() argument
426 stcb->asoc.ss_data.locked_on_sending = strq; in sctp_ss_prio_init_stream()
429 stcb->asoc.ss_data.last_out_stream = strq; in sctp_ss_prio_init_stream()
432 strq->ss_params.scheduled = false; in sctp_ss_prio_init_stream()
434 strq->ss_params.ss.prio.priority = with_strq->ss_params.ss.prio.priority; in sctp_ss_prio_init_stream()
436 strq->ss_params.ss.prio.priority = 0; in sctp_ss_prio_init_stream()
443 struct sctp_stream_out *strq, struct sctp_stream_queue_pending *sp SCTP_UNUSED) in sctp_ss_prio_add() argument
450 if (!TAILQ_EMPTY(&strq->outqueue) && !strq->ss_params.scheduled) { in sctp_ss_prio_add()
452 TAILQ_INSERT_HEAD(&asoc->ss_data.out.wheel, strq, ss_params.ss.prio.next_spoke); in sctp_ss_prio_add()
455 while (strqt != NULL && strqt->ss_params.ss.prio.priority < strq->ss_params.ss.prio.priority) { in sctp_ss_prio_add()
459 TAILQ_INSERT_BEFORE(strqt, strq, ss_params.ss.prio.next_spoke); in sctp_ss_prio_add()
461 TAILQ_INSERT_TAIL(&asoc->ss_data.out.wheel, strq, ss_params.ss.prio.next_spoke); in sctp_ss_prio_add()
464 strq->ss_params.scheduled = true; in sctp_ss_prio_add()
471 struct sctp_stream_out *strq, struct sctp_stream_queue_pending *sp SCTP_UNUSED) in sctp_ss_prio_remove() argument
479 if (TAILQ_EMPTY(&strq->outqueue) && strq->ss_params.scheduled) { in sctp_ss_prio_remove()
480 if (asoc->ss_data.last_out_stream == strq) { in sctp_ss_prio_remove()
488 if (asoc->ss_data.last_out_stream == strq) { in sctp_ss_prio_remove()
492 if (asoc->ss_data.locked_on_sending == strq) { in sctp_ss_prio_remove()
495 TAILQ_REMOVE(&asoc->ss_data.out.wheel, strq, ss_params.ss.prio.next_spoke); in sctp_ss_prio_remove()
496 strq->ss_params.scheduled = false; in sctp_ss_prio_remove()
505 struct sctp_stream_out *strq, *strqt, *strqn; in sctp_ss_prio_select() local
521 strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); in sctp_ss_prio_select()
526 strq = strqn; in sctp_ss_prio_select()
528 strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); in sctp_ss_prio_select()
531 KASSERT(strq == NULL || strq->ss_params.scheduled, in sctp_ss_prio_select()
532 ("strq %p not scheduled", (void *)strq)); in sctp_ss_prio_select()
543 if (net != NULL && strq != NULL && in sctp_ss_prio_select()
545 if (TAILQ_FIRST(&strq->outqueue) && in sctp_ss_prio_select()
546 TAILQ_FIRST(&strq->outqueue)->net != NULL && in sctp_ss_prio_select()
547 TAILQ_FIRST(&strq->outqueue)->net != net) { in sctp_ss_prio_select()
548 if (strq == asoc->ss_data.last_out_stream) { in sctp_ss_prio_select()
551 strqt = strq; in sctp_ss_prio_select()
556 return (strq); in sctp_ss_prio_select()
561 struct sctp_stream_out *strq, uint16_t *value) in sctp_ss_prio_get_value() argument
565 if (strq == NULL) { in sctp_ss_prio_get_value()
568 *value = strq->ss_params.ss.prio.priority; in sctp_ss_prio_get_value()
574 struct sctp_stream_out *strq, uint16_t value) in sctp_ss_prio_set_value() argument
578 if (strq == NULL) { in sctp_ss_prio_set_value()
581 strq->ss_params.ss.prio.priority = value; in sctp_ss_prio_set_value()
582 sctp_ss_prio_remove(stcb, asoc, strq, NULL); in sctp_ss_prio_set_value()
583 sctp_ss_prio_add(stcb, asoc, strq, NULL); in sctp_ss_prio_set_value()
598 struct sctp_stream_out *strq; in sctp_ss_fb_clear() local
600 strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); in sctp_ss_fb_clear()
601 KASSERT(strq->ss_params.scheduled, ("strq %p not scheduled", (void *)strq)); in sctp_ss_fb_clear()
603 strq->ss_params.ss.fb.rounds = -1; in sctp_ss_fb_clear()
605 TAILQ_REMOVE(&asoc->ss_data.out.wheel, strq, ss_params.ss.fb.next_spoke); in sctp_ss_fb_clear()
606 strq->ss_params.scheduled = false; in sctp_ss_fb_clear()
613 sctp_ss_fb_init_stream(struct sctp_tcb *stcb, struct sctp_stream_out *strq, struct sctp_stream_out … in sctp_ss_fb_init_stream() argument
619 stcb->asoc.ss_data.locked_on_sending = strq; in sctp_ss_fb_init_stream()
622 stcb->asoc.ss_data.last_out_stream = strq; in sctp_ss_fb_init_stream()
625 strq->ss_params.scheduled = false; in sctp_ss_fb_init_stream()
627 strq->ss_params.ss.fb.rounds = with_strq->ss_params.ss.fb.rounds; in sctp_ss_fb_init_stream()
629 strq->ss_params.ss.fb.rounds = -1; in sctp_ss_fb_init_stream()
636 struct sctp_stream_out *strq, struct sctp_stream_queue_pending *sp SCTP_UNUSED) in sctp_ss_fb_add() argument
640 if (!TAILQ_EMPTY(&strq->outqueue) && !strq->ss_params.scheduled) { in sctp_ss_fb_add()
641 if (strq->ss_params.ss.fb.rounds < 0) in sctp_ss_fb_add()
642 strq->ss_params.ss.fb.rounds = TAILQ_FIRST(&strq->outqueue)->length; in sctp_ss_fb_add()
643 TAILQ_INSERT_TAIL(&asoc->ss_data.out.wheel, strq, ss_params.ss.fb.next_spoke); in sctp_ss_fb_add()
644 strq->ss_params.scheduled = true; in sctp_ss_fb_add()
651 struct sctp_stream_out *strq, struct sctp_stream_queue_pending *sp SCTP_UNUSED) in sctp_ss_fb_remove() argument
659 if (TAILQ_EMPTY(&strq->outqueue) && strq->ss_params.scheduled) { in sctp_ss_fb_remove()
660 if (asoc->ss_data.last_out_stream == strq) { in sctp_ss_fb_remove()
668 if (asoc->ss_data.last_out_stream == strq) { in sctp_ss_fb_remove()
672 if (asoc->ss_data.locked_on_sending == strq) { in sctp_ss_fb_remove()
675 TAILQ_REMOVE(&asoc->ss_data.out.wheel, strq, ss_params.ss.fb.next_spoke); in sctp_ss_fb_remove()
676 strq->ss_params.scheduled = false; in sctp_ss_fb_remove()
685 struct sctp_stream_out *strq = NULL, *strqt; in sctp_ss_fb_select() local
709 ((strq == NULL) || in sctp_ss_fb_select()
710 (strqt->ss_params.ss.fb.rounds < strq->ss_params.ss.fb.rounds))) { in sctp_ss_fb_select()
711 strq = strqt; in sctp_ss_fb_select()
719 } while (strqt != strq); in sctp_ss_fb_select()
720 return (strq); in sctp_ss_fb_select()
725 struct sctp_association *asoc, struct sctp_stream_out *strq, in sctp_ss_fb_scheduled() argument
735 sp = TAILQ_FIRST(&strq->outqueue); in sctp_ss_fb_scheduled()
737 asoc->ss_data.locked_on_sending = strq; in sctp_ss_fb_scheduled()
744 subtract = strq->ss_params.ss.fb.rounds; in sctp_ss_fb_scheduled()
750 if (TAILQ_FIRST(&strq->outqueue)) { in sctp_ss_fb_scheduled()
751 strq->ss_params.ss.fb.rounds = TAILQ_FIRST(&strq->outqueue)->length; in sctp_ss_fb_scheduled()
753 strq->ss_params.ss.fb.rounds = -1; in sctp_ss_fb_scheduled()
755 asoc->ss_data.last_out_stream = strq; in sctp_ss_fb_scheduled()
765 struct sctp_stream_out *strq SCTP_UNUSED,
822 sctp_ss_fcfs_init_stream(struct sctp_tcb *stcb, struct sctp_stream_out *strq, struct sctp_stream_ou… in sctp_ss_fcfs_init_stream() argument
828 stcb->asoc.ss_data.locked_on_sending = strq; in sctp_ss_fcfs_init_stream()
831 stcb->asoc.ss_data.last_out_stream = strq; in sctp_ss_fcfs_init_stream()
834 strq->ss_params.scheduled = false; in sctp_ss_fcfs_init_stream()
840 struct sctp_stream_out *strq SCTP_UNUSED, struct sctp_stream_queue_pending *sp) in sctp_ss_fcfs_add()
861 struct sctp_stream_out *strq SCTP_UNUSED, struct sctp_stream_queue_pending *sp) in sctp_ss_fcfs_remove()
876 struct sctp_stream_out *strq; in sctp_ss_fcfs_select() local
887 strq = &asoc->strmout[sp->sid]; in sctp_ss_fcfs_select()
889 strq = NULL; in sctp_ss_fcfs_select()
901 if (net != NULL && strq != NULL && in sctp_ss_fcfs_select()
903 if (TAILQ_FIRST(&strq->outqueue) && in sctp_ss_fcfs_select()
904 TAILQ_FIRST(&strq->outqueue)->net != NULL && in sctp_ss_fcfs_select()
905 TAILQ_FIRST(&strq->outqueue)->net != net) { in sctp_ss_fcfs_select()
910 return (strq); in sctp_ss_fcfs_select()
917 struct sctp_stream_out *strq, in sctp_ss_fcfs_scheduled() argument
922 KASSERT(strq != NULL, ("strq is NULL")); in sctp_ss_fcfs_scheduled()
923 asoc->ss_data.last_out_stream = strq; in sctp_ss_fcfs_scheduled()
925 sp = TAILQ_FIRST(&strq->outqueue); in sctp_ss_fcfs_scheduled()
927 asoc->ss_data.locked_on_sending = strq; in sctp_ss_fcfs_scheduled()