staticstruct sctp_stream_priorities *sctp_sched_prio_get_head( struct sctp_stream *stream, int prio, gfp_t gfp)
{ struct sctp_stream_priorities *p; int i;
/* Look into scheduled priorities first, as they are sorted and *wecanfinditfastIFit'sscheduled.
*/
list_for_each_entry(p, &stream->prio_list, prio_sched) { if (p->prio == prio) return sctp_sched_prio_head_get(p); if (p->prio > prio) break;
}
/* No luck. So we search on all streams now. */ for (i = 0; i < stream->outcnt; i++) { if (!SCTP_SO(stream, i)->ext) continue;
p = SCTP_SO(stream, i)->ext->prio_head; if (!p) /* Means all other streams won't be initialized *aswell.
*/ break; if (p->prio == prio) return sctp_sched_prio_head_get(p);
}
/* If not even there, allocate a new one. */ return sctp_sched_prio_new_head(stream, prio, gfp);
}
if (!list_empty(&soute->prio_list)) { struct sctp_stream_priorities *prio_head = soute->prio_head;
/* Scheduled */
scheduled = true;
if (prio_head->next == soute) /* Try to move to the next stream */
sctp_sched_prio_next_stream(prio_head);
list_del_init(&soute->prio_list);
/* Also unsched the priority if this was the last stream */ if (list_empty(&prio_head->active)) {
list_del_init(&prio_head->prio_sched); /* If there is no stream left, clear next */
prio_head->next = NULL;
}
}
/* Nothing to do if already scheduled */ if (!list_empty(&soute->prio_list)) return;
/* Schedule the stream. If there is a next, we schedule the new *onebeforeit,soit'sthelastinroundrobinorder. *Ifthereisn't,wealsohavetoschedulethepriority.
*/ if (prio_head->next) {
list_add(&soute->prio_list, prio_head->next->prio_list.prev); return;
}
/* Last chunk on that msg, move to the next stream on *thispriority.
*/
sid = sctp_chunk_stream_no(ch);
soute = SCTP_SO(&q->asoc->stream, sid)->ext;
prio = soute->prio_head;
sctp_sched_prio_next_stream(prio);
if (list_empty(&soute->outq))
sctp_sched_prio_unsched(soute);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.