svn commit: r198499 - head/sys/netinet
Michael Tuexen
tuexen at FreeBSD.org
Mon Oct 26 19:23:35 UTC 2009
Author: tuexen
Date: Mon Oct 26 19:23:34 2009
New Revision: 198499
URL: http://svn.freebsd.org/changeset/base/198499
Log:
Improve the round robin stream scheduler.
Approved by: rrs (mentor)
MFC after: 3 days
Modified:
head/sys/netinet/sctp_output.c
Modified: head/sys/netinet/sctp_output.c
==============================================================================
--- head/sys/netinet/sctp_output.c Mon Oct 26 19:10:54 2009 (r198498)
+++ head/sys/netinet/sctp_output.c Mon Oct 26 19:23:34 2009 (r198499)
@@ -7169,20 +7169,14 @@ sctp_select_a_stream(struct sctp_tcb *st
/* 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);
- }
- 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);
+ 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);
+ }
}
return (strq);
-
}
More information about the svn-src-all
mailing list