From nobody Fri May 06 09:36:48 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 54DF91AC49AC; Fri, 6 May 2022 09:36:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Kvlnr1yDGz4dfv; Fri, 6 May 2022 09:36:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651829808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B3peNlyEkb4AJBxeEshlCQ8U/G9xxa7W7ryystN4k10=; b=PCqh38NdZ47qfkvKtKmAbdMuP3EvS+Ww9Yk4T8pmDoHL1uP3/D1tAQPOk+FFEfuSO5gIXu OF3srEbokdVL7GmbrCxc0hNOKzH1fvzDuOVCC/imDIyrHG/AHOMwiQNrsusuUq1bWTQIwv FXobTDHXpQr7YINVffxUrI0j2yhSP63nnaSczLbi+fZ8mRQCtiLrv0uQvANOXvKS+tDRUc oJzzeHbeJ+yxBoP0JtaP9Cx1aE2Gq/G/dkI7PYIY/u1EtaCXO+cpBE88jlqXSJtWaKjD9C w9+ncd6hrdls40ODFzv1GsSqhDglvKs8wthb3qwPBt1PPPvlaHEnKAXx6M1B1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2304619718; Fri, 6 May 2022 09:36:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2469amDS051097; Fri, 6 May 2022 09:36:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2469amMr051096; Fri, 6 May 2022 09:36:48 GMT (envelope-from git) Date: Fri, 6 May 2022 09:36:48 GMT Message-Id: <202205060936.2469amMr051096@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 464907ce1cf9 - main - net80211: simplify code after STA/AP VAPs traffic hang fix List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 464907ce1cf931091fa48999ea64480a6d2ef52c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651829808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B3peNlyEkb4AJBxeEshlCQ8U/G9xxa7W7ryystN4k10=; b=eowJCLqDVbD9CxnAKqCMn79EiiiYryIEt6omkGrKkfoEUTfCsEGmNNh7jOk1sjXIBkTbpv HVbY+TowrfL1/YiWrdG5jc31DQrQyTap7BKEcX/v8a18eVkCRFebJrLo2dQXwfyjkjCsA9 7z6IyXcFf4F1N23NPksLtgAfA6+tq+/4t8OhPXLY4Lnc3OjQGLzDiJ1LP4eSz4VLGkVQv8 VrCzZLEpBSubP92SWXcuuQS2hr8Oh14j1go9YugKNq4BybBd9aZgNBbW8USxvQzEaO95jw qGfASodDBlzAiUz2vj/ZUITSSvokgEwrMWzB3ZyIiVNi16xo8EEuACbH4wfJ/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651829808; a=rsa-sha256; cv=none; b=E7mqCYP6RYnPYlDBwp+uxx1wjlitMZMnlGIkt7EBaN31PjZpAHb2Vpg+JMITXkS5GE0uTU eBSqrpWbrUOiFSnrdvnG8RfsUn2EFEpk6GF02vlUtgCnd7R50EQV0Y2/6Tg7neP4yOEFJW +6HTPg3GSyBflQD2+a20FyB9jHFF7w+ReZ4SBKZZTR+dDl7MurYAD6FQYzRgP8RfsSzXHw uwyqMP0BlhSHV8mQ+vyWKFI42VMnuGIDUShl5Xu9e3PtGPp57zBGZPg4VSWZUcrk0jiZ+G jx+QGRcbHxZ+gbLk9mfbOHUVUEiU4pAhPtIBhLy7XAxngsGgOLMkvdgHB3Q09A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=464907ce1cf931091fa48999ea64480a6d2ef52c commit 464907ce1cf931091fa48999ea64480a6d2ef52c Author: Bjoern A. Zeeb AuthorDate: 2022-05-05 22:21:03 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-05-06 09:34:16 +0000 net80211: simplify code after STA/AP VAPs traffic hang fix Combine the comment and double-unsetting of OACTIVE into a single case after e8de31caceaa36caf5d7b4355072f148e2433b82. This saves the question of why we do it twice--once right before and one more time right after the state change check. Also move the XXX comment about kicking the queue up to where it seems better suited now. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D35135 --- sys/net80211/ieee80211_proto.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c index d2bde99ce79c..f42c62444579 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -2582,18 +2582,6 @@ ieee80211_newstate_cb(void *xvap, int npending) * be no-op code - and also if OACTIVE is finally retired, it'll * also be no-op code. */ - if (nstate == IEEE80211_S_RUN) { - /* - * Unblock the VAP queue; a RUN->RUN state can happen - * on a STA+AP setup on the AP vap. See wakeupwaiting(). - */ - vap->iv_ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - } - - /* No actual transition, skip post processing */ - if (ostate == nstate) - goto done; - if (nstate == IEEE80211_S_RUN) { /* * OACTIVE may be set on the vap if the upper layer @@ -2602,12 +2590,28 @@ ieee80211_newstate_cb(void *xvap, int npending) * * Note this can also happen as a result of SLEEP->RUN * (i.e. coming out of power save mode). + * + * Historically this was done only for a state change + * but is needed earlier; see next comment. The 2nd half + * of the work is still only done in case of an actual + * state change below. + */ + /* + * Unblock the VAP queue; a RUN->RUN state can happen + * on a STA+AP setup on the AP vap. See wakeupwaiting(). */ vap->iv_ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* * XXX TODO Kick-start a VAP queue - this should be a method! */ + } + + /* No actual transition, skip post processing */ + if (ostate == nstate) + goto done; + + if (nstate == IEEE80211_S_RUN) { /* bring up any vaps waiting on us */ wakeupwaiting(vap);