From owner-svn-src-user@FreeBSD.ORG Mon Aug 15 09:07:43 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 364D3106566B; Mon, 15 Aug 2011 09:07:43 +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 1C81D8FC08; Mon, 15 Aug 2011 09:07:43 +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 p7F97hYh001808; Mon, 15 Aug 2011 09:07:43 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7F97g7F001806; Mon, 15 Aug 2011 09:07:43 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108150907.p7F97g7F001806@svn.freebsd.org> From: Adrian Chadd Date: Mon, 15 Aug 2011 09:07:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224877 - user/adrian/if_ath_tx/sys/dev/ath X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 15 Aug 2011 09:07:43 -0000 Author: adrian Date: Mon Aug 15 09:07:42 2011 New Revision: 224877 URL: http://svn.freebsd.org/changeset/base/224877 Log: * Flip on sending BAR frames, but don't (yet) pause the TID until that's actually completed. * Fix a bug in the retry code - ATH_BUF_BUSY indicates that there may be frames after this one and the hardware QCU may be paused at said frame, waiting for the next TX opportunity to open up (when doing TDMA.) For now, just remove the flag. I'll revisit this before I merge this code into -HEAD. This now queues BAR frames but has exposed a bug in the TID scheduling when sending BAR frames and handling packet loss. I'll fix this in a subsequent commit. Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Mon Aug 15 07:32:44 2011 (r224876) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Mon Aug 15 09:07:42 2011 (r224877) @@ -348,7 +348,7 @@ ath_tx_handoff_mcast(struct ath_softc *s { ATH_TXQ_LOCK_ASSERT(txq); KASSERT((bf->bf_flags & ATH_BUF_BUSY) == 0, - ("busy status 0x%x", bf->bf_flags)); + ("%s: busy status 0x%x", __func__, bf->bf_flags)); if (txq->axq_link != NULL) { struct ath_buf *last = ATH_TXQ_LAST(txq); struct ieee80211_frame *wh; @@ -386,7 +386,7 @@ ath_tx_handoff_hw(struct ath_softc *sc, */ ATH_TXQ_LOCK_ASSERT(txq); KASSERT((bf->bf_flags & ATH_BUF_BUSY) == 0, - ("busy status 0x%x", bf->bf_flags)); + ("%s: busy status 0x%x", __func__, bf->bf_flags)); KASSERT(txq->axq_qnum != ATH_TXQ_SWQ, ("ath_tx_handoff_hw called for mcast queue")); @@ -2151,17 +2151,12 @@ ath_tx_aggr_retry_unaggr(struct ath_soft /* Send BAR frame */ /* - * XXX This causes the kernel to recurse - * XXX back into the net80211 layer, then back out - * XXX to the TX queue (via ic->ic_raw_xmit()). - * XXX Because the TXQ lock is held here, - * XXX this will cause a lock recurse panic. + * This'll end up going into net80211 and back out + * again, via ic->ic_raw_xmit(). */ device_printf(sc->sc_dev, "%s: TID %d: send BAR\n", __func__, tid); -#if 0 ieee80211_send_bar(ni, tap, ni->ni_txseqs[tid]); -#endif /* Free buffer, bf is free after this call */ ath_tx_default_comp(sc, bf, 0); @@ -2176,6 +2171,26 @@ ath_tx_aggr_retry_unaggr(struct ath_soft ath_tx_set_retry(sc, bf); /* + * XXX Clear the ATH_BUF_BUSY flag. This is likely incorrect + * XXX and must be revisited before this is merged into -HEAD. + * + * This flag is set in ath_tx_processq() if the HW TXQ has + * further frames on it. The hardware may currently be processing + * the link field in the descriptor (because for TDMA, the + * QCU (TX queue DMA engine) can stop until the next TX slot is + * available and a recycled buffer may still contain a descriptor + * which the currently-paused QCU still points to. + * + * Since I'm not worried about TDMA just for now, I'm going to blank + * the flag. + */ + if (bf->bf_flags & ATH_BUF_BUSY) { + bf->bf_flags &= ~ ATH_BUF_BUSY; + DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, + "%s: bf %p: ATH_BUF_BUSY\n", __func__, bf); + } + + /* * Insert this at the head of the queue, so it's * retried before any current/subsequent frames. */