Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Jun 2012 07:29:26 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r236877 - head/sys/dev/ath
Message-ID:  <201206110729.q5B7TQbm050285@svn.freebsd.org>

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



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