From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 19:23:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62A9B1065679; Mon, 26 Oct 2009 19:23:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 517928FC15; Mon, 26 Oct 2009 19:23:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9QJNYoA002422; Mon, 26 Oct 2009 19:23:34 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9QJNYop002420; Mon, 26 Oct 2009 19:23:34 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <200910261923.n9QJNYop002420@svn.freebsd.org> From: Michael Tuexen Date: Mon, 26 Oct 2009 19:23:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198499 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 19:23:35 -0000 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); - }