From owner-svn-src-all@FreeBSD.ORG Mon Jun 11 07:29:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A18C41065672; Mon, 11 Jun 2012 07:29:26 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72E448FC19; Mon, 11 Jun 2012 07:29:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5B7TQ7W050287; Mon, 11 Jun 2012 07:29:26 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5B7TQbm050285; Mon, 11 Jun 2012 07:29:26 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201206110729.q5B7TQbm050285@svn.freebsd.org> From: Adrian Chadd Date: Mon, 11 Jun 2012 07:29:26 +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: r236877 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2012 07:29:26 -0000 Author: adrian Date: Mon Jun 11 07:29:25 2012 New Revision: 236877 URL: http://svn.freebsd.org/changeset/base/236877 Log: When scheduling frames in an aggregate session, the frames should be scheduled from the head of the software queue rather than trying to queue the newly given frame. This leads to some rather unfortunate out of order (but still valid as it's inside the BAW) frame TX. This now: * Always queues the frame at the end of the software queue; * Tries to direct dispatch the frame at the head of the software queue, to try and fill up the hardware queue. TODO: * I should likely try to queue as many frames to the hardware as I can at this point, rather than doing one at a time; * ath_tx_xmit_aggr() may fail and this code assumes that it'll schedule the TID. Otherwise TX may stall. PR: kern/166190 Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Mon Jun 11 07:15:48 2012 (r236876) +++ head/sys/dev/ath/if_ath_tx.c Mon Jun 11 07:29:25 2012 (r236877) @@ -2402,7 +2402,22 @@ ath_tx_swq(struct ath_softc *sc, struct /* XXX sched? */ } else if (ath_tx_ampdu_running(sc, an, tid)) { /* AMPDU running, attempt direct dispatch if possible */ + + /* + * Always queue the frame to the tail of the list. + */ + ATH_TXQ_INSERT_TAIL(atid, bf, bf_list); + + /* + * If the hardware queue isn't busy, direct dispatch + * the head frame in the list. Don't schedule the + * TID - let it build some more frames first? + * + * Otherwise, schedule the TID. + */ if (txq->axq_depth < sc->sc_hwq_limit) { + bf = TAILQ_FIRST(&atid->axq_q); + ATH_TXQ_REMOVE(atid, bf, bf_list); ath_tx_xmit_aggr(sc, an, bf); DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: xmit_aggr\n", @@ -2411,7 +2426,6 @@ ath_tx_swq(struct ath_softc *sc, struct DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: ampdu; swq'ing\n", __func__); - ATH_TXQ_INSERT_TAIL(atid, bf, bf_list); ath_tx_tid_sched(sc, atid); } } else if (txq->axq_depth < sc->sc_hwq_limit) {