summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortuexen <tuexen@FreeBSD.org>2009-10-26 19:23:34 +0000
committertuexen <tuexen@FreeBSD.org>2009-10-26 19:23:34 +0000
commit78210debc46f624bad3c94f727c3c5b4021c97be (patch)
tree26d1a93a0f4d08ef8f9a568d58099f7c70932e45
parentdd66eb4609ecf84e7d83c5bda9655ad06df9d478 (diff)
downloadFreeBSD-src-78210debc46f624bad3c94f727c3c5b4021c97be.zip
FreeBSD-src-78210debc46f624bad3c94f727c3c5b4021c97be.tar.gz
Improve the round robin stream scheduler.
Approved by: rrs (mentor) MFC after: 3 days
-rw-r--r--sys/netinet/sctp_output.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c
index a99fc69..02bca90 100644
--- a/sys/netinet/sctp_output.c
+++ b/sys/netinet/sctp_output.c
@@ -7169,20 +7169,14 @@ sctp_select_a_stream(struct sctp_tcb *stcb, struct sctp_association *asoc)
/* Find the next stream to use */
if (asoc->last_out_stream == NULL) {
- strq = asoc->last_out_stream = TAILQ_FIRST(&asoc->out_wheel);
- if (asoc->last_out_stream == NULL) {
- /* huh nothing on the wheel, TSNH */
- return (NULL);
+ strq = TAILQ_FIRST(&asoc->out_wheel);
+ } else {
+ strq = TAILQ_NEXT(asoc->last_out_stream, next_spoke);
+ if (strq == NULL) {
+ strq = TAILQ_FIRST(&asoc->out_wheel);
}
- goto done_it;
- }
- strq = TAILQ_NEXT(asoc->last_out_stream, next_spoke);
-done_it:
- if (strq == NULL) {
- strq = asoc->last_out_stream = TAILQ_FIRST(&asoc->out_wheel);
}
return (strq);
-
}
OpenPOWER on IntegriCloud