From owner-svn-src-head@FreeBSD.ORG Wed May 15 05:32:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E0CAAA83; Wed, 15 May 2013 05:32:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mail1.ozon.ru (mx4.ozon.ru [194.186.179.140]) by mx1.freebsd.org (Postfix) with ESMTP id 1683BE0A; Wed, 15 May 2013 05:32:11 +0000 (UTC) Received: from intmail03msk.ozon (intmail03msk.ozon [10.18.18.171]) by mail1.ozon.ru (Postfix) with ESMTP id 5956571A5F4; Wed, 15 May 2013 09:32:10 +0400 (MSK) Received: from mail pickup service by intmail03msk.ozon with Microsoft SMTPSVC; Wed, 15 May 2013 09:31:28 +0400 Received: from intmail03msk.ozon ([10.18.18.171]) by intmail02msk.ozon with Microsoft SMTPSVC(6.0.3790.4675); Mon, 13 May 2013 23:20:00 +0400 Received: from mail1.ozon.ru ([194.186.179.140]) by intmail03msk.ozon with Microsoft SMTPSVC(6.0.3790.4675); Mon, 13 May 2013 22:56:25 +0400 Received: from localhost (localhost [127.0.0.1]) by mail1.ozon.ru (Postfix) with ESMTP id F28D671A6D4 for ; Mon, 13 May 2013 22:56:25 +0400 (MSK) X-Virus-Scanned: amavisd-new at ozon.ru Received: from mail1.ozon.ru ([127.0.0.1]) by localhost (mx4.ozon.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tSDieATEcrua for ; Mon, 13 May 2013 22:56:18 +0400 (MSK) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received-SPF: pass (freebsd.org: 8.8.178.116 is authorized to use 'owner-svn-src-all@freebsd.org' in 'mfrom' identity (mechanism 'ip4:8.8.178.116' matched)) receiver=mx4.ozon.ru; identity=mfrom; envelope-from="owner-svn-src-all@freebsd.org"; helo=mx2.freebsd.org; client-ip=8.8.178.116 Received: from mx2.freebsd.org (mx2.FreeBSD.org [8.8.178.116]) by mail1.ozon.ru (Postfix) with ESMTP id 11C1271A6A4 for ; Mon, 13 May 2013 22:56:18 +0400 (MSK) Received: from hub.freebsd.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id C1DF42420; Mon, 13 May 2013 18:56:16 +0000 (UTC) Received: from hub.freebsd.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by hub.freebsd.org (Postfix) with ESMTP id BF0691EB; Mon, 13 May 2013 18:56:16 +0000 (UTC) (envelope-from owner-svn-src-all@freebsd.org) 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 E0C4AFFC; Mon, 13 May 2013 18:56:04 +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 C1F1B204; Mon, 13 May 2013 18:56:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4DIu4eS042190; Mon, 13 May 2013 18:56:04 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4DIu4rM042189; Mon, 13 May 2013 18:56:04 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305131856.r4DIu4rM042189@svn.freebsd.org> From: Adrian Chadd Date: Mon, 13 May 2013 18:56:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250606 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: owner-svn-src-all@freebsd.org Sender: owner-svn-src-all@freebsd.org X-OriginalArrivalTime: 13 May 2013 18:56:25.0999 (UTC) FILETIME=[91B8C1F0:01CE500B] X-BeenThere: svn-src-head@freebsd.org 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: Wed, 15 May 2013 05:32:12 -0000 Author: adrian Date: Mon May 13 18:56:04 2013 New Revision: 250606 URL: http://svnweb.freebsd.org/changeset/base/250606 Log: Begin tidying up the reassociation and node sleep/wakeup paths. * Move the node sleep/wake state under the TX lock rather than the node lock. Let's leave the node lock protecting rate control only for now. * When reassociating, various state needs to be cleared. For example, the aggregate session needs to be torn down, including any pending aggregation negotiation and BAR TX waiting. * .. and we need to do a "cleanup" pass since frames in the hardware TX queue need to be transmitted. Modify ath_tx_tid_cleanup() to be called with the TX lock held and push frames into a completion list. This allows for the cleanup to be done atomically for all TIDs in a node rather than grabbing and releasing the TX lock each time. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon May 13 18:34:33 2013 (r250605) +++ head/sys/dev/ath/if_ath.c Mon May 13 18:56:04 2013 (r250606) @@ -3845,8 +3845,11 @@ ath_tx_default_comp(struct ath_softc *sc * XXX TODO: during drain, ensure that the callback is * being called so we get a chance to update the TIM. */ - if (bf->bf_node) + if (bf->bf_node) { + ATH_TX_LOCK(sc); ath_tx_update_tim(sc, bf->bf_node, 0); + ATH_TX_UNLOCK(sc); + } /* * Do any tx complete callback. Note this must @@ -5380,6 +5383,31 @@ ath_newassoc(struct ieee80211_node *ni, (vap->iv_flags & IEEE80211_F_PRIVACY) == 0 && sc->sc_hasclrkey && ni->ni_ucastkey.wk_keyix == IEEE80211_KEYIX_NONE) ath_setup_stationkey(ni); + + /* + * If we're reassociating, make sure that any paused queues + * get unpaused. + * + * Now, we may hvae frames in the hardware queue for this node. + * So if we are reassociating and there are frames in the queue, + * we need to go through the cleanup path to ensure that they're + * marked as non-aggregate. + */ + if (! isnew) { + device_printf(sc->sc_dev, + "%s: %6D: reassoc; is_powersave=%d\n", + __func__, + ni->ni_macaddr, + ":", + an->an_is_powersave); + + /* XXX for now, we can't hold the lock across assoc */ + ath_tx_node_reassoc(sc, an); + + /* XXX for now, we can't hold the lock across wakeup */ + if (an->an_is_powersave) + ath_tx_node_wakeup(sc, an); + } } static int @@ -5959,12 +5987,7 @@ ath_node_set_tim(struct ieee80211_node * struct ath_vap *avp = ATH_VAP(ni->ni_vap); int changed = 0; - ATH_NODE_UNLOCK_ASSERT(an); - - /* - * For now, just track and then update the TIM. - */ - ATH_NODE_LOCK(an); + ATH_TX_LOCK(sc); an->an_stack_psq = enable; /* @@ -5975,7 +5998,7 @@ ath_node_set_tim(struct ieee80211_node * * and AP/IBSS node power save. */ if (avp->av_set_tim == NULL) { - ATH_NODE_UNLOCK(an); + ATH_TX_UNLOCK(sc); return (0); } @@ -5997,13 +6020,13 @@ ath_node_set_tim(struct ieee80211_node * DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, "%s: an=%p, enable=%d, tim_set=1, ignoring\n", __func__, an, enable); - ATH_NODE_UNLOCK(an); + ATH_TX_UNLOCK(sc); } else if (enable) { DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, "%s: an=%p, enable=%d, enabling TIM\n", __func__, an, enable); an->an_tim_set = 1; - ATH_NODE_UNLOCK(an); + ATH_TX_UNLOCK(sc); changed = avp->av_set_tim(ni, enable); } else if (atomic_load_acq_int(&an->an_swq_depth) == 0) { /* disable */ @@ -6011,7 +6034,7 @@ ath_node_set_tim(struct ieee80211_node * "%s: an=%p, enable=%d, an_swq_depth == 0, disabling\n", __func__, an, enable); an->an_tim_set = 0; - ATH_NODE_UNLOCK(an); + ATH_TX_UNLOCK(sc); changed = avp->av_set_tim(ni, enable); } else if (! an->an_is_powersave) { /* @@ -6021,7 +6044,7 @@ ath_node_set_tim(struct ieee80211_node * "%s: an=%p, enable=%d, an_pwrsave=0, disabling\n", __func__, an, enable); an->an_tim_set = 0; - ATH_NODE_UNLOCK(an); + ATH_TX_UNLOCK(sc); changed = avp->av_set_tim(ni, enable); } else { /* @@ -6029,7 +6052,7 @@ ath_node_set_tim(struct ieee80211_node * * software queue isn't empty, so don't clear the TIM bit * for now. */ - ATH_NODE_UNLOCK(an); + ATH_TX_UNLOCK(sc); DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, "%s: enable=%d, an_swq_depth > 0, ignoring\n", __func__, enable); @@ -6094,7 +6117,7 @@ ath_tx_update_tim(struct ath_softc *sc, if (avp->av_set_tim == NULL) return; - ATH_NODE_UNLOCK_ASSERT(an); + ATH_TX_LOCK_ASSERT(sc); if (enable) { /* @@ -6104,7 +6127,6 @@ ath_tx_update_tim(struct ath_softc *sc, if (atomic_load_acq_int(&an->an_swq_depth) == 0) return; - ATH_NODE_LOCK(an); if (an->an_is_powersave && an->an_tim_set == 0 && atomic_load_acq_int(&an->an_swq_depth) != 0) { @@ -6112,10 +6134,7 @@ ath_tx_update_tim(struct ath_softc *sc, "%s: an=%p, swq_depth>0, tim_set=0, set!\n", __func__, an); an->an_tim_set = 1; - ATH_NODE_UNLOCK(an); (void) avp->av_set_tim(ni, 1); - } else { - ATH_NODE_UNLOCK(an); } } else { /* @@ -6124,7 +6143,6 @@ ath_tx_update_tim(struct ath_softc *sc, if (atomic_load_acq_int(&an->an_swq_depth) != 0) return; - ATH_NODE_LOCK(an); if (an->an_is_powersave && an->an_stack_psq == 0 && an->an_tim_set == 1 && @@ -6134,10 +6152,7 @@ ath_tx_update_tim(struct ath_softc *sc, " clear!\n", __func__, an); an->an_tim_set = 0; - ATH_NODE_UNLOCK(an); (void) avp->av_set_tim(ni, 0); - } else { - ATH_NODE_UNLOCK(an); } } #else _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"