From nobody Mon Feb 19 08:07:49 2024 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 4TdZsK4c4jz5B2mh; Mon, 19 Feb 2024 08:07:49 +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 4TdZsK27HGz4KDF; Mon, 19 Feb 2024 08:07:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330069; 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=5plwleapRWprJnJY/HoajrzYwgbIXeQtQTKbYewmC2s=; b=ZZAK+4SKRUpkH5rah0PCM1iQMYJ+3YrB3bPmYFWhkH130uQOwWyhXahPUW+8kGhdGdyDWB 6iPJtDbtBh3ut7sYTXN02SF78lUE+jhJcyIHel82oMdSJhAUgwj07OZi2qqZlAz3foMRk1 yvub4qS4L9vHHoZDc0AWssJMp+wn2FKY6jE+eBsezShlTh50cvxwSKY4220vAI3jfAlQOs PpigCzgzMkIdc+PJPD4xhLudxPOp1EBuWOY/iD7zD8mAEr6hwQ+s5LdIYuEZC3AQbfqtqf u6jBfAaCgBKkG2vtbvBF4z1F61Rn6c/vgHf30h1fFgaNhcYRK9DfgJOlGIsxkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330069; 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=5plwleapRWprJnJY/HoajrzYwgbIXeQtQTKbYewmC2s=; b=S0fSKKz91OgCstrgiZhBU1iqMVEzS1j5J706rWJjqC7MKVEgEePhVnOGVnGp6i9sg/Gske pMqzDz3Y2RXOxFigx1lLhZILF+9mWYBT1R+2sSQG4lbr0HYFyoS+GZ3o9vD+tluEwpEyBb yFxpipfITO7hIZbJHg5FqBLrQJRWsYWG8r0vv4z9QcChVgf687dt73pS/ggK/igtqC1xwt t1v5td+ukMpzeCKDd/7TEDjYIktVIPHd7oVrILd2IMFCGltD4Iv4wMg83IVYKsSx6aPYpe ZnePVg715/MnTdBL2zxtVMtNQC+hFD3MtzBGMuU8z0umkCj+X4QGBtURWv5GpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708330069; a=rsa-sha256; cv=none; b=GL+IjuC2xwhyxFdRnwWWPXt4Is0Q5rewEY0UiDmY6aTSEhszIHklCtlXJYUSsSY3laIjCC Vks8aqv03tIjsQKJG0ANqjGOwIhwkETx4XvLou/5UBsA5xMcSyJ6ruYnc/NN+Ywo2N80NT JNoqZ6qKwe1gbwebctIxehxIXG9c0f0A/Swv5iFP9QAchBoK7NuR3mqwvSonivX83RIWDG IZu0rwcEBB9mBGpCwqrIuf7b6/Fd/YnXIicVtjbvrCHePQSPMCiSBK9BElEWNw2R8Ly4ZC qbBACKjwN6V+7dRI5ryAhCFL9fVT/oUOZoE5ajgpEAu7dUfkdr+z5GVmOJImCg== 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 4TdZsK1F5yzRW1; Mon, 19 Feb 2024 08:07:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J87nsv015819; Mon, 19 Feb 2024 08:07:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J87nqK015816; Mon, 19 Feb 2024 08:07:49 GMT (envelope-from git) Date: Mon, 19 Feb 2024 08:07:49 GMT Message-Id: <202402190807.41J87nqK015816@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: a2764047702d - stable/13 - net80211: improve logging about state transitions lost 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/stable/13 X-Git-Reftype: branch X-Git-Commit: a2764047702db519aca9e1b3cf6b475e5a723c65 Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a2764047702db519aca9e1b3cf6b475e5a723c65 commit a2764047702db519aca9e1b3cf6b475e5a723c65 Author: Bjoern A. Zeeb AuthorDate: 2023-11-12 23:51:14 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 08:02:00 +0000 net80211: improve logging about state transitions lost It is possible that we call ieee80211_new_state_locked() again before a previous task finished to completion (not run yet or unlocked in between) since 5efea30f039c4 (and follow-up). In either case we would overwrite the new state and argument in the vap. While most drivers somehow deal with that (or not), LinuxKPI 802.11 compat code has KASSERTs to keep net80211, LinuxKPI and driver/firmware state in sync and they may trigger due to a missing transition or more likely a changed ni/lsta. Enhance the wlandebug +state logging for these cases so they are easier to debug. While here remove the unconditional logging to the message buffer; it has been here for a good decade but not helped to actually identify and sort the problem. Sponsored by: The FreeBSD Foundation Reviewed by: cc Differential Revision: https://reviews.freebsd.org/D42560 (cherry picked from commit 72bb33a36b62fa30f69f01d3f6ae372be2c95b59) --- sys/net80211/ieee80211_proto.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c index f6d144169c48..cf467c08462c 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -2510,6 +2510,13 @@ ieee80211_newstate_cb(void *xvap, int npending) nstate = vap->iv_nstate; arg = vap->iv_nstate_arg; + IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, + "%s:%d: running state update %s -> %s (%d)\n", + __func__, __LINE__, + ieee80211_state_name[vap->iv_state], + ieee80211_state_name[vap->iv_nstate], + npending); + if (vap->iv_flags_ext & IEEE80211_FEXT_REINIT) { /* * We have been requested to drop back to the INIT before @@ -2677,29 +2684,30 @@ ieee80211_new_state_locked(struct ieee80211vap *vap, * until this is completed. */ IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, - "%s: %s -> %s (%s) transition discarded\n", - __func__, + "%s:%d: %s -> %s (%s) transition discarded\n", + __func__, __LINE__, ieee80211_state_name[vap->iv_state], ieee80211_state_name[nstate], ieee80211_state_name[vap->iv_nstate]); return -1; } else if (vap->iv_state != vap->iv_nstate) { -#if 0 /* Warn if the previous state hasn't completed. */ IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, - "%s: pending %s -> %s transition lost\n", __func__, + "%s:%d: pending %s -> %s (now to %s) transition lost\n", + __func__, __LINE__, ieee80211_state_name[vap->iv_state], - ieee80211_state_name[vap->iv_nstate]); -#else - /* XXX temporarily enable to identify issues */ - if_printf(vap->iv_ifp, - "%s: pending %s -> %s transition lost\n", - __func__, ieee80211_state_name[vap->iv_state], - ieee80211_state_name[vap->iv_nstate]); -#endif + ieee80211_state_name[vap->iv_nstate], + ieee80211_state_name[nstate]); } } + IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, + "%s:%d: starting state update %s -> %s (%s)\n", + __func__, __LINE__, + ieee80211_state_name[vap->iv_state], + ieee80211_state_name[vap->iv_nstate], + ieee80211_state_name[nstate]); + nrunning = nscanning = 0; /* XXX can track this state instead of calculating */ TAILQ_FOREACH(vp, &ic->ic_vaps, iv_next) {