From nobody Wed Nov 29 16:38:48 2023 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 4SgQ4n2t56z52xFN; Wed, 29 Nov 2023 16:38: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 4SgQ4m6mG7z3KsN; Wed, 29 Nov 2023 16:38:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701275929; 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=52ODhGKiwsiL7dsPlZSgfHWok4SZgXoOie9qj1C71YY=; b=v04yEiSCi4KGQjexMyGuD61/NxT4XxAP3Avm8C4tmU8CLwaX9+B6fdYeK7n/Fl0enTRk7g yC3oCJj9t+8cyC/JwjO/nAMctfAJiiMrKe+NRfAFfcb0Czy4AiF9ZJrlQ+F/U0eTqyzRkq CpuPlsrdPYiX2vh85koEk8T3Vms5QM1EDtw4FQdCBsYbOZqMipn+xmnosHmhSvL/U1Yrz+ rUpjKCmdG4VEh1ELPqZyKLfAW/oZDooaz34m2Frf4hHkPfZ9TSDiSdsFjGsE4g3bR5GIlE lJGNvpJpUbojTiLm3xsoyUQ9XrHN5Fvh21rz3LLcVFHpTyLtfkTmu2xX8xZKRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701275929; 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=52ODhGKiwsiL7dsPlZSgfHWok4SZgXoOie9qj1C71YY=; b=RMW7pA8B/U5cr6FngG2i6A/sn41/7H1DURO+idExKdxg4qdR9Lcc2Mc9kfSp7DuvWihmYG d88uE61EKUXfdoxcAx6GWrdKa+GZEsRoYdArIi+yqBktTNVk34uGYOUwfzNe5pfjvN2o3q MtCENxAihBo4m3+GGro2DOkx9Fba599hYCpKuUORdOydPE00R3oGDHnUAUojIvOQwMEXe+ FUQUDyUFzbrshjJLMYN78HIxRssg7hTY+ilI7z19djsJc13gMaevLkMa/6xRXTKWlMjFXb ag9MsAayDjTmzrj7IScktumSkn4U01I9dHDnF7KZyv2S7VaNK49OxWjCXxnvBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1701275929; a=rsa-sha256; cv=none; b=D0AfvungrGM8VAiMSDWJFpy4xDx6NoHXrP0xh0494i/qTq7nsn3YEtPunjKv5mYxIkNxPf G8ORzQQJyaETtD79CHecqpu+D4e6o8n3VPJMIvOSmU2BmFwISpo6XhUvMCbtDVCBB31S+7 3+Gc5MxYl8uNfCqbnxW9GGlFq3mSm7WSjJ0F5CG5TgB7oakhPZOegaq6RJ5UwmwpreFYUM qsjbYUyl/9BV66eG/7rfxeAdhmAyXOxMTjjuXZR/JMXN5tFqjbZw6duJX9qrcwVVWdUeul Gny+Vd+1TMn7Zsr+hPltR4euoGBev7pNJbQPKZQ5PIIt3ObmPzcW7GGteRq/sQ== 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 4SgQ4m5t4kz1C7c; Wed, 29 Nov 2023 16:38:48 +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 3ATGcmE6046842; Wed, 29 Nov 2023 16:38:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3ATGcmma046839; Wed, 29 Nov 2023 16:38:48 GMT (envelope-from git) Date: Wed, 29 Nov 2023 16:38:48 GMT Message-Id: <202311291638.3ATGcmma046839@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: 2706935c2e46 - stable/13 - LinuxKPI: 802.11: add unconditional error reporting 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: 2706935c2e4661c7e934ea940685cd9ffc93c058 Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=2706935c2e4661c7e934ea940685cd9ffc93c058 commit 2706935c2e4661c7e934ea940685cd9ffc93c058 Author: Bjoern A. Zeeb AuthorDate: 2023-10-09 19:11:50 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-11-29 16:36:11 +0000 LinuxKPI: 802.11: add unconditional error reporting Multiple reports have shown missed state transitions in net80211 without major cause obvious (or with a txq warning in iwlwifi). In order to better track down potential problems add unconditional ic_printf calls to any case in the lkpi state machine compat code which would let us return with an error in the hope that it helps us to catch the actual problems. Also remove the debug conditions from ieee80211_{beacon,connection}_loss which can also cause state transitions to have the ic_printf all the time there too. Sponsored by: The FreeBSD Foundation (cherry picked from commit 018d93ece16bd33077021383940d0da5121f0691) --- sys/compat/linuxkpi/common/src/linux_80211.c | 84 +++++++++++++++++++++------- 1 file changed, 64 insertions(+), 20 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index b3aec1e712bd..da88a0e7c150 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -1012,6 +1012,8 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int vif->bss_conf.chandef.center_freq2 = conf->def.center_freq2; } else { + ic_printf(vap->iv_ic, "%s:%d: mo_add_chanctx " + "failed: %d\n", __func__, __LINE__, error); goto out; } @@ -1024,6 +1026,8 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int if (error == EOPNOTSUPP) error = 0; if (error != 0) { + ic_printf(vap->iv_ic, "%s:%d: mo_assign_vif_chanctx " + "failed: %d\n", __func__, __LINE__, error); lkpi_80211_mo_remove_chanctx(hw, conf); lchanctx = CHANCTX_CONF_TO_LCHANCTX(conf); free(lchanctx, M_LKPI80211); @@ -1049,6 +1053,8 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int lsta = lkpi_lsta_alloc(vap, ni->ni_macaddr, hw, ni); if (lsta == NULL) { error = ENOMEM; + ic_printf(vap->iv_ic, "%s:%d: lkpi_lsta_alloc " + "failed: %d\n", __func__, __LINE__, error); goto out; } lsta->ni = ieee80211_ref_node(ni); @@ -1068,6 +1074,8 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int error = lkpi_80211_mo_sta_state(hw, vif, lsta, IEEE80211_STA_NONE); if (error != 0) { IMPROVE("do we need to undo the chan ctx?"); + ic_printf(vap->iv_ic, "%s:%d: mo_sta_state(NONE) " + "failed: %d\n", __func__, __LINE__, error); goto out; } #if 0 @@ -1169,6 +1177,8 @@ lkpi_sta_auth_to_scan(struct ieee80211vap *vap, enum ieee80211_state nstate, int error = lkpi_80211_mo_sta_state(hw, vif, lsta, IEEE80211_STA_NOTEXIST); if (error != 0) { IMPROVE("do we need to undo the chan ctx?"); + ic_printf(vap->iv_ic, "%s:%d: mo_sta_state(NOTEXIST) " + "failed: %d\n", __func__, __LINE__, error); goto out; } #if 0 @@ -1247,8 +1257,11 @@ lkpi_sta_auth_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, in KASSERT(lsta->state == IEEE80211_STA_NONE, ("%s: lsta %p state not " "NONE: %#x\n", __func__, lsta, lsta->state)); error = lkpi_80211_mo_sta_state(hw, vif, lsta, IEEE80211_STA_AUTH); - if (error != 0) + if (error != 0) { + ic_printf(vap->iv_ic, "%s:%d: mo_sta_state(AUTH) " + "failed: %d\n", __func__, __LINE__, error); goto out; + } /* End mgd_complete_tx. */ if (lsta->in_mgd) { @@ -1386,8 +1399,11 @@ _lkpi_sta_assoc_to_down(struct ieee80211vap *vap, enum ieee80211_state nstate, i /* Call iv_newstate first so we get potential DISASSOC packet out. */ error = lvif->iv_newstate(vap, nstate, arg); - if (error != 0) + if (error != 0) { + ic_printf(vap->iv_ic, "%s:%d: iv_newstate(%p, %d, %d) " + "failed: %d\n", __func__, __LINE__, vap, nstate, arg, error); goto outni; + } IEEE80211_UNLOCK(vap->iv_ic); LKPI_80211_LHW_LOCK(lhw); @@ -1421,8 +1437,11 @@ _lkpi_sta_assoc_to_down(struct ieee80211vap *vap, enum ieee80211_state nstate, i KASSERT(lsta->state == IEEE80211_STA_AUTH, ("%s: lsta %p state not " "AUTH: %#x\n", __func__, lsta, lsta->state)); error = lkpi_80211_mo_sta_state(hw, vif, lsta, IEEE80211_STA_NONE); - if (error != 0) + if (error != 0) { + ic_printf(vap->iv_ic, "%s:%d: mo_sta_state(NONE) " + "failed: %d\n", __func__, __LINE__, error); goto out; + } lkpi_lsta_dump(lsta, ni, __func__, __LINE__); @@ -1442,6 +1461,8 @@ _lkpi_sta_assoc_to_down(struct ieee80211vap *vap, enum ieee80211_state nstate, i error = lkpi_80211_mo_sta_state(hw, vif, lsta, IEEE80211_STA_NOTEXIST); if (error != 0) { IMPROVE("do we need to undo the chan ctx?"); + ic_printf(vap->iv_ic, "%s:%d: mo_sta_state(NOTEXIST) " + "failed: %d\n", __func__, __LINE__, error); goto out; } @@ -1559,8 +1580,11 @@ lkpi_sta_assoc_to_run(struct ieee80211vap *vap, enum ieee80211_state nstate, int sta->wme = true; #endif error = lkpi_80211_mo_sta_state(hw, vif, lsta, IEEE80211_STA_ASSOC); - if (error != 0) + if (error != 0) { + ic_printf(vap->iv_ic, "%s:%d: mo_sta_state(ASSOC) " + "failed: %d\n", __func__, __LINE__, error); goto out; + } IMPROVE("wme / conf_tx [all]"); @@ -1634,6 +1658,8 @@ lkpi_sta_assoc_to_run(struct ieee80211vap *vap, enum ieee80211_state nstate, int error = lkpi_80211_mo_sta_state(hw, vif, lsta, IEEE80211_STA_AUTHORIZED); if (error != 0) { IMPROVE("undo some changes?"); + ic_printf(vap->iv_ic, "%s:%d: mo_sta_state(AUTHORIZED) " + "failed: %d\n", __func__, __LINE__, error); goto out; } @@ -1716,8 +1742,11 @@ lkpi_sta_run_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, int /* Call iv_newstate first so we get potential DISASSOC packet out. */ error = lvif->iv_newstate(vap, nstate, arg); - if (error != 0) + if (error != 0) { + ic_printf(vap->iv_ic, "%s:%d: iv_newstate(%p, %d, %d) " + "failed: %d\n", __func__, __LINE__, vap, nstate, arg, error); goto outni; + } IEEE80211_UNLOCK(vap->iv_ic); LKPI_80211_LHW_LOCK(lhw); @@ -1753,8 +1782,11 @@ lkpi_sta_run_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, int KASSERT(lsta->state == IEEE80211_STA_AUTHORIZED, ("%s: lsta %p state not " "AUTHORIZED: %#x\n", __func__, lsta, lsta->state)); error = lkpi_80211_mo_sta_state(hw, vif, lsta, IEEE80211_STA_ASSOC); - if (error != 0) + if (error != 0) { + ic_printf(vap->iv_ic, "%s:%d: mo_sta_state(ASSOC) " + "failed: %d\n", __func__, __LINE__, error); goto out; + } lkpi_lsta_dump(lsta, ni, __func__, __LINE__); @@ -1763,8 +1795,11 @@ lkpi_sta_run_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, int KASSERT(lsta->state == IEEE80211_STA_ASSOC, ("%s: lsta %p state not " "ASSOC: %#x\n", __func__, lsta, lsta->state)); error = lkpi_80211_mo_sta_state(hw, vif, lsta, IEEE80211_STA_AUTH); - if (error != 0) + if (error != 0) { + ic_printf(vap->iv_ic, "%s:%d: mo_sta_state(AUTH) " + "failed: %d\n", __func__, __LINE__, error); goto out; + } lkpi_lsta_dump(lsta, ni, __func__, __LINE__); @@ -1829,8 +1864,11 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int /* Call iv_newstate first so we get potential DISASSOC packet out. */ error = lvif->iv_newstate(vap, nstate, arg); - if (error != 0) + if (error != 0) { + ic_printf(vap->iv_ic, "%s:%d: iv_newstate(%p, %d, %d) " + "failed: %d\n", __func__, __LINE__, vap, nstate, arg, error); goto outni; + } IEEE80211_UNLOCK(vap->iv_ic); LKPI_80211_LHW_LOCK(lhw); @@ -1864,8 +1902,11 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int KASSERT(lsta->state == IEEE80211_STA_AUTHORIZED, ("%s: lsta %p state not " "AUTHORIZED: %#x\n", __func__, lsta, lsta->state)); error = lkpi_80211_mo_sta_state(hw, vif, lsta, IEEE80211_STA_ASSOC); - if (error != 0) + if (error != 0) { + ic_printf(vap->iv_ic, "%s:%d: mo_sta_state(ASSOC) " + "failed: %d\n", __func__, __LINE__, error); goto out; + } lkpi_lsta_dump(lsta, ni, __func__, __LINE__); @@ -1874,8 +1915,11 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int KASSERT(lsta->state == IEEE80211_STA_ASSOC, ("%s: lsta %p state not " "ASSOC: %#x\n", __func__, lsta, lsta->state)); error = lkpi_80211_mo_sta_state(hw, vif, lsta, IEEE80211_STA_AUTH); - if (error != 0) + if (error != 0) { + ic_printf(vap->iv_ic, "%s:%d: mo_sta_state(AUTH) " + "failed: %d\n", __func__, __LINE__, error); goto out; + } lkpi_lsta_dump(lsta, ni, __func__, __LINE__); @@ -1884,8 +1928,11 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int KASSERT(lsta->state == IEEE80211_STA_AUTH, ("%s: lsta %p state not " "AUTH: %#x\n", __func__, lsta, lsta->state)); error = lkpi_80211_mo_sta_state(hw, vif, lsta, IEEE80211_STA_NONE); - if (error != 0) + if (error != 0) { + ic_printf(vap->iv_ic, "%s:%d: mo_sta_state(NONE) " + "failed: %d\n", __func__, __LINE__, error); goto out; + } lkpi_lsta_dump(lsta, ni, __func__, __LINE__); @@ -1903,6 +1950,8 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int error = lkpi_80211_mo_sta_state(hw, vif, lsta, IEEE80211_STA_NOTEXIST); if (error != 0) { IMPROVE("do we need to undo the chan ctx?"); + ic_printf(vap->iv_ic, "%s:%d: mo_sta_state(NOTEXIST) " + "failed: %d\n", __func__, __LINE__, error); goto out; } @@ -4859,10 +4908,8 @@ linuxkpi_ieee80211_connection_loss(struct ieee80211_vif *vif) nstate = IEEE80211_S_INIT; arg = 0; /* Not a valid reason. */ -#ifdef LINUXKPI_DEBUG_80211 - if (linuxkpi_debug_80211 & D80211_TRACE) - ic_printf(vap->iv_ic, "%s: vif %p\n", __func__, vif); -#endif + ic_printf(vap->iv_ic, "%s: vif %p vap %p state %s\n", __func__, + vif, vap, ieee80211_state_name[vap->iv_state]); ieee80211_new_state(vap, nstate, arg); } @@ -4875,11 +4922,8 @@ linuxkpi_ieee80211_beacon_loss(struct ieee80211_vif *vif) lvif = VIF_TO_LVIF(vif); vap = LVIF_TO_VAP(lvif); -#ifdef LINUXKPI_DEBUG_80211 - if (linuxkpi_debug_80211 & D80211_TRACE || vap->iv_state != IEEE80211_S_RUN) - ic_printf(vap->iv_ic, "%s: vif %p vap %p state %s\n", __func__, - vif, vap, ieee80211_state_name[vap->iv_state]); -#endif + ic_printf(vap->iv_ic, "%s: vif %p vap %p state %s\n", __func__, + vif, vap, ieee80211_state_name[vap->iv_state]); ieee80211_beacon_miss(vap->iv_ic); }