// SPDX-License-Identifier: GPL-2.0-or-later /* SCTP kernel implementation * (C) Copyright Red Hat Inc. 2017 * * This file is part of the SCTP kernel implementation * * These functions manipulate sctp stream queue/scheduling. * * Please send any bug reports or fixes you make to the * email addresched(es): * lksctp developers <linux-sctp@vger.kernel.org> * * Written or modified by: * Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
*/
sched->unsched_all(stream); for (i = 0; i < stream->outcnt; i++) {
soute = SCTP_SO(stream, i)->ext; if (!soute) continue;
sched->free_sid(stream, i); /* Give the next scheduler a clean slate. */
memset_after(soute, 0, outq);
}
}
int sctp_sched_set_sched(struct sctp_association *asoc, enum sctp_sched_type sched)
{ struct sctp_sched_ops *old = asoc->outqueue.sched; struct sctp_datamsg *msg = NULL; struct sctp_sched_ops *n; struct sctp_chunk *ch; int i, ret = 0;
if (sched > SCTP_SS_MAX) return -EINVAL;
n = sctp_sched_ops[sched]; if (old == n) return ret;
if (old)
sctp_sched_free_sched(&asoc->stream);
asoc->outqueue.sched = n;
n->init(&asoc->stream); for (i = 0; i < asoc->stream.outcnt; i++) { if (!SCTP_SO(&asoc->stream, i)->ext) continue;
ret = n->init_sid(&asoc->stream, i, GFP_ATOMIC); if (ret) goto err;
}
/* We have to requeue all chunks already queued. */
list_for_each_entry(ch, &asoc->outqueue.out_chunk_list, list) { if (ch->msg == msg) continue;
msg = ch->msg;
n->enqueue(&asoc->outqueue, msg);
}
/* datamsg is not finish, so save it as current one, * in case application switch scheduler or a higher * priority stream comes in.
*/
sid = sctp_chunk_stream_no(ch);
sout = SCTP_SO(&q->asoc->stream, sid);
q->asoc->stream.out_curr = sout; return;
}
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.