Lines Matching defs:stream
7 * These functions manipulate sctp stream queue/scheduling.
26 static void sctp_sched_prio_unsched_all(struct sctp_stream *stream);
41 struct sctp_stream *stream, int prio, gfp_t gfp)
59 struct sctp_stream *stream, int prio, gfp_t gfp)
67 list_for_each_entry(p, &stream->prio_list, prio_sched) {
75 for (i = 0; i < stream->outcnt; i++) {
76 if (!SCTP_SO(stream, i)->ext)
79 p = SCTP_SO(stream, i)->ext->prio_head;
90 return sctp_sched_prio_new_head(stream, prio, gfp);
114 /* Try to move to the next stream */
119 /* Also unsched the priority if this was the last stream */
122 /* If there is no stream left, clear next */
130 static void sctp_sched_prio_sched(struct sctp_stream *stream,
141 /* Schedule the stream. If there is a next, we schedule the new
153 list_for_each_entry(prio, &stream->prio_list, prio_sched) {
160 list_add_tail(&prio_head->prio_sched, &stream->prio_list);
163 static int sctp_sched_prio_set(struct sctp_stream *stream, __u16 sid,
166 struct sctp_stream_out *sout = SCTP_SO(stream, sid);
175 prio_head = sctp_sched_prio_get_head(stream, prio, gfp);
182 sctp_sched_prio_sched(stream, soute);
188 static int sctp_sched_prio_get(struct sctp_stream *stream, __u16 sid,
191 *value = SCTP_SO(stream, sid)->ext->prio_head->prio;
195 static int sctp_sched_prio_init(struct sctp_stream *stream)
197 INIT_LIST_HEAD(&stream->prio_list);
202 static int sctp_sched_prio_init_sid(struct sctp_stream *stream, __u16 sid,
205 INIT_LIST_HEAD(&SCTP_SO(stream, sid)->ext->prio_list);
206 return sctp_sched_prio_set(stream, sid, 0, gfp);
209 static void sctp_sched_prio_free_sid(struct sctp_stream *stream, __u16 sid)
211 sctp_sched_prio_head_put(SCTP_SO(stream, sid)->ext->prio_head);
212 SCTP_SO(stream, sid)->ext->prio_head = NULL;
215 static void sctp_sched_prio_free(struct sctp_stream *stream)
227 sctp_sched_prio_unsched_all(stream);
228 for (i = 0; i < stream->outcnt; i++) {
229 if (!SCTP_SO(stream, i)->ext)
231 prio = SCTP_SO(stream, i)->ext->prio_head;
244 struct sctp_stream *stream;
250 stream = &q->asoc->stream;
251 sctp_sched_prio_sched(stream, SCTP_SO(stream, sid)->ext);
256 struct sctp_stream *stream = &q->asoc->stream;
266 * one or the first chunk on the next active stream.
268 if (stream->out_curr) {
269 soute = stream->out_curr->ext;
271 prio = list_entry(stream->prio_list.next,
289 /* Last chunk on that msg, move to the next stream on
293 soute = SCTP_SO(&q->asoc->stream, sid)->ext;
302 static void sctp_sched_prio_sched_all(struct sctp_stream *stream)
308 asoc = container_of(stream, struct sctp_association, stream);
313 sout = SCTP_SO(stream, sid);
315 sctp_sched_prio_sched(stream, sout->ext);
319 static void sctp_sched_prio_unsched_all(struct sctp_stream *stream)
324 list_for_each_entry_safe(p, tmp, &stream->prio_list, prio_sched)