From owner-svn-src-user@FreeBSD.ORG Thu Apr 25 08:37:19 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1FBBD393; Thu, 25 Apr 2013 08:37:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EBD7815E1; Thu, 25 Apr 2013 08:37:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3P8bIxo071967; Thu, 25 Apr 2013 08:37:18 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3P8bIYI071966; Thu, 25 Apr 2013 08:37:18 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304250837.r3P8bIYI071966@svn.freebsd.org> From: Adrian Chadd Date: Thu, 25 Apr 2013 08:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r249889 - user/adrian/net80211_tx/sys/dev/ath X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 08:37:19 -0000 Author: adrian Date: Thu Apr 25 08:37:18 2013 New Revision: 249889 URL: http://svnweb.freebsd.org/changeset/base/249889 Log: Check for PUTPENDING during queue completion and restart TX if it's set. This is intended for later hacking when TDMA + 11n aggregation is being worked on. I'm worried that there's a potential race now that the hardware queue is artificially constrained in depth and that there may be further frames that need queuing but aren't pushed into the queue due to the queue being stamped "PUTPENDING." I've not seen this happen yet though! Also - post ALQ messages for stuck becaons. Modified: user/adrian/net80211_tx/sys/dev/ath/if_ath.c Modified: user/adrian/net80211_tx/sys/dev/ath/if_ath.c ============================================================================== --- user/adrian/net80211_tx/sys/dev/ath/if_ath.c Thu Apr 25 08:36:42 2013 (r249888) +++ user/adrian/net80211_tx/sys/dev/ath/if_ath.c Thu Apr 25 08:37:18 2013 (r249889) @@ -2990,6 +2990,11 @@ ath_bstuck_proc(void *arg, int pending) if (ath_hal_gethangstate(sc->sc_ah, 0xff, &hangs) && hangs != 0) if_printf(ifp, "bb hang detected (0x%x)\n", hangs); +#ifdef ATH_DEBUG_ALQ + if (if_ath_alq_checkdebug(&sc->sc_alq, ATH_ALQ_STUCK_BEACON)) + if_ath_alq_post(&sc->sc_alq, ATH_ALQ_STUCK_BEACON, 0, NULL); +#endif + if_printf(ifp, "stuck beacon; resetting (bmiss count %u)\n", sc->sc_bmisscount); sc->sc_stats.ast_bstuck++; @@ -3888,6 +3893,9 @@ ath_tx_processq(struct ath_softc *sc, st #endif /* IEEE80211_SUPPORT_SUPERG */ int nacked; HAL_STATUS status; +#ifdef IEEE80211_SUPPORT_TDMA + int qbusy; +#endif /* IEEE80211_SUPPORT_TDMA */ DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: tx queue %u head %p link %p\n", __func__, txq->axq_qnum, @@ -3989,13 +3997,41 @@ ath_tx_processq(struct ath_softc *sc, st ieee80211_ff_flush(ic, txq->axq_ac); #endif + ATH_TX_LOCK(sc); + + /* + * Check whether the queue is currently waiting for + * a buffer push and if so, push it. + * + * Since we now limit how deep the TXQ can get, + * we may reach a point where we can't make further + * progress even though there's frames in the + * queue to be scheduled. If we hit this highly + * unlikely case, let's print out a warning and + * restart transmit. + */ +#ifdef IEEE80211_SUPPORT_TDMA + qbusy = ath_hal_txqenabled(ah, txq->axq_qnum); + /* + * If the queue is no longer busy yet there's a + * pending push, make sure it's done. + */ + if ((txq->axq_flags & ATH_TXQ_PUTPENDING) && !qbusy) { + device_printf(sc->sc_dev, + "%s: TXQ %d: PUTPENDING!\n", + __func__, + txq->axq_qnum); + ath_tx_push_pending(sc, txq); + } +#endif + /* Kick the software TXQ scheduler */ if (dosched) { - ATH_TX_LOCK(sc); ath_txq_sched(sc, txq); - ATH_TX_UNLOCK(sc); } + ATH_TX_UNLOCK(sc); + ATH_KTR(sc, ATH_KTR_TXCOMP, 1, "ath_tx_processq: txq=%u: done", txq->axq_qnum);