Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Apr 2012 23:57:24 +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: r234725 - head/sys/dev/ath
Message-ID:  <201204262357.q3QNvOw7074780@svn.freebsd.org>

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



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