From owner-svn-src-all@FreeBSD.ORG Sat May 4 04:03:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 851B521E; Sat, 4 May 2013 04:03:51 +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 5E44A1259; Sat, 4 May 2013 04:03:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4443pno086623; Sat, 4 May 2013 04:03:51 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4443px0086622; Sat, 4 May 2013 04:03:51 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305040403.r4443px0086622@svn.freebsd.org> From: Adrian Chadd Date: Sat, 4 May 2013 04:03:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250229 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sat, 04 May 2013 04:03:51 -0000 Author: adrian Date: Sat May 4 04:03:50 2013 New Revision: 250229 URL: http://svnweb.freebsd.org/changeset/base/250229 Log: The holding buffer logic needs to be used for _all_ transmission, not just "when the queue is busy." After talking with the MAC team, it turns out that the linked list implementation sometimes will not accept a TxDP update and will instead re-read the link pointer. So even if the hardware has finished transmitting a chain and has hit EOL/VEOL, it may still re-read the link pointer to begin transmitting again. So, always set ATH_BUF_BUSY on the last buffer in the chain (to mark the last descriptor as the holding descriptor) and never blank the axq_link pointer. Tested: * AR5416, STA mode TODO: * much more thorough testing with the pre-11n NICs, just to verify that they behave the same way. * test TDMA on the 11n and non-11n hardware. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sat May 4 00:31:41 2013 (r250228) +++ head/sys/dev/ath/if_ath.c Sat May 4 04:03:50 2013 (r250229) @@ -3928,19 +3928,20 @@ ath_tx_processq(struct ath_softc *sc, st break; } ATH_TXQ_REMOVE(txq, bf, bf_list); - if (txq->axq_depth > 0) { - /* - * More frames follow. Mark the buffer busy - * so it's not re-used while the hardware may - * still re-read the link field in the descriptor. - * - * Use the last buffer in an aggregate as that - * is where the hardware may be - intermediate - * descriptors won't be "busy". - */ - bf->bf_last->bf_flags |= ATH_BUF_BUSY; - } else - txq->axq_link = NULL; + + /* + * Always mark the last buffer in this list as busy. + * + * The hardware may re-read the holding descriptor + * even if we hit the end of the list and try writing + * a new TxDP. + * + * If there's no holding descriptor then this is the + * last buffer in the list of buffers after a fresh + * reset; it'll soon become the holding buffer. + */ + bf->bf_last->bf_flags |= ATH_BUF_BUSY; + if (bf->bf_state.bfs_aggr) txq->axq_aggr_depth--;