From owner-svn-src-head@FreeBSD.ORG Thu Apr 26 23:57:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E04E106566B; Thu, 26 Apr 2012 23:57:25 +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 F36848FC08; Thu, 26 Apr 2012 23:57:24 +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 q3QNvOXj074782; Thu, 26 Apr 2012 23:57:24 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3QNvOw7074780; Thu, 26 Apr 2012 23:57:24 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201204262357.q3QNvOw7074780@svn.freebsd.org> From: Adrian Chadd Date: Thu, 26 Apr 2012 23:57:24 +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: r234725 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2012 23:57:25 -0000 Author: adrian Date: Thu Apr 26 23:57:24 2012 New Revision: 234725 URL: http://svn.freebsd.org/changeset/base/234725 Log: Remove some of the redundant locking done in the TX completion path, when checking whether BAR frames need to be checked. 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 Thu Apr 26 23:12:52 2012 (r234724) +++ head/sys/dev/ath/if_ath_tx.c Thu Apr 26 23:57:24 2012 (r234725) @@ -3455,6 +3455,9 @@ ath_tx_comp_aggr_error(struct ath_softc ATH_TXQ_INSERT_HEAD(tid, bf, bf_list); } + /* + * Schedule the TID to be re-tried. + */ ath_tx_tid_sched(sc, tid); /* @@ -3469,12 +3472,9 @@ ath_tx_comp_aggr_error(struct ath_softc ath_tx_tid_bar_suspend(sc, tid); } - ATH_TXQ_UNLOCK(sc->sc_ac2q[tid->ac]); - /* * Send BAR if required */ - ATH_TXQ_LOCK(sc->sc_ac2q[tid->ac]); if (ath_tx_tid_bar_tx_ready(sc, tid)) ath_tx_tid_bar_tx(sc, tid); ATH_TXQ_UNLOCK(sc->sc_ac2q[tid->ac]); @@ -3742,24 +3742,28 @@ ath_tx_aggr_comp_aggr(struct ath_softc * ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); } - /* Prepend all frames to the beginning of the queue */ + DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, + "%s: txa_start now %d\n", __func__, tap->txa_start); + ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); + + /* Prepend all frames to the beginning of the queue */ while ((bf = TAILQ_LAST(&bf_q, ath_bufhead_s)) != NULL) { TAILQ_REMOVE(&bf_q, bf, bf_list); ATH_TXQ_INSERT_HEAD(atid, bf, bf_list); } - ath_tx_tid_sched(sc, atid); - ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); - DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, - "%s: txa_start now %d\n", __func__, tap->txa_start); + /* + * Reschedule to grab some further frames. + */ + ath_tx_tid_sched(sc, atid); /* * Send BAR if required */ - ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); if (ath_tx_tid_bar_tx_ready(sc, atid)) ath_tx_tid_bar_tx(sc, atid); + ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); /* Do deferred completion */