Lines Matching full:stream
7 * These functions manipulate sctp stream queue/scheduling.
26 static void sctp_sched_prio_unsched_all(struct sctp_stream *stream);
29 struct sctp_stream *stream, int prio, gfp_t gfp) in sctp_sched_prio_new_head() argument
46 struct sctp_stream *stream, int prio, gfp_t gfp) in sctp_sched_prio_get_head() argument
54 list_for_each_entry(p, &stream->prio_list, prio_sched) { in sctp_sched_prio_get_head()
62 for (i = 0; i < stream->outcnt; i++) { in sctp_sched_prio_get_head()
63 if (!SCTP_SO(stream, i)->ext) in sctp_sched_prio_get_head()
66 p = SCTP_SO(stream, i)->ext->prio_head; in sctp_sched_prio_get_head()
77 return sctp_sched_prio_new_head(stream, prio, gfp); in sctp_sched_prio_get_head()
101 /* Try to move to the next stream */ in sctp_sched_prio_unsched()
106 /* Also unsched the priority if this was the last stream */ in sctp_sched_prio_unsched()
109 /* If there is no stream left, clear next */ in sctp_sched_prio_unsched()
117 static void sctp_sched_prio_sched(struct sctp_stream *stream, in sctp_sched_prio_sched() argument
128 /* Schedule the stream. If there is a next, we schedule the new in sctp_sched_prio_sched()
140 list_for_each_entry(prio, &stream->prio_list, prio_sched) { in sctp_sched_prio_sched()
147 list_add_tail(&prio_head->prio_sched, &stream->prio_list); in sctp_sched_prio_sched()
150 static int sctp_sched_prio_set(struct sctp_stream *stream, __u16 sid, in sctp_sched_prio_set() argument
153 struct sctp_stream_out *sout = SCTP_SO(stream, sid); in sctp_sched_prio_set()
159 prio_head = sctp_sched_prio_get_head(stream, prio, gfp); in sctp_sched_prio_set()
167 sctp_sched_prio_sched(stream, soute); in sctp_sched_prio_set()
173 for (i = 0; i < stream->outcnt; i++) { in sctp_sched_prio_set()
174 soute = SCTP_SO(stream, i)->ext; in sctp_sched_prio_set()
186 static int sctp_sched_prio_get(struct sctp_stream *stream, __u16 sid, in sctp_sched_prio_get() argument
189 *value = SCTP_SO(stream, sid)->ext->prio_head->prio; in sctp_sched_prio_get()
193 static int sctp_sched_prio_init(struct sctp_stream *stream) in sctp_sched_prio_init() argument
195 INIT_LIST_HEAD(&stream->prio_list); in sctp_sched_prio_init()
200 static int sctp_sched_prio_init_sid(struct sctp_stream *stream, __u16 sid, in sctp_sched_prio_init_sid() argument
203 INIT_LIST_HEAD(&SCTP_SO(stream, sid)->ext->prio_list); in sctp_sched_prio_init_sid()
204 return sctp_sched_prio_set(stream, sid, 0, gfp); in sctp_sched_prio_init_sid()
207 static void sctp_sched_prio_free(struct sctp_stream *stream) in sctp_sched_prio_free() argument
219 sctp_sched_prio_unsched_all(stream); in sctp_sched_prio_free()
220 for (i = 0; i < stream->outcnt; i++) { in sctp_sched_prio_free()
221 if (!SCTP_SO(stream, i)->ext) in sctp_sched_prio_free()
223 prio = SCTP_SO(stream, i)->ext->prio_head; in sctp_sched_prio_free()
236 struct sctp_stream *stream; in sctp_sched_prio_enqueue() local
242 stream = &q->asoc->stream; in sctp_sched_prio_enqueue()
243 sctp_sched_prio_sched(stream, SCTP_SO(stream, sid)->ext); in sctp_sched_prio_enqueue()
248 struct sctp_stream *stream = &q->asoc->stream; in sctp_sched_prio_dequeue() local
258 * one or the first chunk on the next active stream. in sctp_sched_prio_dequeue()
260 if (stream->out_curr) { in sctp_sched_prio_dequeue()
261 soute = stream->out_curr->ext; in sctp_sched_prio_dequeue()
263 prio = list_entry(stream->prio_list.next, in sctp_sched_prio_dequeue()
281 /* Last chunk on that msg, move to the next stream on in sctp_sched_prio_dequeue_done()
285 soute = SCTP_SO(&q->asoc->stream, sid)->ext; in sctp_sched_prio_dequeue_done()
294 static void sctp_sched_prio_sched_all(struct sctp_stream *stream) in sctp_sched_prio_sched_all() argument
300 asoc = container_of(stream, struct sctp_association, stream); in sctp_sched_prio_sched_all()
305 sout = SCTP_SO(stream, sid); in sctp_sched_prio_sched_all()
307 sctp_sched_prio_sched(stream, sout->ext); in sctp_sched_prio_sched_all()
311 static void sctp_sched_prio_unsched_all(struct sctp_stream *stream) in sctp_sched_prio_unsched_all() argument
316 list_for_each_entry_safe(p, tmp, &stream->prio_list, prio_sched) in sctp_sched_prio_unsched_all()