Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Oct 2009 19:23:34 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r198499 - head/sys/netinet
Message-ID:  <200910261923.n9QJNYop002420@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
-
 }
 
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910261923.n9QJNYop002420>