From owner-svn-src-user@FreeBSD.ORG Fri Apr 26 00:00:15 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 75744A72; Fri, 26 Apr 2013 00:00:15 +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 6859311FA; Fri, 26 Apr 2013 00:00:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3Q00EBF093641; Fri, 26 Apr 2013 00:00:14 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3Q00E0M093636; Fri, 26 Apr 2013 00:00:14 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304260000.r3Q00E0M093636@svn.freebsd.org> From: Adrian Chadd Date: Fri, 26 Apr 2013 00:00:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r249909 - 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: Fri, 26 Apr 2013 00:00:15 -0000 Author: adrian Date: Fri Apr 26 00:00:14 2013 New Revision: 249909 URL: http://svnweb.freebsd.org/changeset/base/249909 Log: Remove the atomic operation - it wasn't that 'correct' to begin with. Things are much cleaner now that they're behind the TX lock. Modified: user/adrian/net80211_tx/sys/dev/ath/if_ath.c user/adrian/net80211_tx/sys/dev/ath/if_ath_tx.c user/adrian/net80211_tx/sys/dev/ath/if_athvar.h Modified: user/adrian/net80211_tx/sys/dev/ath/if_ath.c ============================================================================== --- user/adrian/net80211_tx/sys/dev/ath/if_ath.c Thu Apr 25 23:10:34 2013 (r249908) +++ user/adrian/net80211_tx/sys/dev/ath/if_ath.c Fri Apr 26 00:00:14 2013 (r249909) @@ -5926,7 +5926,7 @@ ath_node_set_tim(struct ieee80211_node * an->an_tim_set = 1; ATH_TX_UNLOCK(sc); changed = avp->av_set_tim(ni, enable); - } else if (atomic_load_acq_int(&an->an_swq_depth) == 0) { + } else if (an->an_swq_depth == 0) { /* disable */ DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, "%s: %6D: enable=%d, an_swq_depth == 0, disabling\n", @@ -6031,12 +6031,12 @@ ath_tx_update_tim(struct ath_softc *sc, * Don't bother grabbing the lock unless the queue is not * empty. */ - if (atomic_load_acq_int(&an->an_swq_depth) == 0) + if (an->an_swq_depth == 0) return; if (an->an_is_powersave && an->an_tim_set == 0 && - atomic_load_acq_int(&an->an_swq_depth) != 0) { + an->an_swq_depth != 0) { DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, "%s: %6D: swq_depth>0, tim_set=0, set!\n", __func__, @@ -6046,16 +6046,10 @@ ath_tx_update_tim(struct ath_softc *sc, (void) avp->av_set_tim(ni, 1); } } else { - /* - * Don't bother grabbing the lock unless the queue is empty. - */ - if (atomic_load_acq_int(&an->an_swq_depth) != 0) - return; - if (an->an_is_powersave && an->an_stack_psq == 0 && an->an_tim_set == 1 && - atomic_load_acq_int(&an->an_swq_depth) == 0) { + an->an_swq_depth == 0) { DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, "%s: %6D: swq_depth=0, tim_set=1, psq_set=0," " clear!\n", @@ -6161,7 +6155,7 @@ ath_node_recv_pspoll(struct ieee80211_no * Don't bother checking if the TIM bit is set, we really * only care if there are any frames here! */ - if (atomic_load_acq_int(&an->an_swq_depth) == 0) { + if (an->an_swq_depth == 0) { ATH_NODE_UNLOCK(an); DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, "%s: %6D: SWQ empty; punting to net80211\n", Modified: user/adrian/net80211_tx/sys/dev/ath/if_ath_tx.c ============================================================================== --- user/adrian/net80211_tx/sys/dev/ath/if_ath_tx.c Thu Apr 25 23:10:34 2013 (r249908) +++ user/adrian/net80211_tx/sys/dev/ath/if_ath_tx.c Fri Apr 26 00:00:14 2013 (r249909) @@ -1936,7 +1936,7 @@ ath_tx_start(struct ath_softc *sc, struc */ if (type == IEEE80211_FC0_TYPE_DATA && ATH_NODE(ni)->an_is_powersave && - atomic_load_acq_int(&ATH_NODE(ni)->an_swq_depth) > + ATH_NODE(ni)->an_swq_depth > sc->sc_txq_node_psq_maxdepth) { sc->sc_stats.ast_tx_node_psq_overflow++; m_freem(m0); @@ -2769,7 +2769,7 @@ ath_tx_leak_count_update(struct ath_soft * Update MORE based on the software/net80211 queue states. */ if ((tid->an->an_stack_psq > 0) - || (atomic_load_acq_int(&tid->an->an_swq_depth) > 0)) + || (tid->an->an_swq_depth > 0)) wh->i_fc[1] |= IEEE80211_FC1_MORE_DATA; else wh->i_fc[1] &= ~IEEE80211_FC1_MORE_DATA; @@ -2781,7 +2781,7 @@ ath_tx_leak_count_update(struct ath_soft ":", tid->an->an_leak_count, tid->an->an_stack_psq, - atomic_load_acq_int(&tid->an->an_swq_depth), + tid->an->an_swq_depth, !! (wh->i_fc[1] & IEEE80211_FC1_MORE_DATA)); /* Modified: user/adrian/net80211_tx/sys/dev/ath/if_athvar.h ============================================================================== --- user/adrian/net80211_tx/sys/dev/ath/if_athvar.h Thu Apr 25 23:10:34 2013 (r249908) +++ user/adrian/net80211_tx/sys/dev/ath/if_athvar.h Fri Apr 26 00:00:14 2013 (r249909) @@ -413,17 +413,17 @@ struct ath_txq { #define ATH_TID_INSERT_HEAD(_tq, _elm, _field) do { \ TAILQ_INSERT_HEAD(&(_tq)->tid_q, (_elm), _field); \ (_tq)->axq_depth++; \ - atomic_add_rel_32( &((_tq)->an)->an_swq_depth, 1); \ + (_tq)->an->an_swq_depth++; \ } while (0) #define ATH_TID_INSERT_TAIL(_tq, _elm, _field) do { \ TAILQ_INSERT_TAIL(&(_tq)->tid_q, (_elm), _field); \ (_tq)->axq_depth++; \ - atomic_add_rel_32( &((_tq)->an)->an_swq_depth, 1); \ + (_tq)->an->an_swq_depth++; \ } while (0) #define ATH_TID_REMOVE(_tq, _elm, _field) do { \ TAILQ_REMOVE(&(_tq)->tid_q, _elm, _field); \ (_tq)->axq_depth--; \ - atomic_subtract_rel_32( &((_tq)->an)->an_swq_depth, 1); \ + (_tq)->an->an_swq_depth--; \ } while (0) #define ATH_TID_FIRST(_tq) TAILQ_FIRST(&(_tq)->tid_q) #define ATH_TID_LAST(_tq, _field) TAILQ_LAST(&(_tq)->tid_q, _field) @@ -434,17 +434,17 @@ struct ath_txq { #define ATH_TID_FILT_INSERT_HEAD(_tq, _elm, _field) do { \ TAILQ_INSERT_HEAD(&(_tq)->filtq.tid_q, (_elm), _field); \ (_tq)->axq_depth++; \ - atomic_add_rel_32( &((_tq)->an)->an_swq_depth, 1); \ + (_tq)->an->an_swq_depth++; \ } while (0) #define ATH_TID_FILT_INSERT_TAIL(_tq, _elm, _field) do { \ TAILQ_INSERT_TAIL(&(_tq)->filtq.tid_q, (_elm), _field); \ (_tq)->axq_depth++; \ - atomic_add_rel_32( &((_tq)->an)->an_swq_depth, 1); \ + (_tq)->an->an_swq_depth++; \ } while (0) #define ATH_TID_FILT_REMOVE(_tq, _elm, _field) do { \ TAILQ_REMOVE(&(_tq)->filtq.tid_q, _elm, _field); \ (_tq)->axq_depth--; \ - atomic_subtract_rel_32( &((_tq)->an)->an_swq_depth, 1); \ + (_tq)->an->an_swq_depth--; \ } while (0) #define ATH_TID_FILT_FIRST(_tq) TAILQ_FIRST(&(_tq)->filtq.tid_q) #define ATH_TID_FILT_LAST(_tq, _field) TAILQ_LAST(&(_tq)->filtq.tid_q,_field)